OSDN Git Service

Consider addAction(int action) to possibly be a bit mask
authorKristian Monsen <kristianm@google.com>
Tue, 20 May 2014 20:16:19 +0000 (13:16 -0700)
committerKristian Monsen <kristianm@google.com>
Tue, 20 May 2014 23:44:14 +0000 (16:44 -0700)
bug=15092606

Change-Id: I885808b3f4d2337129d1660300be8e926f8a8425

core/java/android/view/accessibility/AccessibilityNodeInfo.java

index 34967df..d5f0834 100644 (file)
@@ -995,13 +995,12 @@ public class AccessibilityNodeInfo implements Parcelable {
     public void addAction(int action) {
         enforceNotSealed();
 
-        AccessibilityAction newAction = getActionSingleton(action);
-        if (newAction == null) {
-            // This means it is not one of the standard actions
-            throw new IllegalArgumentException("Argument is not one of the standard actions");
+        if ((action & ACTION_TYPE_MASK) != 0) {
+            throw new IllegalArgumentException("Action is not a combination of the standard " +
+                    "actions: " + action);
         }
 
-        addAction(newAction);
+        addLegacyStandardActions(action);
     }
 
     /**