am 8e01ee57: Merge "Removing action arguments checks." into jb-dev

* commit '8e01ee57c331913d51ef9336e304dca73edb9571':
  Removing action arguments checks.
This commit is contained in:
Svetoslav Ganov
2012-04-30 13:32:07 -07:00
committed by Android Git Automerger

View File

@@ -1765,8 +1765,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
Bundle arguments) {
return canRetrieveWindowContent(service)
&& isRetrievalAllowingWindow(windowId)
&& isActionPermitted(action)
&& isActionArgumentsValid(action, arguments);
&& isActionPermitted(action);
}
public boolean canRetrieveWindowContent(Service service) {
@@ -1790,29 +1789,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
return (VALID_ACTIONS & action) != 0;
}
private boolean isActionArgumentsValid(int action, Bundle arguments) {
switch (action) {
case AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY:
case AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY: {
if (arguments.size() == 1) {
final int granularity = arguments.getInt(
AccessibilityNodeInfo.ACTION_ARGUMENT_GRANULARITY_INT);
return (granularity & VALID_GRANULARITIES) != 0
&& Integer.bitCount(granularity) == 1;
}
} break;
case AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT:
case AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT: {
if (arguments.size() == 1) {
String element = arguments.getString(
AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING);
return !TextUtils.isEmpty(element);
}
} break;
}
return false;
}
private void enforceCallingPermission(String permission, String function) {
if (OWN_PROCESS_ID == Binder.getCallingPid()) {
return;