diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2011-12-06 15:24:37 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2011-12-07 14:35:59 -0800 |
commit | 3ca5a74c17a27e44ce13b39bc2f63edaa88c3ef5 (patch) | |
tree | 45dcae2858f3109779d6204a14b4a7a13c9b5b90 /packages/SettingsProvider | |
parent | 7cee31835de45eaff5922fc8647545d9bd30b567 (diff) | |
download | frameworks_base-3ca5a74c17a27e44ce13b39bc2f63edaa88c3ef5.zip frameworks_base-3ca5a74c17a27e44ce13b39bc2f63edaa88c3ef5.tar.gz frameworks_base-3ca5a74c17a27e44ce13b39bc2f63edaa88c3ef5.tar.bz2 |
Make the URL for the JavaScript based screen-reader used by WebView configurable.
The URl from which to inject a screen-reader for WebView accessiblity support should be
configurable because: 1) The accessibility engineering team should be able to point
devices to a staging build of the screen-reader; 2) We would like to be able to change
this URL via the Google services mechanism.
bug:5718543
Change-Id: I3d4d343f1c93e0e0173f04b2912949fe8a3566b9
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 5 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 21 |
2 files changed, 25 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 1ebed1f..4ea2c31 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -115,6 +115,11 @@ 0x200000038=0x03000701:0x03010701:0x03020701; </string> + <!-- Default for Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION_URL --> + <string name="def_accessibility_screen_reader_url" translatable="false"> + https://ssl.gstatic.com/accessibility/javascript/android/AndroidScriptChooser.user.js + </string> + <!-- Default for Settings.Secure.TOUCH_EXPLORATION_ENABLED --> <bool name="def_touch_exploration_enabled">false</bool> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 1fbe08d..a6a3303 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 = 73; + private static final int DATABASE_VERSION = 74; private Context mContext; @@ -986,6 +986,22 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 73; } + if (upgradeVersion == 73) { + // URL from which WebView loads a JavaScript based screen-reader. + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("INSERT INTO secure(name,value) VALUES(?,?);"); + loadStringSetting(stmt, Settings.Secure.ACCESSIBILITY_SCREEN_READER_URL, + R.string.def_accessibility_screen_reader_url); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + if (stmt != null) stmt.close(); + } + upgradeVersion = 74; + } + // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { @@ -1526,6 +1542,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, R.bool.def_accessibility_speak_password); + + loadStringSetting(stmt, Settings.Secure.ACCESSIBILITY_SCREEN_READER_URL, + R.string.def_accessibility_screen_reader_url); } finally { if (stmt != null) stmt.close(); } |