summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/settings/DevelopmentSettings.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 563e3bf..fd0e62f 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
+ * Portions Copyright (C) 2013 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.
@@ -1098,6 +1099,11 @@ public class DevelopmentSettings extends PreferenceFragment
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();
}
}
}
@@ -1320,8 +1326,14 @@ public class DevelopmentSettings extends PreferenceFragment
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 if (dialog == mRootDialog) {
if (which == DialogInterface.BUTTON_POSITIVE) {
writeRootAccessOptions(mSelectedRootValue);