diff options
-rw-r--r-- | core/java/android/view/accessibility/AccessibilityNodeInfo.java | 11 | ||||
-rw-r--r-- | services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java | 39 |
2 files changed, 3 insertions, 47 deletions
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java index d5f0834..66cc3f6 100644 --- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java +++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java @@ -318,11 +318,6 @@ public class AccessibilityNodeInfo implements Parcelable { */ private static final int ACTION_TYPE_MASK = 0xFF000000; - /** - * Mask to define standard not legacy actions. - */ - private static final int STANDARD_NON_LEGACY_ACTION_MASK = 0x01000000; - // Action arguments /** @@ -3262,14 +3257,10 @@ public class AccessibilityNodeInfo implements Parcelable { * @param label The label for the new AccessibilityAction. */ public AccessibilityAction(int actionId, @Nullable CharSequence label) { - if ((actionId & ACTION_TYPE_MASK) == 0 && Integer.bitCount(actionId) > 1) { + if ((actionId & ACTION_TYPE_MASK) == 0 && Integer.bitCount(actionId) != 1) { throw new IllegalArgumentException("Invalid standard action id"); } - if ((actionId & STANDARD_NON_LEGACY_ACTION_MASK) != 0) { - throw new IllegalArgumentException("action id not a resource id"); - } - mActionId = actionId; mLabel = label; } diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index 36b5cfb..eca1bc1 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -2376,8 +2376,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return false; } resolvedWindowId = resolveAccessibilityWindowIdLocked(accessibilityWindowId); - final boolean permissionGranted = mSecurityPolicy.canPerformActionLocked(this, - resolvedWindowId, action, arguments); + final boolean permissionGranted = mSecurityPolicy.canGetAccessibilityNodeInfoLocked( + this, resolvedWindowId); if (!permissionGranted) { return false; } else { @@ -3177,30 +3177,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { final class SecurityPolicy { public static final int INVALID_WINDOW_ID = -1; - private static final int VALID_ACTIONS = - AccessibilityNodeInfo.ACTION_CLICK - | AccessibilityNodeInfo.ACTION_LONG_CLICK - | AccessibilityNodeInfo.ACTION_FOCUS - | AccessibilityNodeInfo.ACTION_CLEAR_FOCUS - | AccessibilityNodeInfo.ACTION_SELECT - | AccessibilityNodeInfo.ACTION_CLEAR_SELECTION - | AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS - | AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS - | AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY - | AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY - | AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT - | AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT - | AccessibilityNodeInfo.ACTION_SCROLL_FORWARD - | AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD - | AccessibilityNodeInfo.ACTION_COPY - | AccessibilityNodeInfo.ACTION_PASTE - | AccessibilityNodeInfo.ACTION_CUT - | AccessibilityNodeInfo.ACTION_SET_SELECTION - | AccessibilityNodeInfo.ACTION_EXPAND - | AccessibilityNodeInfo.ACTION_COLLAPSE - | AccessibilityNodeInfo.ACTION_DISMISS - | AccessibilityNodeInfo.ACTION_SET_TEXT; - private static final int RETRIEVAL_ALLOWING_EVENT_TYPES = AccessibilityEvent.TYPE_VIEW_CLICKED | AccessibilityEvent.TYPE_VIEW_FOCUSED @@ -3452,13 +3428,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return canRetrieveWindowContentLocked(service) && isRetrievalAllowingWindow(windowId); } - public boolean canPerformActionLocked(Service service, int windowId, int action, - Bundle arguments) { - return canRetrieveWindowContentLocked(service) - && isRetrievalAllowingWindow(windowId) - && isActionPermitted(action); - } - public boolean canRetrieveWindowsLocked(Service service) { return canRetrieveWindowContentLocked(service) && service.mRetrieveInteractiveWindows; } @@ -3538,10 +3507,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return null; } - private boolean isActionPermitted(int action) { - return (VALID_ACTIONS & action) != 0; - } - private void enforceCallingPermission(String permission, String function) { if (OWN_PROCESS_ID == Binder.getCallingPid()) { return; |