summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorP.Adarsh Reddy <quic_padarshr@quicinc.com>2020-06-10 22:24:38 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-10 22:24:38 +0000
commit69db28ed69400785c82b10f38eb3cc890021c9f0 (patch)
tree57001d84aa15b746832adb7ef0ce9e72fedf77cf
parent74a9d18645d8c76f8379f0cb54f0739b25937b3e (diff)
parent8ca09e94c400afc26e2f92589481d630e8e324f8 (diff)
Check for system_other existence in recovery mode as well. am: ddf27738af am: 8ca09e94c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/update_engine/+/11796618 Change-Id: I9be53bbff95af23b75aa73f90dca8d052ec149ab
-rw-r--r--dynamic_partition_control_android.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index 5ed604ab..ecd6252d 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -570,18 +570,15 @@ bool DynamicPartitionControlAndroid::GetSystemOtherPath(
path->clear();
*should_unmap = false;
- // In recovery, just erase no matter what.
- // - On devices with retrofit dynamic partitions, no logical partitions
- // should be mounted at this point. Hence it should be safe to erase.
- // Otherwise, do check that AVB is enabled on system_other before erasing.
- if (!IsRecovery()) {
- auto has_avb = IsAvbEnabledOnSystemOther();
- TEST_AND_RETURN_FALSE(has_avb.has_value());
- if (!has_avb.value()) {
- LOG(INFO) << "AVB is not enabled on system_other. Skip erasing.";
- return true;
- }
+ // Check that AVB is enabled on system_other before erasing.
+ auto has_avb = IsAvbEnabledOnSystemOther();
+ TEST_AND_RETURN_FALSE(has_avb.has_value());
+ if (!has_avb.value()) {
+ LOG(INFO) << "AVB is not enabled on system_other. Skip erasing.";
+ return true;
+ }
+ if (!IsRecovery()) {
// Found unexpected avb_keys for system_other on devices retrofitting
// dynamic partitions. Previous crash in update_engine may leave logical
// partitions mapped on physical system_other partition. It is difficult to