From 0bb6f70a8789a0b89beaf01ee463f63fc6876ba8 Mon Sep 17 00:00:00 2001 From: Andres Morales Date: Tue, 22 Mar 2016 12:50:33 -0700 Subject: [PATCH] don't toggle OEM unlocking if the preference is not enabled Toggling the top-level switch is bypassing the disabled state of the switch and leaving it in an inconsistent and unrecoverable state. Bug: 26863852 Change-Id: I9fed626b743fd6aac2c20910493bdec4778cc629 --- src/com/android/settings/DevelopmentSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index d6044735098..a34253d499e 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -1836,7 +1836,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment (BatteryManager.BATTERY_PLUGGED_AC | BatteryManager.BATTERY_PLUGGED_USB) : 0); } else if (preference == mBtHciSnoopLog) { writeBtHciSnoopLogOptions(); - } else if (preference == mEnableOemUnlock) { + } else if (preference == mEnableOemUnlock && mEnableOemUnlock.isEnabled()) { if (mEnableOemUnlock.isChecked()) { if (!showKeyguardConfirmation(getResources(), REQUEST_CODE_ENABLE_OEM_UNLOCK)) { confirmEnableOemUnlock();