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
This commit is contained in:
Andres Morales
2016-03-22 12:50:33 -07:00
parent fb2bae9519
commit 0bb6f70a87

View File

@@ -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();