diff options
author | Thiago Vinícius Freire de Araújo Ribeiro <thiagovfar@gmail.com> | 2013-05-05 13:58:59 -0300 |
---|---|---|
committer | Thiago Vinícius Freire de Araújo Ribeiro <thiagovfar@gmail.com> | 2013-05-05 18:16:48 -0300 |
commit | 785d5720dfcfa1b6f7ba605dde694360f50e30c5 (patch) | |
tree | aaa6c41e45f916e81b66df5001c8d685db9a6752 /src/com/android/settings/DevelopmentSettings.java | |
parent | 9ff25ee7280b1107f08e5a0eb03b050ce71d797e (diff) | |
download | packages_apps_settings-785d5720dfcfa1b6f7ba605dde694360f50e30c5.zip packages_apps_settings-785d5720dfcfa1b6f7ba605dde694360f50e30c5.tar.gz packages_apps_settings-785d5720dfcfa1b6f7ba605dde694360f50e30c5.tar.bz2 |
Development Settings: fix setting reset on disable
When Development Settings are disabled, some settings are
reset to values other than the default. This fixes it.
- No need to have resetAdvancedReboot(), as it is already
reset by the "unckeck all checkboxes" logic.
- Adb notify should reset to enabled
- Verify apps over usb should reset to enabled
Change-Id: If5d88d220d2a17d6e172b2f54facd4afa3bae904
Diffstat (limited to 'src/com/android/settings/DevelopmentSettings.java')
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index 0cfa703..66db6c1 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -233,7 +233,8 @@ public class DevelopmentSettings extends PreferenceFragment addPreferencesFromResource(R.xml.development_prefs); mEnableAdb = findAndInitCheckboxPref(ENABLE_ADB); - mAdbNotify = findAndInitCheckboxPref(ADB_NOTIFY); + mAdbNotify = (CheckBoxPreference) findPreference(ADB_NOTIFY); + mAllPrefs.add(mAdbNotify); mBugreport = findPreference(BUGREPORT); mBugreportInPower = findAndInitCheckboxPref(BUGREPORT_IN_POWER_KEY); mAdbOverNetwork = findAndInitCheckboxPref(ADB_TCPIP); @@ -253,7 +254,8 @@ public class DevelopmentSettings extends PreferenceFragment mDebugAppPref = findPreference(DEBUG_APP_KEY); mAllPrefs.add(mDebugAppPref); mWaitForDebugger = findAndInitCheckboxPref(WAIT_FOR_DEBUGGER_KEY); - mVerifyAppsOverUsb = findAndInitCheckboxPref(VERIFY_APPS_OVER_USB_KEY); + mVerifyAppsOverUsb = (CheckBoxPreference) findPreference(VERIFY_APPS_OVER_USB_KEY); + mAllPrefs.add(mVerifyAppsOverUsb); if (!showVerifierSetting()) { PreferenceGroup debugDebuggingCategory = (PreferenceGroup) findPreference(DEBUG_DEBUGGING_CATEGORY_KEY); @@ -497,11 +499,6 @@ public class DevelopmentSettings extends PreferenceFragment updateAdvancedRebootOptions(); } - private void resetAdvancedRebootOptions() { - Settings.Secure.putInt(getActivity().getContentResolver(), - Settings.Secure.ADVANCED_REBOOT, 0); - } - private void writeAdvancedRebootOptions() { Settings.Secure.putInt(getActivity().getContentResolver(), Settings.Secure.ADVANCED_REBOOT, @@ -552,7 +549,8 @@ public class DevelopmentSettings extends PreferenceFragment } resetDebuggerOptions(); resetRootAccessOptions(); - resetAdvancedRebootOptions(); + resetAdbNotifyOptions(); + resetVerifyAppsOverUsbOptions(); writeAnimationScaleOption(0, mWindowAnimationScale, null); writeAnimationScaleOption(1, mTransitionAnimationScale, null); writeAnimationScaleOption(2, mAnimatorDurationScale, null); @@ -604,6 +602,11 @@ public class DevelopmentSettings extends PreferenceFragment updateRootAccessOptions(); } + private void resetAdbNotifyOptions() { + Settings.Secure.putInt(getActivity().getContentResolver(), + Settings.Secure.ADB_NOTIFY, 1); + } + private void updateHdcpValues() { int index = 1; // Defaults to drm-only. Needs to match with R.array.hdcp_checking_values ListPreference hdcpChecking = (ListPreference) findPreference(HDCP_CHECKING_KEY); @@ -686,6 +689,11 @@ public class DevelopmentSettings extends PreferenceFragment } } + private void resetVerifyAppsOverUsbOptions() { + Settings.Global.putInt(getActivity().getContentResolver(), + Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, 1); + } + private void updateVerifyAppsOverUsbOptions() { updateCheckBox(mVerifyAppsOverUsb, Settings.Global.getInt(getActivity().getContentResolver(), Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, 1) != 0); |