diff options
author | DvTonder <david.vantonder@gmail.com> | 2013-01-30 20:45:16 -0500 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-26 17:14:33 -0700 |
commit | 5b777ee29683870e188ab37ebdfdeb2ec3f7827b (patch) | |
tree | 7dbc0527a508c2a1345376af7c1736f4fa9ac40e /src/com/android/settings/DevelopmentSettings.java | |
parent | 44b7e31eea5ac697905f7d4c5e996735adff59a4 (diff) | |
download | packages_apps_Settings-5b777ee29683870e188ab37ebdfdeb2ec3f7827b.zip packages_apps_Settings-5b777ee29683870e188ab37ebdfdeb2ec3f7827b.tar.gz packages_apps_Settings-5b777ee29683870e188ab37ebdfdeb2ec3f7827b.tar.bz2 |
Settings: Hide Development settings when it is turned off
This commit hides the Development and Performance settings items
when the user turns off Development settings. This sets things back
to tapping x number of times on the build number to once again enable
developer settings
Change-Id: I6003f73f5abee54bb000f01757ecffe7b68dba59
Diffstat (limited to 'src/com/android/settings/DevelopmentSettings.java')
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index a84492e..c1982a8 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -1,5 +1,6 @@ /* * Copyright (C) 2008 The Android Open Source Project + * Copyright (C) 2013-2014 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1603,6 +1604,11 @@ public class DevelopmentSettings extends SettingsPreferenceFragment Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0); mLastEnabledState = isChecked; setPrefsEnabledState(mLastEnabledState); + + // Hide development settings from the Settings menu (Android 4.2 behaviour) + getActivity().getSharedPreferences(PREF_FILE, Context.MODE_PRIVATE).edit() + .putBoolean(PREF_SHOW, false) + .apply(); } } } @@ -1888,6 +1894,13 @@ public class DevelopmentSettings extends SettingsPreferenceFragment Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1); mLastEnabledState = true; setPrefsEnabledState(mLastEnabledState); + + // Make sure the development settings is visible in the main Settings menu + // This is needed since we may have just turned off dev settings and want to + // turn it on again + getActivity().getSharedPreferences(PREF_FILE, Context.MODE_PRIVATE).edit() + .putBoolean(PREF_SHOW, true) + .apply(); } else { // Reset the toggle mSwitchBar.setChecked(false); |