diff options
| author | Eric Arseneau <earseneau@google.com> | 2020-10-12 15:39:28 -0700 |
|---|---|---|
| committer | Ali B <abittin@gmail.com> | 2021-07-03 13:22:29 +0300 |
| commit | e843fb5ee9cd01c68b245ca9013c09d2503c7d4d (patch) | |
| tree | 2045ac247afd6862db6ded91938a6e2d1a3ee57d | |
| parent | e5144db2294aa08b29e828619965e36ef65f04aa (diff) | |
Check allocatable space correctly when sideloading on VAB
Picked single logical fix for this error. See bug for details.
Test: pre-submit
Bug: 169781891
Change-Id: I4facf2cd157143846c873e2b458d37356692d68c
| -rw-r--r-- | dynamic_partition_control_android.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc index ecd6252d..708380a8 100644 --- a/dynamic_partition_control_android.cc +++ b/dynamic_partition_control_android.cc @@ -795,7 +795,12 @@ bool DynamicPartitionControlAndroid::UpdatePartitionMetadata( std::string expr; uint64_t allocatable_space = builder->AllocatableSpace(); - if (!GetDynamicPartitionsFeatureFlag().IsRetrofit()) { + // On device retrofitting dynamic partitions, allocatable_space = super. + // On device launching dynamic partitions w/o VAB, + // allocatable_space = super / 2. + // On device launching dynamic partitions with VAB, allocatable_space = super. + if (!GetDynamicPartitionsFeatureFlag().IsRetrofit() && + !GetVirtualAbFeatureFlag().IsEnabled()) { allocatable_space /= 2; expr = "half of "; } |
