IAccessibilityServiceConnection.aidl revision 8643aa0179e598e78d938c59035389054535a229
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; 21 22/** 23 * Interface given to an AccessibilitySerivce to talk to the AccessibilityManagerService. 24 * 25 * @hide 26 */ 27interface IAccessibilityServiceConnection { 28 29 void setServiceInfo(in AccessibilityServiceInfo info); 30 31 /** 32 * Finds an {@link AccessibilityNodeInfo} by accessibility id. 33 * <p> 34 * <strong> 35 * It is a client responsibility to recycle the received info by 36 * calling {@link AccessibilityNodeInfo#recycle()} to avoid creating 37 * of multiple instances. 38 * </strong> 39 * </p> 40 * 41 * @param accessibilityWindowId A unique window id. 42 * @param accessibilityViewId A unique View accessibility id. 43 * @return The node info. 44 */ 45 AccessibilityNodeInfo findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId, 46 int accessibilityViewId); 47 48 /** 49 * Finds {@link AccessibilityNodeInfo}s by View text. The match is case 50 * insensitive containment. 51 * <p> 52 * <strong> 53 * It is a client responsibility to recycle the received infos by 54 * calling {@link AccessibilityNodeInfo#recycle()} to avoid creating 55 * of multiple instances. 56 * </strong> 57 * </p> 58 * 59 * @param text The searched text. 60 * @return A list of node info. 61 */ 62 List<AccessibilityNodeInfo> findAccessibilityNodeInfosByViewText(String text); 63 64 /** 65 * Finds an {@link AccessibilityNodeInfo} by View id. 66 * <p> 67 * <strong> 68 * It is a client responsibility to recycle the received info by 69 * calling {@link AccessibilityNodeInfo#recycle()} to avoid creating 70 * of multiple instances. 71 * </strong> 72 * </p> 73 * 74 * @param id The id of the node. 75 * @return The node info. 76 */ 77 AccessibilityNodeInfo findAccessibilityNodeInfoByViewId(int viewId); 78 79 /** 80 * Performs an accessibility action on an {@link AccessibilityNodeInfo}. 81 * 82 * @param accessibilityWindowId The id of the window. 83 * @param accessibilityViewId The of a view in the . 84 * @return Whether the action was performed. 85 */ 86 boolean performAccessibilityAction(int accessibilityWindowId, int accessibilityViewId, 87 int action); 88} 89