summaryrefslogtreecommitdiff
path: root/aosp/dynamic_partition_control_android.cc
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2021-04-16 13:30:02 -0700
committerYifan Hong <elsk@google.com>2021-04-16 16:04:00 -0700
commit265a8e37cf04749645c535d8292b7bccba6ef0cf (patch)
tree979a6d184a5c28775e7d18435ce213a1b8a72d19 /aosp/dynamic_partition_control_android.cc
parent3a1293a41d71330d542c9f7e11bf7fab926dcfb9 (diff)
DynamicPartitions: Check precondition for non-snapshot updates properly.
This is a revision to I29af8aa653a8e. I29af8aa653a8e disables the check temporarily for secondary OTA. Re-enable the check properly. Test: pass Bug: 185552745 Change-Id: Ie4e52b8d374c6b3624a2fd4f1576390a37189ff0
Diffstat (limited to 'aosp/dynamic_partition_control_android.cc')
-rw-r--r--aosp/dynamic_partition_control_android.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/aosp/dynamic_partition_control_android.cc b/aosp/dynamic_partition_control_android.cc
index be24e449..ab349a82 100644
--- a/aosp/dynamic_partition_control_android.cc
+++ b/aosp/dynamic_partition_control_android.cc
@@ -969,9 +969,16 @@ bool DynamicPartitionControlAndroid::UpdatePartitionMetadata(
uint32_t target_slot,
const DeltaArchiveManifest& manifest) {
// Check preconditions.
- LOG_IF(WARNING, !GetVirtualAbFeatureFlag().IsEnabled() || IsRecovery())
- << "UpdatePartitionMetadata is called on a Virtual A/B device "
- "but source partitions is not deleted. This is not allowed.";
+ if (GetVirtualAbFeatureFlag().IsEnabled()) {
+ CHECK(!target_supports_snapshot_ || IsRecovery())
+ << "Must use snapshot on VAB device when target build supports VAB and "
+ "not sideloading.";
+ LOG_IF(INFO, !target_supports_snapshot_)
+ << "Not using snapshot on VAB device because target build does not "
+ "support snapshot. Secondary or downgrade OTA?";
+ LOG_IF(INFO, IsRecovery())
+ << "Not using snapshot on VAB device because sideloading.";
+ }
// If applying downgrade from Virtual A/B to non-Virtual A/B, the left-over
// COW group needs to be deleted to ensure there are enough space to create