diff options
author | Geoffrey Borggaard <geoffreyb@google.com> | 2013-09-04 00:41:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-04 00:41:51 +0000 |
commit | af6cdb2b30a875b0a563196bb5c405b080b3cbe0 (patch) | |
tree | d33686e1ea1281458a7da24af2de026be7cd15b2 /src/com/android/settings | |
parent | f4c4294c502d774c1c56d6b2dca56a604cc85f87 (diff) | |
parent | 9e543cd0f730aefc95241c7221262e7fff0ceea1 (diff) | |
download | packages_apps_Settings-af6cdb2b30a875b0a563196bb5c405b080b3cbe0.tar.gz packages_apps_Settings-af6cdb2b30a875b0a563196bb5c405b080b3cbe0.tar.bz2 packages_apps_Settings-af6cdb2b30a875b0a563196bb5c405b080b3cbe0.zip |
Merge "Pin protect going into developer mode." into klp-dev
Diffstat (limited to 'src/com/android/settings')
-rw-r--r-- | src/com/android/settings/DeviceInfoSettings.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java index ac74221e5..7e947415b 100644 --- a/src/com/android/settings/DeviceInfoSettings.java +++ b/src/com/android/settings/DeviceInfoSettings.java @@ -37,7 +37,7 @@ import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; -public class DeviceInfoSettings extends SettingsPreferenceFragment { +public class DeviceInfoSettings extends RestrictedSettingsFragment { private static final String LOG_TAG = "DeviceInfoSettings"; @@ -70,12 +70,20 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment { int mDevHitCountdown; Toast mDevHitToast; + public DeviceInfoSettings() { + super(null /* Don't PIN protect the entire screen */); + } + @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); addPreferencesFromResource(R.xml.device_info_settings); + // We only call ensurePinRestrictedPreference() when mDevHitCountdown == 0. + // This will keep us from entering developer mode without a PIN. + protectByRestrictions(KEY_BUILD_NUMBER); + setStringSummary(KEY_FIRMWARE_VERSION, Build.VERSION.RELEASE); findPreference(KEY_FIRMWARE_VERSION).setEnabled(true); setValueSummary(KEY_BASEBAND_VERSION, "gsm.version.baseband"); @@ -178,6 +186,11 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment { if (UserHandle.myUserId() != UserHandle.USER_OWNER) return true; if (mDevHitCountdown > 0) { + if (mDevHitCountdown == 1) { + if (super.ensurePinRestrictedPreference(preference)) { + return true; + } + } mDevHitCountdown--; if (mDevHitCountdown == 0) { getActivity().getSharedPreferences(DevelopmentSettings.PREF_FILE, |