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.content.pm.ParceledListSlice;
21 import android.graphics.Region;
22 import android.os.Bundle;
23 import android.view.MagnificationSpec;
24 import android.view.MotionEvent;
25 import android.view.accessibility.AccessibilityNodeInfo;
26 import android.view.accessibility.IAccessibilityInteractionConnectionCallback;
27 import android.view.accessibility.AccessibilityWindowInfo;
28 
29 /**
30  * Interface given to an AccessibilitySerivce to talk to the AccessibilityManagerService.
31  *
32  * @hide
33  */
34 interface IAccessibilityServiceConnection {
35 
setServiceInfo(in AccessibilityServiceInfo info)36     void setServiceInfo(in AccessibilityServiceInfo info);
37 
findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId, long accessibilityNodeId, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, long threadId, in Bundle arguments)38     String[] findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId,
39         long accessibilityNodeId, int interactionId,
40         IAccessibilityInteractionConnectionCallback callback, int flags, long threadId,
41         in Bundle arguments);
42 
findAccessibilityNodeInfosByText(int accessibilityWindowId, long accessibilityNodeId, String text, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)43     String[] findAccessibilityNodeInfosByText(int accessibilityWindowId, long accessibilityNodeId,
44         String text, int interactionId, IAccessibilityInteractionConnectionCallback callback,
45         long threadId);
46 
findAccessibilityNodeInfosByViewId(int accessibilityWindowId, long accessibilityNodeId, String viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)47     String[] findAccessibilityNodeInfosByViewId(int accessibilityWindowId,
48         long accessibilityNodeId, String viewId, int interactionId,
49         IAccessibilityInteractionConnectionCallback callback, long threadId);
50 
findFocus(int accessibilityWindowId, long accessibilityNodeId, int focusType, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)51     String[] findFocus(int accessibilityWindowId, long accessibilityNodeId, int focusType,
52         int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId);
53 
focusSearch(int accessibilityWindowId, long accessibilityNodeId, int direction, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)54     String[] focusSearch(int accessibilityWindowId, long accessibilityNodeId, int direction,
55         int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId);
56 
performAccessibilityAction(int accessibilityWindowId, long accessibilityNodeId, int action, in Bundle arguments, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)57     boolean performAccessibilityAction(int accessibilityWindowId, long accessibilityNodeId,
58         int action, in Bundle arguments, int interactionId,
59         IAccessibilityInteractionConnectionCallback callback, long threadId);
60 
getWindow(int windowId)61     AccessibilityWindowInfo getWindow(int windowId);
62 
getWindows()63     List<AccessibilityWindowInfo> getWindows();
64 
getServiceInfo()65     AccessibilityServiceInfo getServiceInfo();
66 
performGlobalAction(int action)67     boolean performGlobalAction(int action);
68 
disableSelf()69     void disableSelf();
70 
setOnKeyEventResult(boolean handled, int sequence)71     oneway void setOnKeyEventResult(boolean handled, int sequence);
72 
getMagnificationScale(int displayId)73     float getMagnificationScale(int displayId);
74 
getMagnificationCenterX(int displayId)75     float getMagnificationCenterX(int displayId);
76 
getMagnificationCenterY(int displayId)77     float getMagnificationCenterY(int displayId);
78 
getMagnificationRegion(int displayId)79     Region getMagnificationRegion(int displayId);
80 
resetMagnification(int displayId, boolean animate)81     boolean resetMagnification(int displayId, boolean animate);
82 
setMagnificationScaleAndCenter(int displayId, float scale, float centerX, float centerY, boolean animate)83     boolean setMagnificationScaleAndCenter(int displayId, float scale, float centerX, float centerY,
84         boolean animate);
85 
setMagnificationCallbackEnabled(int displayId, boolean enabled)86     void setMagnificationCallbackEnabled(int displayId, boolean enabled);
87 
setSoftKeyboardShowMode(int showMode)88     boolean setSoftKeyboardShowMode(int showMode);
89 
getSoftKeyboardShowMode()90     int getSoftKeyboardShowMode();
91 
setSoftKeyboardCallbackEnabled(boolean enabled)92     void setSoftKeyboardCallbackEnabled(boolean enabled);
93 
isAccessibilityButtonAvailable()94     boolean isAccessibilityButtonAvailable();
95 
sendGesture(int sequence, in ParceledListSlice gestureSteps)96     void sendGesture(int sequence, in ParceledListSlice gestureSteps);
97 
isFingerprintGestureDetectionAvailable()98     boolean isFingerprintGestureDetectionAvailable();
99 }
100