diff options
author | Svetoslav <svetoslavganov@google.com> | 2014-05-21 14:53:16 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2014-05-21 14:53:25 -0700 |
commit | 5c4cd189f298b3ddb9a5e8afc5f68546a9f96726 (patch) | |
tree | 7fe9ec74297c2a842a08a51964683a03b54e1c67 /services/accessibility | |
parent | 1c7c2a0dfa4c3f42243a2ef7bbdab43c60230d2f (diff) | |
download | frameworks_base-5c4cd189f298b3ddb9a5e8afc5f68546a9f96726.zip frameworks_base-5c4cd189f298b3ddb9a5e8afc5f68546a9f96726.tar.gz frameworks_base-5c4cd189f298b3ddb9a5e8afc5f68546a9f96726.tar.bz2 |
Fixing bugs due to the new custom accessibility action APIs.
1. AccessibiltiyAction was incorectly throwing an exception when
a custom action was constructed.
2. AccessibilityManagerService should no longer enforce only standard
actions as we allow custom ones too.
bug:15110963
Change-Id: Iea57e0a6449b87bd8d103c55ca255e80705f2565
Diffstat (limited to 'services/accessibility')
-rw-r--r-- | services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java | 39 |
1 files changed, 2 insertions, 37 deletions
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; |