IAccessibilityServiceConnection.aidl revision 79311c4af8b54d3cd47ab37a120c648bfc990511
1/* 2 * Copyright (C) 2009 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.accessibilityservice; 18 19import android.accessibilityservice.AccessibilityServiceInfo; 20import android.view.accessibility.AccessibilityNodeInfo; 21import android.view.accessibility.IAccessibilityInteractionConnectionCallback; 22 23/** 24 * Interface given to an AccessibilitySerivce to talk to the AccessibilityManagerService. 25 * 26 * @hide 27 */ 28interface IAccessibilityServiceConnection { 29 30 void setServiceInfo(in AccessibilityServiceInfo info); 31 32 /** 33 * Finds an {@link AccessibilityNodeInfo} by accessibility id. 34 * 35 * @param accessibilityWindowId A unique window id. Use 36 * {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID} 37 * to query the currently active window. 38 * @param accessibilityNodeId A unique view id or virtual descendant id from 39 * where to start the search. Use 40 * {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID} 41 * to start from the root. 42 * @param interactionId The id of the interaction for matching with the callback result. 43 * @param callback Callback which to receive the result. 44 * @param threadId The id of the calling thread. 45 * @return The current window scale, where zero means a failure. 46 */ 47 float findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId, 48 long accessibilityNodeId, int interactionId, 49 IAccessibilityInteractionConnectionCallback callback, long threadId); 50 51 /** 52 * Finds {@link AccessibilityNodeInfo}s by View text. The match is case 53 * insensitive containment. The search is performed in the window whose 54 * id is specified and starts from the node whose accessibility id is 55 * specified. 56 * 57 * @param accessibilityWindowId A unique window id. Use 58 * {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID} 59 * to query the currently active window. 60 * @param accessibilityNodeId A unique view id or virtual descendant id from 61 * where to start the search. Use 62 * {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID} 63 * to start from the root. 64 * @param text The searched text. 65 * @param interactionId The id of the interaction for matching with the callback result. 66 * @param callback Callback which to receive the result. 67 * @param threadId The id of the calling thread. 68 * @return The current window scale, where zero means a failure. 69 */ 70 float findAccessibilityNodeInfosByText(int accessibilityWindowId, long accessibilityNodeId, 71 String text, int interactionId, IAccessibilityInteractionConnectionCallback callback, 72 long threadId); 73 74 /** 75 * Finds an {@link AccessibilityNodeInfo} by View id. The search is performed in 76 * the window whose id is specified and starts from the node whose accessibility 77 * id is specified. 78 * 79 * @param accessibilityWindowId A unique window id. Use 80 * {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID} 81 * to query the currently active window. 82 * @param accessibilityNodeId A unique view id or virtual descendant id from 83 * where to start the search. Use 84 * {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID} 85 * to start from the root. 86 * @param id The id of the node. 87 * @param interactionId The id of the interaction for matching with the callback result. 88 * @param callback Callback which to receive the result. 89 * @param threadId The id of the calling thread. 90 * @return The current window scale, where zero means a failure. 91 */ 92 float findAccessibilityNodeInfoByViewId(int accessibilityWindowId, long accessibilityNodeId, 93 int viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback, 94 long threadId); 95 96 /** 97 * Performs an accessibility action on an {@link AccessibilityNodeInfo}. 98 * 99 * @param accessibilityWindowId A unique window id. Use 100 * {@link com.android.server.accessibility.AccessibilityManagerService#ACTIVE_WINDOW_ID} 101 * to query the currently active window. 102 * @param accessibilityNodeId A unique view id or virtual descendant id from 103 * where to start the search. Use 104 * {@link com.android.server.accessibility.AccessibilityManagerService#ROOT_NODE_ID} 105 * to start from the root. 106 * @param action The action to perform. 107 * @param interactionId The id of the interaction for matching with the callback result. 108 * @param callback Callback which to receive the result. 109 * @param threadId The id of the calling thread. 110 * @return Whether the action was performed. 111 */ 112 boolean performAccessibilityAction(int accessibilityWindowId, long accessibilityNodeId, 113 int action, int interactionId, IAccessibilityInteractionConnectionCallback callback, 114 long threadId); 115} 116