diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-08-02 15:08:04 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-08-02 15:13:01 -0700 |
commit | d5119bd39738853dc96156d93c3dfbd65dd601e7 (patch) | |
tree | 1f16cde5f42010ae61b849c9878ac2d02db623d3 /src/com/android/settings/DevelopmentSettings.java | |
parent | 8d7f9594cdcfd3e88c67db195aca6accc3c10274 (diff) | |
download | packages_apps_settings-d5119bd39738853dc96156d93c3dfbd65dd601e7.zip packages_apps_settings-d5119bd39738853dc96156d93c3dfbd65dd601e7.tar.gz packages_apps_settings-d5119bd39738853dc96156d93c3dfbd65dd601e7.tar.bz2 |
New development setting for ANRs.
Change-Id: I1fcde9d371bbb6e0eef0da7749a8c8cfb9a2c881
Diffstat (limited to 'src/com/android/settings/DevelopmentSettings.java')
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index 380af3c..2ca28e9 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -65,6 +65,8 @@ public class DevelopmentSettings extends PreferenceFragment = "immediately_destroy_activities"; private static final String APP_PROCESS_LIMIT_KEY = "app_process_limit"; + private static final String SHOW_ALL_ANRS_KEY = "show_all_anrs"; + private IWindowManager mWindowManager; private CheckBoxPreference mEnableAdb; @@ -81,6 +83,8 @@ public class DevelopmentSettings extends PreferenceFragment private CheckBoxPreference mImmediatelyDestroyActivities; private ListPreference mAppProcessLimit; + private CheckBoxPreference mShowAllANRs; + // To track whether Yes was clicked in the adb warning dialog private boolean mOkClicked; @@ -112,6 +116,9 @@ public class DevelopmentSettings extends PreferenceFragment mAppProcessLimit = (ListPreference) findPreference(APP_PROCESS_LIMIT_KEY); mAppProcessLimit.setOnPreferenceChangeListener(this); + mShowAllANRs = (CheckBoxPreference) findPreference( + SHOW_ALL_ANRS_KEY); + removeHdcpOptionsForProduction(); } @@ -144,6 +151,7 @@ public class DevelopmentSettings extends PreferenceFragment updateAnimationScaleOptions(); updateImmediatelyDestroyActivitiesOptions(); updateAppProcessLimitOptions(); + updateShowAllANRsOptions(); } private void updateHdcpValues() { @@ -330,6 +338,17 @@ public class DevelopmentSettings extends PreferenceFragment } } + private void writeShowAllANRsOptions() { + Settings.Secure.putInt(getActivity().getContentResolver(), + Settings.Secure.ANR_SHOW_BACKGROUND, + mShowAllANRs.isChecked() ? 1 : 0); + } + + private void updateShowAllANRsOptions() { + mShowAllANRs.setChecked(Settings.Secure.getInt( + getActivity().getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0); + } + @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { @@ -372,6 +391,8 @@ public class DevelopmentSettings extends PreferenceFragment writeCpuUsageOptions(); } else if (preference == mImmediatelyDestroyActivities) { writeImmediatelyDestroyActivitiesOptions(); + } else if (preference == mShowAllANRs) { + writeShowAllANRsOptions(); } return false; |