diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-08-26 17:10:32 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-08-26 17:10:32 -0700 |
commit | f40770096fe75180fba679ed349a63d195729c0c (patch) | |
tree | 63988c222bdeed12523d6e8a2411c77594dcdea5 /src/com/android | |
parent | b9b935d7cb2db897798d2d91fb425f6d531bf65b (diff) | |
download | packages_apps_settings-f40770096fe75180fba679ed349a63d195729c0c.zip packages_apps_settings-f40770096fe75180fba679ed349a63d195729c0c.tar.gz packages_apps_settings-f40770096fe75180fba679ed349a63d195729c0c.tar.bz2 |
Add a "show touches" option for demos and presentations.
Bug: 4569045
Change-Id: Ie074dbdc61c8e30222113edebdb2e4d5a83020e5
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index d93c333..bdbec97 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -59,6 +59,7 @@ public class DevelopmentSettings extends PreferenceFragment private static final String STRICT_MODE_KEY = "strict_mode"; private static final String POINTER_LOCATION_KEY = "pointer_location"; + private static final String SHOW_TOUCHES_KEY = "show_touches"; private static final String SHOW_SCREEN_UPDATES_KEY = "show_screen_updates"; private static final String SHOW_CPU_USAGE_KEY = "show_cpu_usage"; private static final String WINDOW_ANIMATION_SCALE_KEY = "window_animation_scale"; @@ -80,6 +81,7 @@ public class DevelopmentSettings extends PreferenceFragment private CheckBoxPreference mStrictMode; private CheckBoxPreference mPointerLocation; + private CheckBoxPreference mShowTouches; private CheckBoxPreference mShowScreenUpdates; private CheckBoxPreference mShowCpuUsage; private ListPreference mWindowAnimationScale; @@ -112,6 +114,7 @@ public class DevelopmentSettings extends PreferenceFragment mStrictMode = (CheckBoxPreference) findPreference(STRICT_MODE_KEY); mPointerLocation = (CheckBoxPreference) findPreference(POINTER_LOCATION_KEY); + mShowTouches = (CheckBoxPreference) findPreference(SHOW_TOUCHES_KEY); mShowScreenUpdates = (CheckBoxPreference) findPreference(SHOW_SCREEN_UPDATES_KEY); mShowCpuUsage = (CheckBoxPreference) findPreference(SHOW_CPU_USAGE_KEY); mWindowAnimationScale = (ListPreference) findPreference(WINDOW_ANIMATION_SCALE_KEY); @@ -155,6 +158,7 @@ public class DevelopmentSettings extends PreferenceFragment updatePasswordSummary(); updateStrictModeVisualOptions(); updatePointerLocationOptions(); + updateShowTouchesOptions(); updateFlingerOptions(); updateCpuUsageOptions(); updateAnimationScaleOptions(); @@ -229,6 +233,16 @@ public class DevelopmentSettings extends PreferenceFragment Settings.System.POINTER_LOCATION, 0) != 0); } + private void writeShowTouchesOptions() { + Settings.System.putInt(getActivity().getContentResolver(), + Settings.System.SHOW_TOUCHES, mShowTouches.isChecked() ? 1 : 0); + } + + private void updateShowTouchesOptions() { + mShowTouches.setChecked(Settings.System.getInt(getActivity().getContentResolver(), + Settings.System.SHOW_TOUCHES, 0) != 0); + } + private void updateFlingerOptions() { // magic communication with surface flinger. try { @@ -406,6 +420,8 @@ public class DevelopmentSettings extends PreferenceFragment writeStrictModeVisualOptions(); } else if (preference == mPointerLocation) { writePointerLocationOptions(); + } else if (preference == mShowTouches) { + writeShowTouchesOptions(); } else if (preference == mShowScreenUpdates) { writeFlingerOptions(); } else if (preference == mShowCpuUsage) { |