diff options
author | DvTonder <david.vantonder@gmail.com> | 2012-11-28 19:58:59 -0500 |
---|---|---|
committer | DvTonder <david.vantonder@gmail.com> | 2012-11-28 20:13:08 -0500 |
commit | c06e11e730f481cb6516d1d5da2457f0a7f633a7 (patch) | |
tree | f1f1a58716f0cde219d02474fe84bd7f8b019fab /src/com/android | |
parent | 082d592e35f6f4260438f6bbc33ac2b6b64287e6 (diff) | |
download | packages_apps_settings-c06e11e730f481cb6516d1d5da2457f0a7f633a7.zip packages_apps_settings-c06e11e730f481cb6516d1d5da2457f0a7f633a7.tar.gz packages_apps_settings-c06e11e730f481cb6516d1d5da2457f0a7f633a7.tar.bz2 |
Settings: Make Perf settings act just like dev setting - start hidden
The Performance settings should not show until the owner of the
device enables development options, guest users should not be able
to turn it on.
Change-Id: Ib08d29bfd92ad44c71d02c115e12064ddf4704e0
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/DeviceInfoSettings.java | 49 | ||||
-rw-r--r-- | src/com/android/settings/Settings.java | 3 |
2 files changed, 28 insertions, 24 deletions
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java index 76235ba..44dc638 100644 --- a/src/com/android/settings/DeviceInfoSettings.java +++ b/src/com/android/settings/DeviceInfoSettings.java @@ -206,35 +206,38 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment { } } } else if (preference.getKey().equals(KEY_BUILD_NUMBER)) { - if (mDevHitCountdown > 0) { - mDevHitCountdown--; - if (mDevHitCountdown == 0) { - getActivity().getSharedPreferences(DevelopmentSettings.PREF_FILE, - Context.MODE_PRIVATE).edit().putBoolean( - DevelopmentSettings.PREF_SHOW, true).apply(); - if (mDevHitToast != null) { - mDevHitToast.cancel(); + // Only allow the owner of the device to turn on dev and performance options + if (UserHandle.myUserId() == UserHandle.USER_OWNER) { + if (mDevHitCountdown > 0) { + mDevHitCountdown--; + if (mDevHitCountdown == 0) { + getActivity().getSharedPreferences(DevelopmentSettings.PREF_FILE, + Context.MODE_PRIVATE).edit().putBoolean( + DevelopmentSettings.PREF_SHOW, true).apply(); + if (mDevHitToast != null) { + mDevHitToast.cancel(); + } + mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_on, + Toast.LENGTH_LONG); + mDevHitToast.show(); + } else if (mDevHitCountdown > 0 + && mDevHitCountdown < (TAPS_TO_BE_A_DEVELOPER-2)) { + if (mDevHitToast != null) { + mDevHitToast.cancel(); + } + mDevHitToast = Toast.makeText(getActivity(), getResources().getString( + R.string.show_dev_countdown, mDevHitCountdown), + Toast.LENGTH_SHORT); + mDevHitToast.show(); } - mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_on, - Toast.LENGTH_LONG); - mDevHitToast.show(); - } else if (mDevHitCountdown > 0 - && mDevHitCountdown < (TAPS_TO_BE_A_DEVELOPER-2)) { + } else if (mDevHitCountdown < 0) { if (mDevHitToast != null) { mDevHitToast.cancel(); } - mDevHitToast = Toast.makeText(getActivity(), getResources().getString( - R.string.show_dev_countdown, mDevHitCountdown), - Toast.LENGTH_SHORT); + mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_already, + Toast.LENGTH_LONG); mDevHitToast.show(); } - } else if (mDevHitCountdown < 0) { - if (mDevHitToast != null) { - mDevHitToast.cancel(); - } - mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_already, - Toast.LENGTH_LONG); - mDevHitToast.show(); } } return super.onPreferenceTreeClick(preferenceScreen, preference); diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java index 4f92d2c..75943e0 100644 --- a/src/com/android/settings/Settings.java +++ b/src/com/android/settings/Settings.java @@ -473,7 +473,8 @@ public class Settings extends PreferenceActivity || Utils.isMonkeyRunning()) { target.remove(i); } - } else if (id == R.id.development_settings) { + } else if (id == R.id.development_settings + || id == R.id.performance_settings) { if (!showDev) { target.remove(i); } |