diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2011-12-05 11:42:07 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2011-12-05 14:54:59 -0800 |
commit | 55f937abe1a4fedb86c2679c66f0b5220ec3780e (patch) | |
tree | 880f926d03c61252fbad516cfde201c316c10ca8 /packages | |
parent | 003c15d72ccd3856d5abfe6d66a2a40d0eca85bc (diff) | |
download | frameworks_base-55f937abe1a4fedb86c2679c66f0b5220ec3780e.zip frameworks_base-55f937abe1a4fedb86c2679c66f0b5220ec3780e.tar.gz frameworks_base-55f937abe1a4fedb86c2679c66f0b5220ec3780e.tar.bz2 |
Adding a system preference whether to speak passwords in accessibility mode.
By default we do not speak passwords if the user has no headset. However,
many users find this too restrictive and would like a way to enable
password announcement. While we cannot speak the passwords all the time
,to avoid leaking them, we expose a preference so each user can choose
the option that best works for him/her.
bug:5712607
Change-Id: I6eb0c40834abe5297f7dc74be02d180a5bef0174
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 3 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 21 |
2 files changed, 23 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 7a98615..1ebed1f 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -80,6 +80,9 @@ <!-- Default for Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION --> <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 --> <string name="def_accessibility_web_content_key_bindings" translatable="false"> <!-- DPAD/Trackball UP - traverse previous on current axis and send an event. --> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 080d345..8360b72 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -63,7 +63,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // 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 // settings. - private static final int DATABASE_VERSION = 71; + private static final int DATABASE_VERSION = 72; private Context mContext; @@ -952,6 +952,22 @@ public class DatabaseHelper extends SQLiteOpenHelper { 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! if (upgradeVersion != currentVersion) { @@ -1490,6 +1506,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.Secure.TOUCH_EXPLORATION_ENABLED, R.bool.def_touch_exploration_enabled); + + loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, + R.bool.def_accessibility_speak_password); } finally { if (stmt != null) stmt.close(); } |