diff options
Diffstat (limited to 'src/com/android/settings/DevelopmentSettings.java')
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index 0d8b6a4..24fe2bb 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -335,7 +335,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment findPreference(DEBUG_DEBUGGING_CATEGORY_KEY); mEnableAdb = findAndInitSwitchPref(ENABLE_ADB); - mAdbNotify = findAndInitSwitchPref(ADB_NOTIFY); + mAdbNotify = (SwitchPreference) findPreference(ADB_NOTIFY); mAllPrefs.add(mAdbNotify); mAdbOverNetwork = findAndInitSwitchPref(ADB_TCPIP); @@ -387,7 +387,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mMockLocationAppPref = findPreference(MOCK_LOCATION_APP_KEY); mAllPrefs.add(mMockLocationAppPref); - mVerifyAppsOverUsb = findAndInitSwitchPref(VERIFY_APPS_OVER_USB_KEY); + mVerifyAppsOverUsb = (SwitchPreference) findPreference(VERIFY_APPS_OVER_USB_KEY); + mAllPrefs.add(mVerifyAppsOverUsb); if (!showVerifierSetting()) { if (debugDebuggingCategory != null) { debugDebuggingCategory.removePreference(mVerifyAppsOverUsb); @@ -774,6 +775,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment resetDebuggerOptions(); writeLogdSizeOption(null); resetRootAccessOptions(); + resetAdbNotifyOptions(); + resetVerifyAppsOverUsbOptions(); resetDevelopmentShortcutOptions(); resetUpdateRecoveryOptions(); writeAnimationScaleOption(0, mWindowAnimationScale, null); @@ -832,6 +835,11 @@ public class DevelopmentSettings extends SettingsPreferenceFragment updateRootAccessOptions(); } + private void resetAdbNotifyOptions() { + CMSettings.Secure.putInt(getActivity().getContentResolver(), + CMSettings.Secure.ADB_NOTIFY, 1); + } + private void updateStayAwakeOptions() { int index = Settings.Global.getInt(getActivity().getContentResolver(), Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0); @@ -1018,6 +1026,11 @@ public class DevelopmentSettings extends SettingsPreferenceFragment Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, mVerifyAppsOverUsb.isChecked() ? 1 : 0); } + private void resetVerifyAppsOverUsbOptions() { + Settings.Global.putInt(getActivity().getContentResolver(), + Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, 1); + } + private boolean enableVerifierSetting() { final ContentResolver cr = getActivity().getContentResolver(); if (Settings.Global.getInt(cr, Settings.Global.ADB_ENABLED, 0) == 0) { |