IAccessibilityServiceConnection.aidl revision eeee4d2c01d3c4ed99e4891dbc75c7de69a803fa
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. The search is performed in the window whose
51     * id is specified and starts from the View whose accessibility id is
52     * specified.
53     * <p>
54     *   <strong>
55     *     It is a client responsibility to recycle the received infos by
56     *     calling {@link AccessibilityNodeInfo#recycle()} to avoid creating
57     *     of multiple instances.
58     *   </strong>
59     * </p>
60     *
61     * @param text The searched text.
62     * @param accessibilityId The id of the view from which to start searching.
63     *        Use {@link android.view.View#NO_ID} to start from the root.
64     * @return A list of node info.
65     */
66    List<AccessibilityNodeInfo> findAccessibilityNodeInfosByViewText(String text,
67        int accessibilityWindowId, int accessibilityViewId);
68
69    /**
70     * Finds {@link AccessibilityNodeInfo}s by View text. The match is case
71     * insensitive containment. The search is performed in the currently
72     * active window and start from the root View in the window.
73     * <p>
74     *   <strong>
75     *     It is a client responsibility to recycle the received infos by
76     *     calling {@link AccessibilityNodeInfo#recycle()} to avoid creating
77     *     of multiple instances.
78     *   </strong>
79     * </p>
80     *
81     * @param text The searched text.
82     * @param accessibilityId The id of the view from which to start searching.
83     *        Use {@link android.view.View#NO_ID} to start from the root.
84     * @return A list of node info.
85     */
86    List<AccessibilityNodeInfo> findAccessibilityNodeInfosByViewTextInActiveWindow(String text);
87
88    /**
89     * Finds an {@link AccessibilityNodeInfo} by View id. The search is performed
90     * in the currently active window and start from the root View in the window.
91     * <p>
92     *   <strong>
93     *     It is a client responsibility to recycle the received info by
94     *     calling {@link AccessibilityNodeInfo#recycle()} to avoid creating
95     *     of multiple instances.
96     *   </strong>
97     * </p>
98     *
99     * @param id The id of the node.
100     * @return The node info.
101     */
102    AccessibilityNodeInfo findAccessibilityNodeInfoByViewIdInActiveWindow(int viewId);
103
104    /**
105     * Performs an accessibility action on an {@link AccessibilityNodeInfo}.
106     *
107     * @param accessibilityWindowId The id of the window.
108     * @param accessibilityViewId The of a view in the .
109     * @return Whether the action was performed.
110     */
111    boolean performAccessibilityAction(int accessibilityWindowId, int accessibilityViewId,
112        int action);
113}
114