IAccessibilityServiceConnection.aidl revision 0d04e245534cf777dfaf16dce3c51553837c14ff
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 android.view.accessibility.AccessibilityNodeInfo} by accessibility id. 34 * 35 * @param accessibilityWindowId A unique window id. Use 36 * {@link android.view.accessibility.AccessibilityNodeInfo#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 android.view.accessibility.AccessibilityNodeInfo#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 android.view.accessibility.AccessibilityNodeInfo}s by View text. 53 * The match is case insensitive containment. The search is performed in the window 54 * whose id is specified and starts from the node whose accessibility id is specified. 55 * 56 * @param accessibilityWindowId A unique window id. Use 57 * {@link android.view.accessibility.AccessibilityNodeInfo#ACTIVE_WINDOW_ID} 58 * to query the currently active window. 59 * @param accessibilityNodeId A unique view id or virtual descendant id from 60 * where to start the search. Use 61 * {@link android.view.accessibility.AccessibilityNodeInfo#ROOT_NODE_ID} 62 * to start from the root. 63 * @param text The searched text. 64 * @param interactionId The id of the interaction for matching with the callback result. 65 * @param callback Callback which to receive the result. 66 * @param threadId The id of the calling thread. 67 * @return The current window scale, where zero means a failure. 68 */ 69 float findAccessibilityNodeInfosByText(int accessibilityWindowId, long accessibilityNodeId, 70 String text, int interactionId, IAccessibilityInteractionConnectionCallback callback, 71 long threadId); 72 73 /** 74 * Finds an {@link android.view.accessibility.AccessibilityNodeInfo} by View id. The search 75 * is performed in the window whose id is specified and starts from the node whose 76 * accessibility id is specified. 77 * 78 * @param accessibilityWindowId A unique window id. Use 79 * {@link android.view.accessibility.AccessibilityNodeInfo#ACTIVE_WINDOW_ID} 80 * to query the currently active window. 81 * @param accessibilityNodeId A unique view id or virtual descendant id from 82 * where to start the search. Use 83 * {@link android.view.accessibility.AccessibilityNodeInfo#ROOT_NODE_ID} 84 * to start from the root. 85 * @param id The id of the node. 86 * @param interactionId The id of the interaction for matching with the callback result. 87 * @param callback Callback which to receive the result. 88 * @param threadId The id of the calling thread. 89 * @return The current window scale, where zero means a failure. 90 */ 91 float findAccessibilityNodeInfoByViewId(int accessibilityWindowId, long accessibilityNodeId, 92 int viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback, 93 long threadId); 94 95 /** 96 * Performs an accessibility action on an 97 * {@link android.view.accessibility.AccessibilityNodeInfo}. 98 * 99 * @param accessibilityWindowId A unique window id. Use 100 * {@link android.view.accessibility.AccessibilityNodeInfo#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 android.view.accessibility.AccessibilityNodeInfo#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