aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Hansen <rhansen@rhansen.org>2020-05-04 20:46:09 -0400
committerNolen Johnson <johnsonnolen@gmail.com>2020-05-14 21:01:22 -0400
commitc2bd647e863fe7b91d47006fb5f630bc7adff151 (patch)
treec19de8fc13aea34056b764e51ca4b333530d4801
parent2070c421746f4b0a71ee0e750259f91812225725 (diff)
downloadandroid_bootable_recovery-c2bd647e863fe7b91d47006fb5f630bc7adff151.tar.gz
android_bootable_recovery-c2bd647e863fe7b91d47006fb5f630bc7adff151.tar.bz2
android_bootable_recovery-c2bd647e863fe7b91d47006fb5f630bc7adff151.zip
recovery: Remove the "Format system partition" menu on A/B devices
Addresses https://gitlab.com/LineageOS/issues/android/-/issues/1893 Change-Id: I05351055ff0d67d67e5cbe295492e7ed553c2c53
-rw-r--r--recovery_main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 2749c35a..afba2504 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -449,6 +449,13 @@ int main(int argc, char** argv) {
device->RemoveMenuItemForAction(Device::WIPE_CACHE);
}
+ if (android::base::GetBoolProperty("ro.build.ab_update", false)) {
+ // There's not much point in formatting the active slot's system partition
+ // because ROMs are flashed to the inactive slot. Removing the menu option
+ // prevents users from accidentally trashing a functioning ROM.
+ device->RemoveMenuItemForAction(Device::WIPE_SYSTEM);
+ }
+
if (!android::base::GetBoolProperty("ro.boot.dynamic_partitions", false) &&
!android::base::GetBoolProperty("ro.fastbootd.available", false)) {
device->RemoveMenuItemForAction(Device::ENTER_FASTBOOT);