Announce the same key again

Bug: 15237246
Change-Id: Ie7023b727cb3eca9d0727a511b3d64a32a02cd3d
main
Tadashi G. Takaoka 2014-05-27 10:54:20 +09:00
parent 71c795d00b
commit a1b47eb446
2 changed files with 4 additions and 13 deletions

View File

@ -220,7 +220,7 @@ public class KeyboardAccessibilityDelegate<KV extends KeyboardView>
provider.sendAccessibilityEventForKey( provider.sendAccessibilityEventForKey(
key, AccessibilityEventCompat.TYPE_VIEW_HOVER_ENTER); key, AccessibilityEventCompat.TYPE_VIEW_HOVER_ENTER);
provider.performActionForKey( provider.performActionForKey(
key, AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS, null); key, AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS);
break; break;
case MotionEvent.ACTION_HOVER_EXIT: case MotionEvent.ACTION_HOVER_EXIT:
provider.sendAccessibilityEventForKey( provider.sendAccessibilityEventForKey(

View File

@ -229,7 +229,7 @@ public final class KeyboardAccessibilityNodeProvider extends AccessibilityNodePr
if (key == null) { if (key == null) {
return false; return false;
} }
return performActionForKey(key, action, arguments); return performActionForKey(key, action);
} }
/** /**
@ -237,25 +237,16 @@ public final class KeyboardAccessibilityNodeProvider extends AccessibilityNodePr
* *
* @param key The on which to perform the action. * @param key The on which to perform the action.
* @param action The action to perform. * @param action The action to perform.
* @param arguments The action's arguments.
* @return The result of performing the action, or false if the action is not supported. * @return The result of performing the action, or false if the action is not supported.
*/ */
boolean performActionForKey(final Key key, final int action, final Bundle arguments) { boolean performActionForKey(final Key key, final int action) {
final int virtualViewId = getVirtualViewIdOf(key);
switch (action) { switch (action) {
case AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS: case AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS:
if (mAccessibilityFocusedView == virtualViewId) { mAccessibilityFocusedView = getVirtualViewIdOf(key);
return false;
}
mAccessibilityFocusedView = virtualViewId;
sendAccessibilityEventForKey( sendAccessibilityEventForKey(
key, AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED); key, AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
return true; return true;
case AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS: case AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS:
if (mAccessibilityFocusedView != virtualViewId) {
return false;
}
mAccessibilityFocusedView = UNDEFINED; mAccessibilityFocusedView = UNDEFINED;
sendAccessibilityEventForKey( sendAccessibilityEventForKey(
key, AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED); key, AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);