From 7568392c00137bc0bd116763124d41e6d762b79c Mon Sep 17 00:00:00 2001 From: Andres Morales Date: Thu, 10 Jul 2014 09:47:30 -0700 Subject: [PATCH] Don't try to set OEM checkbox if not available Bug: 16199128 Change-Id: I09765de60d60a2351f915607e737db90fbd90c9e --- src/com/android/settings/DevelopmentSettings.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index 4c2b90df5e7..0e04298f6ec 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -290,6 +290,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mEnableOemUnlock = findAndInitCheckboxPref(ENABLE_OEM_UNLOCK); if (!showEnableOemUnlockPreference()) { removePreference(mEnableOemUnlock); + mEnableOemUnlock = null; } mAllowMockLocation = findAndInitCheckboxPref(ALLOW_MOCK_LOCATION); mPassword = (PreferenceScreen) findPreference(LOCAL_BACKUP_PASSWORD); @@ -510,7 +511,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0) != 0); updateCheckBox(mBtHciSnoopLog, Settings.Secure.getInt(cr, Settings.Secure.BLUETOOTH_HCI_LOG, 0) != 0); - updateCheckBox(mEnableOemUnlock, Utils.isOemUnlockEnabled(getActivity())); + if (mEnableOemUnlock != null) { + updateCheckBox(mEnableOemUnlock, Utils.isOemUnlockEnabled(getActivity())); + } updateCheckBox(mAllowMockLocation, Settings.Secure.getInt(cr, Settings.Secure.ALLOW_MOCK_LOCATION, 0) != 0); updateHdcpValues();