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.accessibilityservice.MagnificationConfig; 21 import android.content.pm.ParceledListSlice; 22 import android.graphics.Bitmap; 23 import android.graphics.Region; 24 import android.os.Bundle; 25 import android.os.RemoteCallback; 26 import android.view.MagnificationSpec; 27 import android.view.SurfaceControl; 28 import android.view.MotionEvent; 29 import android.view.SurfaceControl; 30 import android.view.accessibility.AccessibilityNodeInfo; 31 import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; 32 import android.view.accessibility.IAccessibilityInteractionConnectionCallback; 33 import android.view.accessibility.AccessibilityWindowInfo; 34 import java.util.List; 35 import android.window.ScreenCapture; 36 37 /** 38 * Interface given to an AccessibilitySerivce to talk to the AccessibilityManagerService. 39 * 40 * @hide 41 */ 42 interface IAccessibilityServiceConnection { 43 setServiceInfo(in AccessibilityServiceInfo info)44 void setServiceInfo(in AccessibilityServiceInfo info); 45 setAttributionTag(in String attributionTag)46 void setAttributionTag(in String attributionTag); 47 findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId, long accessibilityNodeId, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, long threadId, in Bundle arguments)48 String[] findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId, 49 long accessibilityNodeId, int interactionId, 50 IAccessibilityInteractionConnectionCallback callback, int flags, long threadId, 51 in Bundle arguments); 52 findAccessibilityNodeInfosByText(int accessibilityWindowId, long accessibilityNodeId, String text, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)53 String[] findAccessibilityNodeInfosByText(int accessibilityWindowId, long accessibilityNodeId, 54 String text, int interactionId, IAccessibilityInteractionConnectionCallback callback, 55 long threadId); 56 findAccessibilityNodeInfosByViewId(int accessibilityWindowId, long accessibilityNodeId, String viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)57 String[] findAccessibilityNodeInfosByViewId(int accessibilityWindowId, 58 long accessibilityNodeId, String viewId, int interactionId, 59 IAccessibilityInteractionConnectionCallback callback, long threadId); 60 findFocus(int accessibilityWindowId, long accessibilityNodeId, int focusType, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)61 String[] findFocus(int accessibilityWindowId, long accessibilityNodeId, int focusType, 62 int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId); 63 focusSearch(int accessibilityWindowId, long accessibilityNodeId, int direction, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)64 String[] focusSearch(int accessibilityWindowId, long accessibilityNodeId, int direction, 65 int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId); 66 performAccessibilityAction(int accessibilityWindowId, long accessibilityNodeId, int action, in Bundle arguments, int interactionId, IAccessibilityInteractionConnectionCallback callback, long threadId)67 boolean performAccessibilityAction(int accessibilityWindowId, long accessibilityNodeId, 68 int action, in Bundle arguments, int interactionId, 69 IAccessibilityInteractionConnectionCallback callback, long threadId); 70 getWindow(int windowId)71 AccessibilityWindowInfo getWindow(int windowId); 72 getWindows()73 AccessibilityWindowInfo.WindowListSparseArray getWindows(); 74 getServiceInfo()75 AccessibilityServiceInfo getServiceInfo(); 76 performGlobalAction(int action)77 boolean performGlobalAction(int action); getSystemActions()78 List<AccessibilityNodeInfo.AccessibilityAction> getSystemActions(); 79 disableSelf()80 void disableSelf(); 81 setOnKeyEventResult(boolean handled, int sequence)82 oneway void setOnKeyEventResult(boolean handled, int sequence); 83 getMagnificationConfig(int displayId)84 MagnificationConfig getMagnificationConfig(int displayId); 85 getMagnificationScale(int displayId)86 float getMagnificationScale(int displayId); 87 getMagnificationCenterX(int displayId)88 float getMagnificationCenterX(int displayId); 89 getMagnificationCenterY(int displayId)90 float getMagnificationCenterY(int displayId); 91 getMagnificationRegion(int displayId)92 Region getMagnificationRegion(int displayId); 93 getCurrentMagnificationRegion(int displayId)94 Region getCurrentMagnificationRegion(int displayId); 95 resetMagnification(int displayId, boolean animate)96 boolean resetMagnification(int displayId, boolean animate); 97 resetCurrentMagnification(int displayId, boolean animate)98 boolean resetCurrentMagnification(int displayId, boolean animate); 99 setMagnificationConfig(int displayId, in MagnificationConfig config, boolean animate)100 boolean setMagnificationConfig(int displayId, in MagnificationConfig config, boolean animate); 101 setMagnificationCallbackEnabled(int displayId, boolean enabled)102 void setMagnificationCallbackEnabled(int displayId, boolean enabled); 103 setSoftKeyboardShowMode(int showMode)104 boolean setSoftKeyboardShowMode(int showMode); 105 getSoftKeyboardShowMode()106 int getSoftKeyboardShowMode(); 107 setSoftKeyboardCallbackEnabled(boolean enabled)108 void setSoftKeyboardCallbackEnabled(boolean enabled); 109 switchToInputMethod(String imeId)110 boolean switchToInputMethod(String imeId); 111 setInputMethodEnabled(String imeId, boolean enabled)112 int setInputMethodEnabled(String imeId, boolean enabled); 113 isAccessibilityButtonAvailable()114 boolean isAccessibilityButtonAvailable(); 115 sendGesture(int sequence, in ParceledListSlice gestureSteps)116 void sendGesture(int sequence, in ParceledListSlice gestureSteps); 117 dispatchGesture(int sequence, in ParceledListSlice gestureSteps, int displayId)118 void dispatchGesture(int sequence, in ParceledListSlice gestureSteps, int displayId); 119 isFingerprintGestureDetectionAvailable()120 boolean isFingerprintGestureDetectionAvailable(); 121 getOverlayWindowToken(int displayid)122 IBinder getOverlayWindowToken(int displayid); 123 getWindowIdForLeashToken(IBinder token)124 int getWindowIdForLeashToken(IBinder token); 125 takeScreenshot(int displayId, in RemoteCallback callback)126 void takeScreenshot(int displayId, in RemoteCallback callback); 127 takeScreenshotOfWindow(int accessibilityWindowId, int interactionId, in ScreenCapture.ScreenCaptureListener listener, IAccessibilityInteractionConnectionCallback callback)128 void takeScreenshotOfWindow(int accessibilityWindowId, int interactionId, 129 in ScreenCapture.ScreenCaptureListener listener, 130 IAccessibilityInteractionConnectionCallback callback); 131 setGestureDetectionPassthroughRegion(int displayId, in Region region)132 void setGestureDetectionPassthroughRegion(int displayId, in Region region); 133 setTouchExplorationPassthroughRegion(int displayId, in Region region)134 void setTouchExplorationPassthroughRegion(int displayId, in Region region); 135 setFocusAppearance(int strokeWidth, int color)136 void setFocusAppearance(int strokeWidth, int color); 137 setCacheEnabled(boolean enabled)138 void setCacheEnabled(boolean enabled); 139 logTrace(long timestamp, String where, long loggingTypes, String callingParams, int processId, long threadId, int callingUid, in Bundle serializedCallingStackInBundle)140 oneway void logTrace(long timestamp, String where, long loggingTypes, String callingParams, 141 int processId, long threadId, int callingUid, in Bundle serializedCallingStackInBundle); 142 setServiceDetectsGesturesEnabled(int displayId, boolean mode)143 void setServiceDetectsGesturesEnabled(int displayId, boolean mode); 144 requestTouchExploration(int displayId)145 void requestTouchExploration(int displayId); 146 requestDragging(int displayId, int pointerId)147 void requestDragging(int displayId, int pointerId); 148 requestDelegating(int displayId)149 void requestDelegating(int displayId); 150 onDoubleTap(int displayId)151 void onDoubleTap(int displayId); 152 onDoubleTapAndHold(int displayId)153 void onDoubleTapAndHold(int displayId); 154 setAnimationScale(float scale)155 void setAnimationScale(float scale); 156 setInstalledAndEnabledServices(in List<AccessibilityServiceInfo> infos)157 void setInstalledAndEnabledServices(in List<AccessibilityServiceInfo> infos); 158 getInstalledAndEnabledServices()159 List<AccessibilityServiceInfo> getInstalledAndEnabledServices(); attachAccessibilityOverlayToDisplay(int displayId, in SurfaceControl sc)160 void attachAccessibilityOverlayToDisplay(int displayId, in SurfaceControl sc); 161 attachAccessibilityOverlayToWindow(int accessibilityWindowId, in SurfaceControl sc)162 void attachAccessibilityOverlayToWindow(int accessibilityWindowId, in SurfaceControl sc); 163 }