<string name="accessibility_toggle_large_text_title">Large text</string>
<!-- Title for the accessibility preference to power button to end a call. [CHAR LIMIT=35] -->
<string name="accessibility_power_button_ends_call_title">Power button ends call</string>
+ <!-- Title for the accessibility preference to speak passwords. [CHAR LIMIT=35] -->
+ <string name="accessibility_speak_password_title">Speak passwords</string>
<!-- Title for accessibility preference to enable touch exploration mode. [CHAR LIMIT=35] -->
<string name="accessibility_touch_exploration_title">Explore by touch</string>
<!-- Summary for accessibility of the touch exploration mode. [CHAR LIMIT=NONE] -->
android:persistent="false"
android:order="3"/>
+ <CheckBoxPreference
+ android:key="toggle_speak_password_preference"
+ android:title="@string/accessibility_speak_password_title"
+ android:persistent="false"
+ android:order="4"/>
+
<PreferenceScreen
android:key="toggle_touch_exploration_preference"
android:title="@string/accessibility_touch_exploration_title"
android:fragment="com.android.settings.AccessibilitySettings$ToggleTouchExplorationFragment"
- android:order="4" >
+ android:order="5" >
<extra android:name="title" android:value="@string/accessibility_touch_exploration_title" />
<extra android:name="summary" android:value="@string/accessibility_touch_exploration_summary" />
<extra android:name="enable_warning_title" android:value="@android:string/dialog_alert_title" />
android:entries="@array/long_press_timeout_selector_titles"
android:entryValues="@array/long_press_timeout_selector_values"
android:persistent="false"
- android:order="5"/>
+ android:order="6"/>
<com.android.settings.AccessibilityEnableScriptInjectionPreference
android:key="toggle_script_injection_preference"
android:positiveButtonText="@string/accessibility_script_injection_button_allow"
android:negativeButtonText="@string/accessibility_script_injection_button_disallow"
android:persistent="false"
- android:order="6"/>
+ android:order="7"/>
</PreferenceCategory>
"toggle_power_button_ends_call_preference";
private static final String TOGGLE_AUTO_ROTATE_SCREEN_PREFERENCE =
"toggle_auto_rotate_screen_preference";
+ private static final String TOGGLE_SPEAK_PASSWORD_PREFERENCE =
+ "toggle_speak_password_preference";
private static final String TOGGLE_TOUCH_EXPLORATION_PREFERENCE =
"toggle_touch_exploration_preference";
private static final String SELECT_LONG_PRESS_TIMEOUT_PREFERENCE =
private CheckBoxPreference mToggleLargeTextPreference;
private CheckBoxPreference mTogglePowerButtonEndsCallPreference;
private CheckBoxPreference mToggleAutoRotateScreenPreference;
+ private CheckBoxPreference mToggleSpeakPasswordPreference;
private Preference mToggleTouchExplorationPreference;
private ListPreference mSelectLongPressTimeoutPreference;
private AccessibilityEnableScriptInjectionPreference mToggleScriptInjectionPreference;
} else if (mToggleAutoRotateScreenPreference == preference) {
handleToggleAutoRotateScreenPreferenceClick();
return true;
+ } else if (mToggleSpeakPasswordPreference == preference) {
+ handleToggleSpeakPasswordPreferenceClick();
}
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
}
}
+ private void handleToggleSpeakPasswordPreferenceClick() {
+ Settings.Secure.putInt(getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD,
+ mToggleSpeakPasswordPreference.isChecked() ? 1 : 0);
+ }
+
private void initializeAllPreferences() {
mServicesCategory = (PreferenceCategory) findPreference(SERVICES_CATEGORY);
mSystemsCategory = (PreferenceCategory) findPreference(SYSTEM_CATEGORY);
mToggleAutoRotateScreenPreference =
(CheckBoxPreference) findPreference(TOGGLE_AUTO_ROTATE_SCREEN_PREFERENCE);
+ // Speak passwords.
+ mToggleSpeakPasswordPreference =
+ (CheckBoxPreference) findPreference(TOGGLE_SPEAK_PASSWORD_PREFERENCE);
+
// Touch exploration enabled.
mToggleTouchExplorationPreference = findPreference(TOGGLE_TOUCH_EXPLORATION_PREFERENCE);
Settings.System.ACCELEROMETER_ROTATION, 0) != 0;
mToggleAutoRotateScreenPreference.setChecked(autoRotationEnabled);
+ // Speak passwords.
+ final boolean speakPasswordEnabled = Settings.Secure.getInt(getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0) != 0;
+ mToggleSpeakPasswordPreference.setChecked(speakPasswordEnabled);
+
// Touch exploration enabled.
if (AccessibilityManager.getInstance(getActivity()).isEnabled()) {
mSystemsCategory.addPreference(mToggleTouchExplorationPreference);