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 17 package android.accessibilityservice; 18 19 import android.accessibilityservice.AccessibilityServiceInfo; 20 import android.view.accessibility.AccessibilityNodeInfo; 21 import android.view.accessibility.IAccessibilityInteractionConnectionCallback; 22 23 /** 24 * Interface given to an AccessibilitySerivce to talk to the AccessibilityManagerService. 25 * 26 * @hide 27 */ 28 interface IAccessibilityServiceConnection { 29 setServiceInfo(in AccessibilityServiceInfo info)30 void setServiceInfo(in AccessibilityServiceInfo info); 31 32 /** 33 * Finds an {@link AccessibilityNodeInfo} by accessibility id. 34 * 35 * @param accessibilityWindowId A unique window id. 36 * @param accessibilityViewId A unique View accessibility id. 37 * @param interactionId The id of the interaction for matching with the callback result. 38 * @param callback Callback which to receive the result. 39 * @param threadId The id of the calling thread. 40 * @return The current window scale, where zero means a failure. 41 */ findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId, int accessibilityViewId, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)42 float findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId, 43 int accessibilityViewId, int interactionId, 44 IAccessibilityInteractionConnectionCallback callback, long threadId); 45 46 /** 47 * Finds {@link AccessibilityNodeInfo}s by View text. The match is case 48 * insensitive containment. The search is performed in the window whose 49 * id is specified and starts from the View whose accessibility id is 50 * specified. 51 * 52 * @param text The searched text. 53 * @param accessibilityWindowId A unique window id. 54 * @param accessibilityViewId A unique View accessibility id from where to start the search. 55 * Use {@link android.view.View#NO_ID} to start from the root. 56 * @param interactionId The id of the interaction for matching with the callback result. 57 * @param callback Callback which to receive the result. 58 * @param threadId The id of the calling thread. 59 * @return The current window scale, where zero means a failure. 60 */ findAccessibilityNodeInfosByViewText(String text, int accessibilityWindowId, int accessibilityViewId, int interractionId, IAccessibilityInteractionConnectionCallback callback, long threadId)61 float findAccessibilityNodeInfosByViewText(String text, int accessibilityWindowId, 62 int accessibilityViewId, int interractionId, 63 IAccessibilityInteractionConnectionCallback callback, long threadId); 64 65 /** 66 * Finds {@link AccessibilityNodeInfo}s by View text. The match is case 67 * insensitive containment. The search is performed in the currently 68 * active window and start from the root View in the window. 69 * 70 * @param text The searched text. 71 * @param accessibilityId The id of the view from which to start searching. 72 * Use {@link android.view.View#NO_ID} to start from the root. 73 * @param interactionId The id of the interaction for matching with the callback result. 74 * @param callback Callback which to receive the result. 75 * @param threadId The id of the calling thread. 76 * @return The current window scale, where zero means a failure. 77 */ findAccessibilityNodeInfosByViewTextInActiveWindow(String text, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)78 float findAccessibilityNodeInfosByViewTextInActiveWindow(String text, 79 int interactionId, IAccessibilityInteractionConnectionCallback callback, 80 long threadId); 81 82 /** 83 * Finds an {@link AccessibilityNodeInfo} by View id. The search is performed 84 * in the currently active window and starts from the root View in the window. 85 * 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 */ findAccessibilityNodeInfoByViewIdInActiveWindow(int viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)92 float findAccessibilityNodeInfoByViewIdInActiveWindow(int viewId, int interactionId, 93 IAccessibilityInteractionConnectionCallback callback, long threadId); 94 95 /** 96 * Performs an accessibility action on an {@link AccessibilityNodeInfo}. 97 * 98 * @param accessibilityWindowId The id of the window. 99 * @param accessibilityViewId A unique View accessibility id. 100 * @param action The action to perform. 101 * @param interactionId The id of the interaction for matching with the callback result. 102 * @param callback Callback which to receive the result. 103 * @param threadId The id of the calling thread. 104 * @return Whether the action was performed. 105 */ performAccessibilityAction(int accessibilityWindowId, int accessibilityViewId, int action, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)106 boolean performAccessibilityAction(int accessibilityWindowId, int accessibilityViewId, 107 int action, int interactionId, IAccessibilityInteractionConnectionCallback callback, 108 long threadId); 109 } 110