From b01c3d2bf2d81d30b6b0b1f8012a2bcbbad5acd2 Mon Sep 17 00:00:00 2001
From: Svetoslav Ganov
index.
*/
public int getActionCode(int index) {
- return (mActionSequence[index] & MASK_ACTION) >> OFFSET_ACTION;
+ return (mActionSequence[index] & ACTION_MASK) >> ACTION_OFFSET;
}
/**
* @param index The first argument for a given action index.
*/
public int getFirstArgument(int index) {
- return (mActionSequence[index] & MASK_FIRST_ARGUMENT) >> OFFSET_FIRST_ARGUMENT;
+ return (mActionSequence[index] & FIRST_ARGUMENT_MASK) >> FIRST_ARGUMENT_OFFSET;
}
/**
* @param index The second argument for a given action index.
*/
public int getSecondArgument(int index) {
- return (mActionSequence[index] & MASK_SECOND_ARGUMENT) >> OFFSET_SECOND_ARGUMENT;
+ return (mActionSequence[index] & SECOND_ARGUMENT_MASK) >> SECOND_ARGUMENT_OFFSET;
}
/**
* @param index The third argument for a given action index.
*/
public int getThirdArgument(int index) {
- return (mActionSequence[index] & MASK_THIRD_ARGUMENT) >> OFFSET_THIRD_ARGUMENT;
+ return (mActionSequence[index] & THIRD_ARGUMENT_MASK) >> THIRD_ARGUMENT_OFFSET;
}
/**
* Creates a new instance.
- * @param key The key for the binding (key and meta state)
+ * @param keyCodeAndModifiers The key for the binding (key and modifiers).
* @param actionSequence The sequence of action for the binding.
- * @see #getKey()
*/
- public AccessibilityWebContentKeyBinding(int key, int[] actionSequence) {
- mKey = key;
+ public AccessibilityWebContentKeyBinding(long keyCodeAndModifiers, int[] actionSequence) {
+ mKeyCodeAndModifiers = keyCodeAndModifiers;
mActionSequence = actionSequence;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
- builder.append("key: ");
- builder.append(getKey());
- builder.append(", metaState: ");
- builder.append(getMetaState());
+ builder.append("modifiers: ");
+ builder.append(getModifiers());
builder.append(", keyCode: ");
builder.append(getKeyCode());
builder.append(", actions[");
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 4a9e44189fa0..a11f12a45cf0 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4545,16 +4545,28 @@ public class WebView extends AbsoluteLayout
// accessibility support
if (accessibilityScriptInjected()) {
- // if an accessibility script is injected we delegate to it the key handling.
- // this script is a screen reader which is a fully fledged solution for blind
- // users to navigate in and interact with web pages.
- mWebViewCore.sendMessage(EventHub.KEY_DOWN, event);
- return true;
- } else if (mAccessibilityInjector != null && mAccessibilityInjector.onKeyEvent(event)) {
- // if an accessibility injector is present (no JavaScript enabled or the site opts
- // out injecting our JavaScript screen reader) we let it decide whether to act on
- // and consume the event.
- return true;
+ if (AccessibilityManager.getInstance(mContext).isEnabled()) {
+ // if an accessibility script is injected we delegate to it the key handling.
+ // this script is a screen reader which is a fully fledged solution for blind
+ // users to navigate in and interact with web pages.
+ mWebViewCore.sendMessage(EventHub.KEY_DOWN, event);
+ return true;
+ } else {
+ // Clean up if accessibility was disabled after loading the current URL.
+ mAccessibilityScriptInjected = false;
+ }
+ } else if (mAccessibilityInjector != null) {
+ if (AccessibilityManager.getInstance(mContext).isEnabled()) {
+ if (mAccessibilityInjector.onKeyEvent(event)) {
+ // if an accessibility injector is present (no JavaScript enabled or the site
+ // opts out injecting our JavaScript screen reader) we let it decide whether
+ // to act on and consume the event.
+ return true;
+ }
+ } else {
+ // Clean up if accessibility was disabled after loading the current URL.
+ mAccessibilityInjector = null;
+ }
}
if (keyCode == KeyEvent.KEYCODE_PAGE_UP) {
@@ -4733,16 +4745,28 @@ public class WebView extends AbsoluteLayout
// accessibility support
if (accessibilityScriptInjected()) {
- // if an accessibility script is injected we delegate to it the key handling.
- // this script is a screen reader which is a fully fledged solution for blind
- // users to navigate in and interact with web pages.
- mWebViewCore.sendMessage(EventHub.KEY_UP, event);
- return true;
- } else if (mAccessibilityInjector != null && mAccessibilityInjector.onKeyEvent(event)) {
- // if an accessibility injector is present (no JavaScript enabled or the site opts
- // out injecting our JavaScript screen reader) we let it decide whether to act on
- // and consume the event.
- return true;
+ if (AccessibilityManager.getInstance(mContext).isEnabled()) {
+ // if an accessibility script is injected we delegate to it the key handling.
+ // this script is a screen reader which is a fully fledged solution for blind
+ // users to navigate in and interact with web pages.
+ mWebViewCore.sendMessage(EventHub.KEY_UP, event);
+ return true;
+ } else {
+ // Clean up if accessibility was disabled after loading the current URL.
+ mAccessibilityScriptInjected = false;
+ }
+ } else if (mAccessibilityInjector != null) {
+ if (AccessibilityManager.getInstance(mContext).isEnabled()) {
+ if (mAccessibilityInjector.onKeyEvent(event)) {
+ // if an accessibility injector is present (no JavaScript enabled or the site
+ // opts out injecting our JavaScript screen reader) we let it decide whether to
+ // act on and consume the event.
+ return true;
+ }
+ } else {
+ // Clean up if accessibility was disabled after loading the current URL.
+ mAccessibilityInjector = null;
+ }
}
if (keyCode >= KeyEvent.KEYCODE_DPAD_UP
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 066b8e7fad14..ec5f853e8ccb 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -91,16 +91,16 @@
0x16=0x04010100;
- 0x120013=0x03020701:0x03010201:0x03000101:0x03030001:0x03040001:0x03050001:0x03060001;
+ 0x200000013=0x03020701:0x03010201:0x03000101:0x03030001:0x03040001:0x03050001:0x03060001;
- 0x120014=0x03010001:0x03020101:0x03070201:0x03030701:0x03040701:0x03050701:0x03060701;
+ 0x200000014=0x03010001:0x03020101:0x03070201:0x03030701:0x03040701:0x03050701:0x03060701;
- 0x120015=0x03040301:0x03050401:0x03060501:0x03000601:0x03010601:0x03020601:0x03070601;
+ 0x200000015=0x03040301:0x03050401:0x03060501:0x03000601:0x03010601:0x03020601:0x03070601;
- 0x120016=0x03050601:0x03040501:0x03030401:0x03020301:0x03070301:0x03010301:0x03000301;
+ 0x200000016=0x03050601:0x03040501:0x03030401:0x03020301:0x03070301:0x03010301:0x03000301;
--
cgit v1.2.3-59-g8ed1b