summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/DeviceInfoSettings.java
diff options
context:
space:
mode:
authorGeoffrey Borggaard <geoffreyb@google.com>2013-08-30 16:07:20 -0400
committerGeoffrey Borggaard <geoffreyb@google.com>2013-08-30 16:16:21 -0400
commit9e543cd0f730aefc95241c7221262e7fff0ceea1 (patch)
tree719435cc3306b1d125f83bedb4810cd91f8e9f89 /src/com/android/settings/DeviceInfoSettings.java
parentac19f2bc1c65865fa59feb7fbd9e19dd259048c3 (diff)
downloadpackages_apps_Settings-9e543cd0f730aefc95241c7221262e7fff0ceea1.zip
packages_apps_Settings-9e543cd0f730aefc95241c7221262e7fff0ceea1.tar.gz
packages_apps_Settings-9e543cd0f730aefc95241c7221262e7fff0ceea1.tar.bz2
Pin protect going into developer mode.
Developer mode turns on ADB which we definately don't want students to do. Bug: 10549646 Change-Id: Ibba6231d36427985da6c258002e319e33a15b9b8
Diffstat (limited to 'src/com/android/settings/DeviceInfoSettings.java')
-rw-r--r--src/com/android/settings/DeviceInfoSettings.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index ac74221..7e94741 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,