diff options
| author | P.Adarsh Reddy <quic_padarshr@quicinc.com> | 2020-06-10 22:06:59 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-10 22:06:59 +0000 |
| commit | 8ca09e94c400afc26e2f92589481d630e8e324f8 (patch) | |
| tree | 57001d84aa15b746832adb7ef0ce9e72fedf77cf | |
| parent | a818ead4d0d280276afd10d075a08e0332ad8ec5 (diff) | |
| parent | ddf27738af372b335c85ee5cf8a7d9fcab4cd7cf (diff) | |
Check for system_other existence in recovery mode as well. am: ddf27738af
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/update_engine/+/11796618
Change-Id: Ia82f42a31f047525ba49b055c4a18b1756bc60ed
| -rw-r--r-- | dynamic_partition_control_android.cc | 19 |
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 |
