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
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index d604473..a34253d 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -1836,7 +1836,7 @@
(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();