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