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

Commit d5f44204 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android Git Automerger
Browse files

am 1113e755: am ea25ea7e: Merge "Adding a system preference whether to speak...

am 1113e755: am ea25ea7e: Merge "Adding a system preference whether to speak passwords in accessibility mode." into ics-mr1

* commit '1113e755':
  Adding a system preference whether to speak passwords in accessibility mode.
parents 08943f7a 1113e755
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -17435,6 +17435,7 @@ package android.provider {
    method public static boolean putString(android.content.ContentResolver, java.lang.String, java.lang.String);
    method public static boolean putString(android.content.ContentResolver, java.lang.String, java.lang.String);
    method public static final void setLocationProviderEnabled(android.content.ContentResolver, java.lang.String, boolean);
    method public static final void setLocationProviderEnabled(android.content.ContentResolver, java.lang.String, boolean);
    field public static final java.lang.String ACCESSIBILITY_ENABLED = "accessibility_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 java.lang.String ADB_ENABLED = "adb_enabled";
    field public static final java.lang.String ADB_ENABLED = "adb_enabled";
    field public static final java.lang.String ALLOWED_GEOLOCATION_ORIGINS = "allowed_geolocation_origins";
    field public static final java.lang.String ALLOWED_GEOLOCATION_ORIGINS = "allowed_geolocation_origins";
    field public static final java.lang.String ALLOW_MOCK_LOCATION = "mock_location";
    field public static final java.lang.String ALLOW_MOCK_LOCATION = "mock_location";
+8 −2
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ import android.inputmethodservice.Keyboard.Key;
import android.media.AudioManager;
import android.media.AudioManager;
import android.os.Handler;
import android.os.Handler;
import android.os.Message;
import android.os.Message;
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.util.TypedValue;
import android.view.GestureDetector;
import android.view.GestureDetector;
@@ -967,8 +968,13 @@ public class KeyboardView extends View implements View.OnClickListener {
            AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
            AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
            onInitializeAccessibilityEvent(event);
            onInitializeAccessibilityEvent(event);
            String text = null;
            String text = null;
            // Add text only if headset is used to avoid leaking passwords.
            // This is very efficient since the properties are cached.
            if (mAudioManager.isBluetoothA2dpOn() || mAudioManager.isWiredHeadsetOn()) {
            final boolean speakPassword = Settings.Secure.getInt(mContext.getContentResolver(),
                    Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0) != 0;
            // Add text only if password announcement is enabled or if headset is
            // used to avoid leaking passwords.
            if (speakPassword || mAudioManager.isBluetoothA2dpOn()
                    || mAudioManager.isWiredHeadsetOn()) {
                switch (code) {
                switch (code) {
                    case Keyboard.KEYCODE_ALT:
                    case Keyboard.KEYCODE_ALT:
                        text = mContext.getString(R.string.keyboardview_keycode_alt);
                        text = mContext.getString(R.string.keyboardview_keycode_alt);
+6 −0
Original line number Original line Diff line number Diff line
@@ -2773,6 +2773,11 @@ public final class Settings {
        public static final String ENABLED_ACCESSIBILITY_SERVICES =
        public static final String ENABLED_ACCESSIBILITY_SERVICES =
            "enabled_accessibility_services";
            "enabled_accessibility_services";


        /**
         * Whether to speak passwords while in accessibility mode.
         */
        public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";

        /**
        /**
         * If injection of accessibility enhancing JavaScript scripts
         * If injection of accessibility enhancing JavaScript scripts
         * is enabled.
         * is enabled.
@@ -4121,6 +4126,7 @@ public final class Settings {
            ENABLED_ACCESSIBILITY_SERVICES,
            ENABLED_ACCESSIBILITY_SERVICES,
            TOUCH_EXPLORATION_ENABLED,
            TOUCH_EXPLORATION_ENABLED,
            ACCESSIBILITY_ENABLED,
            ACCESSIBILITY_ENABLED,
            ACCESSIBILITY_SPEAK_PASSWORD,
            TTS_USE_DEFAULTS,
            TTS_USE_DEFAULTS,
            TTS_DEFAULT_RATE,
            TTS_DEFAULT_RATE,
            TTS_DEFAULT_PITCH,
            TTS_DEFAULT_PITCH,
+3 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,9 @@
    <!-- Default for Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION -->
    <!-- Default for Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION -->
    <bool name="def_accessibility_script_injection">false</bool>
    <bool name="def_accessibility_script_injection">false</bool>


    <!-- Default for Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD -->
    <bool name="def_accessibility_speak_password">false</bool>

    <!-- Default for Settings.Secure.ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS -->
    <!-- Default for Settings.Secure.ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS -->
    <string name="def_accessibility_web_content_key_bindings" translatable="false">
    <string name="def_accessibility_web_content_key_bindings" translatable="false">
            <!-- DPAD/Trackball UP - traverse previous on current axis and send an event. -->
            <!-- DPAD/Trackball UP - traverse previous on current axis and send an event. -->
+20 −1
Original line number Original line Diff line number Diff line
@@ -63,7 +63,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
    // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
    // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
    // is properly propagated through your change.  Not doing so will result in a loss of user
    // is properly propagated through your change.  Not doing so will result in a loss of user
    // settings.
    // settings.
    private static final int DATABASE_VERSION = 71;
    private static final int DATABASE_VERSION = 72;


    private Context mContext;
    private Context mContext;


@@ -952,6 +952,22 @@ public class DatabaseHelper extends SQLiteOpenHelper {
            upgradeVersion = 71;
            upgradeVersion = 71;
        }
        }


        if (upgradeVersion == 71) {
             // New setting to specify whether to speak passwords in accessibility mode.
            db.beginTransaction();
            SQLiteStatement stmt = null;
            try {
                stmt = db.compileStatement("INSERT INTO secure(name,value)"
                        + " VALUES(?,?);");
                loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD,
                        R.bool.def_accessibility_speak_password);
            } finally {
                db.endTransaction();
                if (stmt != null) stmt.close();
            }
            upgradeVersion = 72;
        }

        // *** Remember to update DATABASE_VERSION above!
        // *** Remember to update DATABASE_VERSION above!


        if (upgradeVersion != currentVersion) {
        if (upgradeVersion != currentVersion) {
@@ -1489,6 +1505,9 @@ public class DatabaseHelper extends SQLiteOpenHelper {


            loadBooleanSetting(stmt, Settings.Secure.TOUCH_EXPLORATION_ENABLED,
            loadBooleanSetting(stmt, Settings.Secure.TOUCH_EXPLORATION_ENABLED,
                    R.bool.def_touch_exploration_enabled);
                    R.bool.def_touch_exploration_enabled);

            loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD,
                    R.bool.def_accessibility_speak_password);
        } finally {
        } finally {
            if (stmt != null) stmt.close();
            if (stmt != null) stmt.close();
        }
        }