Merge "Adding temporary setting for enabling touch exploration."
This commit is contained in:
committed by
Android (Google) Code Review
commit
93a727d5d5
@@ -75,6 +75,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
||||
private static final String POWER_BUTTON_ENDS_CALL_CHECKBOX =
|
||||
"power_button_ends_call";
|
||||
|
||||
private static final String TOUCH_EXPLORATION_ENABLED_CHECKBOX =
|
||||
"touch_exploration_enabled";
|
||||
|
||||
private static final String KEY_TOGGLE_ACCESSIBILITY_SERVICE_CHECKBOX =
|
||||
"key_toggle_accessibility_service_checkbox";
|
||||
|
||||
@@ -93,6 +96,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
||||
|
||||
private PreferenceCategory mPowerButtonCategory;
|
||||
private CheckBoxPreference mPowerButtonEndsCallCheckBox;
|
||||
private CheckBoxPreference mTouchExplorationEnabledCheckBox;
|
||||
|
||||
private PreferenceGroup mAccessibilityServicesCategory;
|
||||
|
||||
@@ -128,6 +132,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
||||
mPowerButtonEndsCallCheckBox = (CheckBoxPreference) findPreference(
|
||||
POWER_BUTTON_ENDS_CALL_CHECKBOX);
|
||||
|
||||
mTouchExplorationEnabledCheckBox = (CheckBoxPreference) findPreference(
|
||||
TOUCH_EXPLORATION_ENABLED_CHECKBOX);
|
||||
|
||||
mLongPressTimeoutListPreference = (ListPreference) findPreference(
|
||||
KEY_LONG_PRESS_TIMEOUT_LIST_PREFERENCE);
|
||||
|
||||
@@ -155,6 +162,10 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
||||
getPreferenceScreen().removePreference(mPowerButtonCategory);
|
||||
}
|
||||
|
||||
boolean touchExplorationEnabled = (Settings.Secure.getInt(getContentResolver(),
|
||||
Settings.Secure.TOUCH_EXPLORATION_REQUESTED, 0) == 1);
|
||||
mTouchExplorationEnabledCheckBox.setChecked(touchExplorationEnabled);
|
||||
|
||||
mLongPressTimeoutListPreference.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@@ -296,6 +307,10 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
||||
Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR,
|
||||
(isChecked ? Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_HANGUP
|
||||
: 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)) {
|
||||
handleToggleAccessibilityScriptInjection((CheckBoxPreference) preference);
|
||||
} else if (preference instanceof CheckBoxPreference) {
|
||||
|
Reference in New Issue
Block a user