Fully reset update state during ResetStatus() call
List of dynamic partitions is cached in memory, need to clear it during
ResetStatus(), as the next OTA update might have a different set of
dynamic partitions.
Test: OTA TP1A.220310.002-to-TP1A.220311.001,
ResetStatus(), then OTA
TP1A.220310.002-to-TP1A.220314.001
Bug: 224648567
Change-Id: Ie39fda2279fbcc48afb18a565389a32cfd19adc1
diff --git a/aosp/dynamic_partition_control_android.cc b/aosp/dynamic_partition_control_android.cc
index 6d33a09..e39e7bc 100644
--- a/aosp/dynamic_partition_control_android.cc
+++ b/aosp/dynamic_partition_control_android.cc
@@ -465,6 +465,9 @@
if (!SetTargetBuildVars(manifest)) {
return false;
}
+ for (auto& list : dynamic_partition_list_) {
+ list.clear();
+ }
// Although the current build supports dynamic partitions, the given payload
// doesn't use it for target partitions. This could happen when applying a
@@ -1280,6 +1283,9 @@
if (!GetVirtualAbFeatureFlag().IsEnabled()) {
return true;
}
+ for (auto& list : dynamic_partition_list_) {
+ list.clear();
+ }
LOG(INFO) << __func__ << " resetting update state and deleting snapshots.";
TEST_AND_RETURN_FALSE(prefs != nullptr);