diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-10-11 11:03:36 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-10-11 11:07:05 -0700 |
commit | d6a24d505a237c26a280cfbeb5a3bedaca8a3f7d (patch) | |
tree | 7bc4b7fb2fa2b0d14dcccbe30af27ee575f00925 /src/com/android/settings/DeviceInfoSettings.java | |
parent | 84b90d533275be792954efc37e14f0c8fd409681 (diff) | |
download | packages_apps_Settings-d6a24d505a237c26a280cfbeb5a3bedaca8a3f7d.zip packages_apps_Settings-d6a24d505a237c26a280cfbeb5a3bedaca8a3f7d.tar.gz packages_apps_Settings-d6a24d505a237c26a280cfbeb5a3bedaca8a3f7d.tar.bz2 |
Fix issue #7328934: change threshold of developer options countdown toast
Delay showing toasts until the third tap. Also harden the dev
settings code that pokes system property changes to not crash
if a system service throws an exception back.
Change-Id: I1351e2c950f2bcc4fc72afb60995fd7f84319e3d
Diffstat (limited to 'src/com/android/settings/DeviceInfoSettings.java')
-rw-r--r-- | src/com/android/settings/DeviceInfoSettings.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java index f113da1..a4abfea 100644 --- a/src/com/android/settings/DeviceInfoSettings.java +++ b/src/com/android/settings/DeviceInfoSettings.java @@ -64,6 +64,8 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment { private static final String KEY_EQUIPMENT_ID = "fcc_equipment_id"; private static final String PROPERTY_EQUIPMENT_ID = "ro.ril.fccid"; + static final int TAPS_TO_BE_A_DEVELOPER = 7; + long[] mHits = new long[3]; int mDevHitCountdown; Toast mDevHitToast; @@ -152,7 +154,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment { super.onResume(); mDevHitCountdown = getActivity().getSharedPreferences(DevelopmentSettings.PREF_FILE, Context.MODE_PRIVATE).getBoolean(DevelopmentSettings.PREF_SHOW, - android.os.Build.TYPE.equals("eng")) ? -1 : 7; + android.os.Build.TYPE.equals("eng")) ? -1 : TAPS_TO_BE_A_DEVELOPER; mDevHitToast = null; } @@ -184,7 +186,8 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment { mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_on, Toast.LENGTH_LONG); mDevHitToast.show(); - } else if (mDevHitCountdown > 0) { + } else if (mDevHitCountdown > 0 + && mDevHitCountdown < (TAPS_TO_BE_A_DEVELOPER-2)) { if (mDevHitToast != null) { mDevHitToast.cancel(); } |