Adding temporary setting for enabling touch exploration.
Change-Id: I81cef6f3bf4e533da1082bf836a74e38fe718af3
This commit is contained in:
@@ -2693,6 +2693,8 @@ found in the list of installed applications.</string>
|
|||||||
<string name="accessibility_power_button_ends_call">Power button ends call</string>
|
<string name="accessibility_power_button_ends_call">Power button ends call</string>
|
||||||
<!-- Accessibility settings: power button behavior summary text -->
|
<!-- Accessibility settings: power button behavior summary text -->
|
||||||
<string name="accessibility_power_button_ends_call_summary">During a call, pressing Power ends call instead of turning off screen</string>
|
<string name="accessibility_power_button_ends_call_summary">During a call, pressing Power ends call instead of turning off screen</string>
|
||||||
|
<!-- Accessibility settings: touch exploration state -->
|
||||||
|
<string name="accessibility_touch_exploration_enabled">Touch exploration</string>
|
||||||
|
|
||||||
<!-- Accessibility settings: button for lauching settings for an accessibility service -->
|
<!-- Accessibility settings: button for lauching settings for an accessibility service -->
|
||||||
<string name="settings_button">Settings</string>
|
<string name="settings_button">Settings</string>
|
||||||
|
@@ -56,6 +56,10 @@
|
|||||||
android:entries="@array/long_press_timeout_selector_titles"
|
android:entries="@array/long_press_timeout_selector_titles"
|
||||||
android:entryValues="@array/long_press_timeout_selector_values"
|
android:entryValues="@array/long_press_timeout_selector_values"
|
||||||
android:defaultValue="@string/long_press_timeout_selector_default_value"/>
|
android:defaultValue="@string/long_press_timeout_selector_default_value"/>
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="touch_exploration_enabled"
|
||||||
|
android:title="@string/accessibility_touch_exploration_enabled"
|
||||||
|
android:persistent="false" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -74,6 +74,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
private static final String POWER_BUTTON_ENDS_CALL_CHECKBOX =
|
private static final String POWER_BUTTON_ENDS_CALL_CHECKBOX =
|
||||||
"power_button_ends_call";
|
"power_button_ends_call";
|
||||||
|
|
||||||
|
private static final String TOUCH_EXPLORATION_ENABLED_CHECKBOX =
|
||||||
|
"touch_exploration_enabled";
|
||||||
|
|
||||||
private static final String KEY_TOGGLE_ACCESSIBILITY_SERVICE_CHECKBOX =
|
private static final String KEY_TOGGLE_ACCESSIBILITY_SERVICE_CHECKBOX =
|
||||||
"key_toggle_accessibility_service_checkbox";
|
"key_toggle_accessibility_service_checkbox";
|
||||||
|
|
||||||
@@ -92,6 +95,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
|
|
||||||
private PreferenceCategory mPowerButtonCategory;
|
private PreferenceCategory mPowerButtonCategory;
|
||||||
private CheckBoxPreference mPowerButtonEndsCallCheckBox;
|
private CheckBoxPreference mPowerButtonEndsCallCheckBox;
|
||||||
|
private CheckBoxPreference mTouchExplorationEnabledCheckBox;
|
||||||
|
|
||||||
private PreferenceGroup mAccessibilityServicesCategory;
|
private PreferenceGroup mAccessibilityServicesCategory;
|
||||||
|
|
||||||
@@ -127,6 +131,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
mPowerButtonEndsCallCheckBox = (CheckBoxPreference) findPreference(
|
mPowerButtonEndsCallCheckBox = (CheckBoxPreference) findPreference(
|
||||||
POWER_BUTTON_ENDS_CALL_CHECKBOX);
|
POWER_BUTTON_ENDS_CALL_CHECKBOX);
|
||||||
|
|
||||||
|
mTouchExplorationEnabledCheckBox = (CheckBoxPreference) findPreference(
|
||||||
|
TOUCH_EXPLORATION_ENABLED_CHECKBOX);
|
||||||
|
|
||||||
mLongPressTimeoutListPreference = (ListPreference) findPreference(
|
mLongPressTimeoutListPreference = (ListPreference) findPreference(
|
||||||
KEY_LONG_PRESS_TIMEOUT_LIST_PREFERENCE);
|
KEY_LONG_PRESS_TIMEOUT_LIST_PREFERENCE);
|
||||||
|
|
||||||
@@ -154,6 +161,10 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
getPreferenceScreen().removePreference(mPowerButtonCategory);
|
getPreferenceScreen().removePreference(mPowerButtonCategory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean touchExplorationEnabled = (Settings.Secure.getInt(getContentResolver(),
|
||||||
|
Settings.Secure.TOUCH_EXPLORATION_REQUESTED, 0) == 1);
|
||||||
|
mTouchExplorationEnabledCheckBox.setChecked(touchExplorationEnabled);
|
||||||
|
|
||||||
mLongPressTimeoutListPreference.setOnPreferenceChangeListener(this);
|
mLongPressTimeoutListPreference.setOnPreferenceChangeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,6 +306,10 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR,
|
Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR,
|
||||||
(isChecked ? Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_HANGUP
|
(isChecked ? Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_HANGUP
|
||||||
: Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF));
|
: Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF));
|
||||||
|
} else if (TOUCH_EXPLORATION_ENABLED_CHECKBOX.equals(key)) {
|
||||||
|
final int touchExplorationState = ((CheckBoxPreference) preference).isChecked() ? 1 : 0;
|
||||||
|
Settings.Secure.putInt(getContentResolver(),
|
||||||
|
Settings.Secure.TOUCH_EXPLORATION_REQUESTED, touchExplorationState);
|
||||||
} else if (TOGGLE_ACCESSIBILITY_SCRIPT_INJECTION_CHECKBOX.equals(key)) {
|
} else if (TOGGLE_ACCESSIBILITY_SCRIPT_INJECTION_CHECKBOX.equals(key)) {
|
||||||
handleToggleAccessibilityScriptInjection((CheckBoxPreference) preference);
|
handleToggleAccessibilityScriptInjection((CheckBoxPreference) preference);
|
||||||
} else if (preference instanceof CheckBoxPreference) {
|
} else if (preference instanceof CheckBoxPreference) {
|
||||||
|
Reference in New Issue
Block a user