diff options
| author | Yifan Hong <elsk@google.com> | 2021-04-16 13:21:20 -0700 |
|---|---|---|
| committer | Semavi Ulusoy <doc.divxm@gmail.com> | 2021-07-06 00:35:15 +0300 |
| commit | 1770e0b949324ceaaec81c84a53e800a0fa34c56 (patch) | |
| tree | 9c396fab178acbadf4f31e9639280ed741e9a4e5 /dynamic_partition_control_android.h | |
| parent | 3280c52cabf526c403e13b44d94510650d13fe3a (diff) | |
Check allocatable space in super based on whether VAB is
enabled on the device, instead of basing on whether snapshot
is used for this update.
On VAB devices where snapshot is not used, e.g. secondary
update, we don't want to divide allocatable space by half.
The logic changes from:
if (!retrofit DAP && ! update uses snapshot && !sideload)
allocatable_space /= 2
to
if (!retrofit DAP && ! VAB enabled)
allocatable_space /= 2
All other changes are cosmetic.
Test: pass
Bug: 185552745
Change-Id: If182da4fdbc4b39160347205ccfa50642afc5511
Diffstat (limited to 'dynamic_partition_control_android.h')
| -rw-r--r-- | dynamic_partition_control_android.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dynamic_partition_control_android.h b/dynamic_partition_control_android.h index 28699643..13817a4f 100644 --- a/dynamic_partition_control_android.h +++ b/dynamic_partition_control_android.h @@ -208,6 +208,18 @@ class DynamicPartitionControlAndroid : public DynamicPartitionControlInterface { const DeltaArchiveManifest& manifest, uint64_t* required_size); + enum SpaceLimit { + // Most restricted: if sum(groups) > super / 2, error + ERROR_IF_EXCEEDED_HALF_OF_SUPER, + // Implies ERROR_IF_EXCEEDED_SUPER; then, if sum(groups) > super / 2, warn + WARN_IF_EXCEEDED_HALF_OF_SUPER, + // Least restricted: if sum(groups) > super, error + ERROR_IF_EXCEEDED_SUPER, + }; + // Helper of CheckSuperPartitionAllocatableSpace. Determine limit for groups + // and partitions. + SpaceLimit GetSpaceLimit(bool use_snapshot); + // Returns true if the allocatable space in super partition is larger than // the size of dynamic partition groups in the manifest. bool CheckSuperPartitionAllocatableSpace( |
