Skip to content

Commit afe8cf2

Browse files
committed
Removing action arguments checks.
1. The checks for action arguments are not needed since they may cause trouble for developers if we add more args to an action. bug:6414006 Change-Id: Ia4212b52be183b1ef1cfd2561ce618cef2b015e4
1 parent 427db9b commit afe8cf2

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

services/java/com/android/server/accessibility/AccessibilityManagerService.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,8 +1765,7 @@ public boolean canPerformActionLocked(Service service, int windowId, int action,
17651765
Bundle arguments) {
17661766
return canRetrieveWindowContent(service)
17671767
&& isRetrievalAllowingWindow(windowId)
1768-
&& isActionPermitted(action)
1769-
&& isActionArgumentsValid(action, arguments);
1768+
&& isActionPermitted(action);
17701769
}
17711770

17721771
public boolean canRetrieveWindowContent(Service service) {
@@ -1790,29 +1789,6 @@ private boolean isActionPermitted(int action) {
17901789
return (VALID_ACTIONS & action) != 0;
17911790
}
17921791

1793-
private boolean isActionArgumentsValid(int action, Bundle arguments) {
1794-
switch (action) {
1795-
case AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY:
1796-
case AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY: {
1797-
if (arguments.size() == 1) {
1798-
final int granularity = arguments.getInt(
1799-
AccessibilityNodeInfo.ACTION_ARGUMENT_GRANULARITY_INT);
1800-
return (granularity & VALID_GRANULARITIES) != 0
1801-
&& Integer.bitCount(granularity) == 1;
1802-
}
1803-
} break;
1804-
case AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT:
1805-
case AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT: {
1806-
if (arguments.size() == 1) {
1807-
String element = arguments.getString(
1808-
AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING);
1809-
return !TextUtils.isEmpty(element);
1810-
}
1811-
} break;
1812-
}
1813-
return false;
1814-
}
1815-
18161792
private void enforceCallingPermission(String permission, String function) {
18171793
if (OWN_PROCESS_ID == Binder.getCallingPid()) {
18181794
return;

0 commit comments

Comments
 (0)