diff options
author | 2012-06-05 15:00:20 -0700 | |
---|---|---|
committer | 2012-06-05 15:00:20 -0700 | |
commit | 6b0d0fa3501247ccf3190c938dec580102fe0473 (patch) | |
tree | 013f3591c30f85d17f350a69c8d8367963c27f0e /java/src | |
parent | 79a979266d4b64213705a90583bff8847b6ebe64 (diff) | |
parent | f8233ec32d7ff4cf0874cfe68cef1a32f763184a (diff) | |
download | latinime-6b0d0fa3501247ccf3190c938dec580102fe0473.tar.gz latinime-6b0d0fa3501247ccf3190c938dec580102fe0473.tar.xz latinime-6b0d0fa3501247ccf3190c938dec580102fe0473.zip |
am f8233ec3: Merge "Refresh Accessibility key mapping when KeyboardView changes Keyboards." into jb-dev
* commit 'f8233ec32d7ff4cf0874cfe68cef1a32f763184a':
Refresh Accessibility key mapping when KeyboardView changes Keyboards.
Diffstat (limited to 'java/src')
3 files changed, 22 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java index 9986f6ec0..ba08c593c 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java @@ -85,9 +85,20 @@ public class AccessibilityEntityProvider extends AccessibilityNodeProviderCompat */ public void setView(KeyboardView keyboardView) { mKeyboardView = keyboardView; + updateParentLocation(); + + // Since this class is constructed lazily, we might not get a subsequent + // call to setKeyboard() and therefore need to call it now. + setKeyboard(mKeyboardView.getKeyboard()); + } + /** + * Sets the keyboard represented by this node provider. + * + * @param keyboard The keyboard to represent. + */ + public void setKeyboard(Keyboard keyboard) { assignVirtualViewIds(); - updateParentLocation(); } /** diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java index 59f1eec04..f6376d5f4 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java @@ -86,6 +86,12 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat { } } + public void setKeyboard(Keyboard keyboard) { + if (mAccessibilityNodeProvider != null) { + mAccessibilityNodeProvider.setKeyboard(keyboard); + } + } + /** * Proxy method for View.getAccessibilityNodeProvider(). This method is * called in SDK version 15 and higher to obtain the virtual node hierarchy diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index e917a8128..383298de9 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -468,6 +468,10 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.latinKeyboardView_setKeyboard(keyboard); } + + // This always needs to be set since the accessibility state can + // potentially change without the keyboard being set again. + AccessibleKeyboardViewProxy.getInstance().setKeyboard(keyboard); } /** |