Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 385912ee authored by Phil Weaver's avatar Phil Weaver
Browse files

Deprecate "speak passwords" setting.

This will now be controlled by individual accessibility services.
We'll provide the password information to them, and they can
present or hide the information as it makes sense for their users.

Password information was anyway provided when a headset was
connected.

Bug: 28139568
Test: Manually verified that TalkBack now speaks passwords on the
lock screen and in text views. Since I'm removing functionality
that didn't have tests, it's tricky to have specific tests.
Change-Id: Ic3c724ccce5762ee9dcd9e7dcbd4eae6734dd05e
parent eb0a2901
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34264,7 +34264,7 @@ package android.provider {
    method public static final deprecated void setLocationProviderEnabled(android.content.ContentResolver, java.lang.String, boolean);
    field public static final java.lang.String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = "accessibility_display_inversion_enabled";
    field public static final java.lang.String ACCESSIBILITY_ENABLED = "accessibility_enabled";
    field public static final java.lang.String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
    field public static final deprecated java.lang.String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
    field public static final deprecated java.lang.String ADB_ENABLED = "adb_enabled";
    field public static final java.lang.String ALLOWED_GEOLOCATION_ORIGINS = "allowed_geolocation_origins";
    field public static final deprecated java.lang.String ALLOW_MOCK_LOCATION = "mock_location";
+1 −1
Original line number Diff line number Diff line
@@ -37369,7 +37369,7 @@ package android.provider {
    method public static final deprecated void setLocationProviderEnabled(android.content.ContentResolver, java.lang.String, boolean);
    field public static final java.lang.String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = "accessibility_display_inversion_enabled";
    field public static final java.lang.String ACCESSIBILITY_ENABLED = "accessibility_enabled";
    field public static final java.lang.String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
    field public static final deprecated java.lang.String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
    field public static final deprecated java.lang.String ADB_ENABLED = "adb_enabled";
    field public static final java.lang.String ALLOWED_GEOLOCATION_ORIGINS = "allowed_geolocation_origins";
    field public static final deprecated java.lang.String ALLOW_MOCK_LOCATION = "mock_location";
+1 −1
Original line number Diff line number Diff line
@@ -34387,7 +34387,7 @@ package android.provider {
    method public static final deprecated void setLocationProviderEnabled(android.content.ContentResolver, java.lang.String, boolean);
    field public static final java.lang.String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = "accessibility_display_inversion_enabled";
    field public static final java.lang.String ACCESSIBILITY_ENABLED = "accessibility_enabled";
    field public static final java.lang.String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
    field public static final deprecated java.lang.String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
    field public static final deprecated java.lang.String ADB_ENABLED = "adb_enabled";
    field public static final java.lang.String ALLOWED_GEOLOCATION_ORIGINS = "allowed_geolocation_origins";
    field public static final deprecated java.lang.String ALLOW_MOCK_LOCATION = "mock_location";
+25 −43
Original line number Diff line number Diff line
@@ -988,15 +988,7 @@ public class KeyboardView extends View implements View.OnClickListener {
        if (mAccessibilityManager.isEnabled()) {
            AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
            onInitializeAccessibilityEvent(event);
            String text = null;
            // This is very efficient since the properties are cached.
            final boolean speakPassword = Settings.Secure.getIntForUser(
                    mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0,
                    UserHandle.USER_CURRENT_OR_SELF) != 0;
            // Add text only if password announcement is enabled or if headset is
            // used to avoid leaking passwords.
            if (speakPassword || mAudioManager.isBluetoothA2dpOn()
                    || mAudioManager.isWiredHeadsetOn()) {
            final String text;
            switch (code) {
                case Keyboard.KEYCODE_ALT:
                    text = mContext.getString(R.string.keyboardview_keycode_alt);
@@ -1022,16 +1014,6 @@ public class KeyboardView extends View implements View.OnClickListener {
                default:
                    text = String.valueOf((char) code);
            }
            } else if (!mHeadsetRequiredToHearPasswordsAnnounced) {
                // We want the waring for required head set to be send with both the
                // hover enter and hover exit event, so set the flag after the exit.
                if (eventType == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT) {
                    mHeadsetRequiredToHearPasswordsAnnounced = true;
                }
                text = mContext.getString(R.string.keyboard_headset_required_to_hear_password);
            } else {
                text = mContext.getString(R.string.keyboard_password_character_no_headset);
            }
            event.getText().add(text);
            mAccessibilityManager.sendAccessibilityEvent(event);
        }
+5 −0
Original line number Diff line number Diff line
@@ -5492,7 +5492,12 @@ public final class Settings {

        /**
         * Whether to speak passwords while in accessibility mode.
         *
         * @deprecated The speaking of passwords is controlled by individual accessibility services.
         * Apps should ignore this setting and provide complete information to accessibility
         * at all times, which was the behavior when this value was {@code true}.
         */
        @Deprecated
        public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";

        /**
Loading