Skip to content

Commit 96985fc

Browse files
committed
Return true on successful accessiblity action click/long click.
1. If a view is clickable or long clickable perfroming the corresponding accessiblity action should return true no matter whether there is a registered on click/long click listener. Currently true is returned only if there is a listener but it is also possible that a sub-class overrides performClick and does work there. For example CompoundButton. Now if the view is clickable or long clickable we will call the perfrom* method and return true, which is we clicked. 2. Fixed some JavaDoc indentation. bug:7318777 Change-Id: Id603fee378b8f7d07f1128b5641ede57640bab53
1 parent 3b9e7f3 commit 96985fc

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

core/java/android/view/View.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6858,12 +6858,12 @@ public void resetAccessibilityStateChanged() {
68586858
/**
68596859
* Performs the specified accessibility action on the view. For
68606860
* possible accessibility actions look at {@link AccessibilityNodeInfo}.
6861-
* <p>
6862-
* If an {@link AccessibilityDelegate} has been specified via calling
6863-
* {@link #setAccessibilityDelegate(AccessibilityDelegate)} its
6864-
* {@link AccessibilityDelegate#performAccessibilityAction(View, int, Bundle)}
6865-
* is responsible for handling this call.
6866-
* </p>
6861+
* <p>
6862+
* If an {@link AccessibilityDelegate} has been specified via calling
6863+
* {@link #setAccessibilityDelegate(AccessibilityDelegate)} its
6864+
* {@link AccessibilityDelegate#performAccessibilityAction(View, int, Bundle)}
6865+
* is responsible for handling this call.
6866+
* </p>
68676867
*
68686868
* @param action The action to perform.
68696869
* @param arguments Optional action arguments.
@@ -6886,12 +6886,14 @@ boolean performAccessibilityActionInternal(int action, Bundle arguments) {
68866886
switch (action) {
68876887
case AccessibilityNodeInfo.ACTION_CLICK: {
68886888
if (isClickable()) {
6889-
return performClick();
6889+
performClick();
6890+
return true;
68906891
}
68916892
} break;
68926893
case AccessibilityNodeInfo.ACTION_LONG_CLICK: {
68936894
if (isLongClickable()) {
6894-
return performLongClick();
6895+
performLongClick();
6896+
return true;
68956897
}
68966898
} break;
68976899
case AccessibilityNodeInfo.ACTION_FOCUS: {

0 commit comments

Comments
 (0)