diff options
| author | P.Adarsh Reddy <quic_padarshr@quicinc.com> | 2020-06-08 23:17:36 +0530 |
|---|---|---|
| committer | Yifan Hong <elsk@google.com> | 2020-06-08 11:45:08 -0700 |
| commit | ddf27738af372b335c85ee5cf8a7d9fcab4cd7cf (patch) | |
| tree | 57001d84aa15b746832adb7ef0ce9e72fedf77cf | |
| parent | e2ad4d3bebd0d864400c5d6931dc8db2db3363f3 (diff) | |
Check for system_other existence in recovery mode as well.
This removes the recovery mode conditional, to ensure we
check for the existence of system_other in recovery mode as
well, before going ahead with performing avb related
operations on system_other.
Bug: 155053192
Test: adb sideload of OTA zip in recovery mode now passes
on a device which doesn't have system_other enabled.
Change-Id: I1884755aad2a8d37f540dbee73c7c7baab2759e7
Merged-In: I1884755aad2a8d37f540dbee73c7c7baab2759e7
| -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 |
