Class ShadowAccessibilityService


  • @Implements(android.accessibilityservice.AccessibilityService.class)
    public class ShadowAccessibilityService
    extends ShadowService
    Shadow of AccessibilityService that tracks global actions and provides a mechanism to simulate the window list.
    • Constructor Detail

      • ShadowAccessibilityService

        public ShadowAccessibilityService()
    • Method Detail

      • performGlobalAction

        @Implementation
        protected final boolean performGlobalAction​(int action)
      • getGlobalActionsPerformed

        public java.util.List<java.lang.Integer> getGlobalActionsPerformed()
      • getWindows

        @Implementation(minSdk=21)
        protected java.util.List<android.view.accessibility.AccessibilityWindowInfo> getWindows()
        Returns a representation of interactive windows shown on the device screen. Mirrors the values provided to #setWindows(List). Returns an empty List if not set.
      • dispatchGesture

        @Implementation(minSdk=24)
        protected boolean dispatchGesture​(android.accessibilityservice.GestureDescription gesture,
                                          android.accessibilityservice.AccessibilityService.GestureResultCallback callback,
                                          android.os.Handler handler)
      • setWindows

        public void setWindows​(java.util.List<android.view.accessibility.AccessibilityWindowInfo> windowList)
        Sets the list of interactive windows shown on the device screen as reported by getWindows()
      • getGesturesDispatched

        public java.util.List<ShadowAccessibilityService.GestureDispatch> getGesturesDispatched()
        Returns a list of gestures that have been dispatched. Gestures are dispatched by calling AccessibilityService.dispatchGesture(android.accessibilityservice.GestureDescription, android.accessibilityservice.AccessibilityService.GestureResultCallback, android.os.Handler).
      • setCanDispatchGestures

        public void setCanDispatchGestures​(boolean canDispatchGestures)
        Sets whether the service is currently able to dispatch gestures. If false, AccessibilityService.dispatchGesture(android.accessibilityservice.GestureDescription, android.accessibilityservice.AccessibilityService.GestureResultCallback, android.os.Handler) will return false.