IAccessibilityServiceConnection.aidl revision 57c7fd5a43237afc5e8ef31a076e862c0c16c328
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     * @param prefetchFlags flags to guide prefetching.
46     * @return The current window scale, where zero means a failure.
47     */
48    float findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId,
49        long accessibilityNodeId, int interactionId,
50        IAccessibilityInteractionConnectionCallback callback, long threadId, int prefetchFlags);
51
52    /**
53     * Finds {@link android.view.accessibility.AccessibilityNodeInfo}s by View text.
54     * The match is case insensitive containment. The search is performed in the window
55     * whose id is specified and starts from the node whose accessibility id is specified.
56     *
57     * @param accessibilityWindowId A unique window id. Use
58     *     {@link android.view.accessibility.AccessibilityNodeInfo#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 android.view.accessibility.AccessibilityNodeInfo#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 android.view.accessibility.AccessibilityNodeInfo} by View id. The search
76     * is performed in the window whose id is specified and starts from the node whose
77     * accessibility id is specified.
78     *
79     * @param accessibilityWindowId A unique window id. Use
80     *     {@link android.view.accessibility.AccessibilityNodeInfo#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 android.view.accessibility.AccessibilityNodeInfo#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
98     * {@link android.view.accessibility.AccessibilityNodeInfo}.
99     *
100     * @param accessibilityWindowId A unique window id. Use
101     *     {@link android.view.accessibility.AccessibilityNodeInfo#ACTIVE_WINDOW_ID}
102     *     to query the currently active window.
103     * @param accessibilityNodeId A unique view id or virtual descendant id from
104     *     where to start the search. Use
105     *     {@link android.view.accessibility.AccessibilityNodeInfo#ROOT_NODE_ID}
106     *     to start from the root.
107     * @param action The action to perform.
108     * @param interactionId The id of the interaction for matching with the callback result.
109     * @param callback Callback which to receive the result.
110     * @param threadId The id of the calling thread.
111     * @return Whether the action was performed.
112     */
113    boolean performAccessibilityAction(int accessibilityWindowId, long accessibilityNodeId,
114        int action, int interactionId, IAccessibilityInteractionConnectionCallback callback,
115        long threadId);
116}
117