Add a "show touches" option for demos and presentations.
Bug: 4569045 Change-Id: Ie074dbdc61c8e30222113edebdb2e4d5a83020e5
This commit is contained in:
@@ -3398,6 +3398,11 @@ found in the list of installed applications.</string>
|
|||||||
<!-- UI debug setting: show pointer location summary [CHAR LIMIT=50] -->
|
<!-- UI debug setting: show pointer location summary [CHAR LIMIT=50] -->
|
||||||
<string name="pointer_location_summary">Screen overlay showing current touch data</string>
|
<string name="pointer_location_summary">Screen overlay showing current touch data</string>
|
||||||
|
|
||||||
|
<!-- UI debug setting: show touches? [CHAR LIMIT=25] -->
|
||||||
|
<string name="show_touches">Show touches</string>
|
||||||
|
<!-- UI debug setting: show touches location summary [CHAR LIMIT=50] -->
|
||||||
|
<string name="show_touches_summary">Show visual feedback for touches</string>
|
||||||
|
|
||||||
<!-- UI debug setting: show where screen updates happen? [CHAR LIMIT=25] -->
|
<!-- UI debug setting: show where screen updates happen? [CHAR LIMIT=25] -->
|
||||||
<string name="show_screen_updates">Show screen updates</string>
|
<string name="show_screen_updates">Show screen updates</string>
|
||||||
<!-- UI debug setting: show screen updates summary [CHAR LIMIT=50] -->
|
<!-- UI debug setting: show screen updates summary [CHAR LIMIT=50] -->
|
||||||
|
@@ -63,6 +63,11 @@
|
|||||||
android:title="@string/pointer_location"
|
android:title="@string/pointer_location"
|
||||||
android:summary="@string/pointer_location_summary"/>
|
android:summary="@string/pointer_location_summary"/>
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="show_touches"
|
||||||
|
android:title="@string/show_touches"
|
||||||
|
android:summary="@string/show_touches_summary"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="show_screen_updates"
|
android:key="show_screen_updates"
|
||||||
android:title="@string/show_screen_updates"
|
android:title="@string/show_screen_updates"
|
||||||
|
@@ -59,6 +59,7 @@ public class DevelopmentSettings extends PreferenceFragment
|
|||||||
|
|
||||||
private static final String STRICT_MODE_KEY = "strict_mode";
|
private static final String STRICT_MODE_KEY = "strict_mode";
|
||||||
private static final String POINTER_LOCATION_KEY = "pointer_location";
|
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_SCREEN_UPDATES_KEY = "show_screen_updates";
|
||||||
private static final String SHOW_CPU_USAGE_KEY = "show_cpu_usage";
|
private static final String SHOW_CPU_USAGE_KEY = "show_cpu_usage";
|
||||||
private static final String WINDOW_ANIMATION_SCALE_KEY = "window_animation_scale";
|
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 mStrictMode;
|
||||||
private CheckBoxPreference mPointerLocation;
|
private CheckBoxPreference mPointerLocation;
|
||||||
|
private CheckBoxPreference mShowTouches;
|
||||||
private CheckBoxPreference mShowScreenUpdates;
|
private CheckBoxPreference mShowScreenUpdates;
|
||||||
private CheckBoxPreference mShowCpuUsage;
|
private CheckBoxPreference mShowCpuUsage;
|
||||||
private ListPreference mWindowAnimationScale;
|
private ListPreference mWindowAnimationScale;
|
||||||
@@ -112,6 +114,7 @@ public class DevelopmentSettings extends PreferenceFragment
|
|||||||
|
|
||||||
mStrictMode = (CheckBoxPreference) findPreference(STRICT_MODE_KEY);
|
mStrictMode = (CheckBoxPreference) findPreference(STRICT_MODE_KEY);
|
||||||
mPointerLocation = (CheckBoxPreference) findPreference(POINTER_LOCATION_KEY);
|
mPointerLocation = (CheckBoxPreference) findPreference(POINTER_LOCATION_KEY);
|
||||||
|
mShowTouches = (CheckBoxPreference) findPreference(SHOW_TOUCHES_KEY);
|
||||||
mShowScreenUpdates = (CheckBoxPreference) findPreference(SHOW_SCREEN_UPDATES_KEY);
|
mShowScreenUpdates = (CheckBoxPreference) findPreference(SHOW_SCREEN_UPDATES_KEY);
|
||||||
mShowCpuUsage = (CheckBoxPreference) findPreference(SHOW_CPU_USAGE_KEY);
|
mShowCpuUsage = (CheckBoxPreference) findPreference(SHOW_CPU_USAGE_KEY);
|
||||||
mWindowAnimationScale = (ListPreference) findPreference(WINDOW_ANIMATION_SCALE_KEY);
|
mWindowAnimationScale = (ListPreference) findPreference(WINDOW_ANIMATION_SCALE_KEY);
|
||||||
@@ -155,6 +158,7 @@ public class DevelopmentSettings extends PreferenceFragment
|
|||||||
updatePasswordSummary();
|
updatePasswordSummary();
|
||||||
updateStrictModeVisualOptions();
|
updateStrictModeVisualOptions();
|
||||||
updatePointerLocationOptions();
|
updatePointerLocationOptions();
|
||||||
|
updateShowTouchesOptions();
|
||||||
updateFlingerOptions();
|
updateFlingerOptions();
|
||||||
updateCpuUsageOptions();
|
updateCpuUsageOptions();
|
||||||
updateAnimationScaleOptions();
|
updateAnimationScaleOptions();
|
||||||
@@ -229,6 +233,16 @@ public class DevelopmentSettings extends PreferenceFragment
|
|||||||
Settings.System.POINTER_LOCATION, 0) != 0);
|
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() {
|
private void updateFlingerOptions() {
|
||||||
// magic communication with surface flinger.
|
// magic communication with surface flinger.
|
||||||
try {
|
try {
|
||||||
@@ -406,6 +420,8 @@ public class DevelopmentSettings extends PreferenceFragment
|
|||||||
writeStrictModeVisualOptions();
|
writeStrictModeVisualOptions();
|
||||||
} else if (preference == mPointerLocation) {
|
} else if (preference == mPointerLocation) {
|
||||||
writePointerLocationOptions();
|
writePointerLocationOptions();
|
||||||
|
} else if (preference == mShowTouches) {
|
||||||
|
writeShowTouchesOptions();
|
||||||
} else if (preference == mShowScreenUpdates) {
|
} else if (preference == mShowScreenUpdates) {
|
||||||
writeFlingerOptions();
|
writeFlingerOptions();
|
||||||
} else if (preference == mShowCpuUsage) {
|
} else if (preference == mShowCpuUsage) {
|
||||||
|
Reference in New Issue
Block a user