Loading core/java/android/accessibilityservice/AccessibilityService.java +9 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.util.Slog; import android.util.SparseArray; import android.view.Display; import android.view.KeyEvent; import android.view.SurfaceControl; import android.view.SurfaceView; import android.view.WindowManager; import android.view.WindowManagerImpl; Loading Loading @@ -1937,8 +1938,8 @@ public abstract class AccessibilityService extends Service { * to declare the capability to take screenshot by setting the * {@link android.R.styleable#AccessibilityService_canTakeScreenshot} * property in its meta-data. For details refer to {@link #SERVICE_META_DATA}. * Besides, This API is only supported for default display now * {@link Display#DEFAULT_DISPLAY}. * This API only will support {@link Display#DEFAULT_DISPLAY} until {@link SurfaceControl} * supports non-default displays. * </p> * * @param displayId The logic display id, must be {@link Display#DEFAULT_DISPLAY} for Loading @@ -1948,11 +1949,17 @@ public abstract class AccessibilityService extends Service { * * @return {@code true} if the taking screenshot accepted, {@code false} if too little time * has elapsed since the last screenshot, invalid display or internal errors. * @throws IllegalArgumentException if displayId is not {@link Display#DEFAULT_DISPLAY}. */ public boolean takeScreenshot(int displayId, @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<ScreenshotResult> callback) { Preconditions.checkNotNull(executor, "executor cannot be null"); Preconditions.checkNotNull(callback, "callback cannot be null"); if (displayId != Display.DEFAULT_DISPLAY) { throw new IllegalArgumentException("DisplayId isn't the default display"); } final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getInstance().getConnection( mConnectionId); Loading Loading
core/java/android/accessibilityservice/AccessibilityService.java +9 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.util.Slog; import android.util.SparseArray; import android.view.Display; import android.view.KeyEvent; import android.view.SurfaceControl; import android.view.SurfaceView; import android.view.WindowManager; import android.view.WindowManagerImpl; Loading Loading @@ -1937,8 +1938,8 @@ public abstract class AccessibilityService extends Service { * to declare the capability to take screenshot by setting the * {@link android.R.styleable#AccessibilityService_canTakeScreenshot} * property in its meta-data. For details refer to {@link #SERVICE_META_DATA}. * Besides, This API is only supported for default display now * {@link Display#DEFAULT_DISPLAY}. * This API only will support {@link Display#DEFAULT_DISPLAY} until {@link SurfaceControl} * supports non-default displays. * </p> * * @param displayId The logic display id, must be {@link Display#DEFAULT_DISPLAY} for Loading @@ -1948,11 +1949,17 @@ public abstract class AccessibilityService extends Service { * * @return {@code true} if the taking screenshot accepted, {@code false} if too little time * has elapsed since the last screenshot, invalid display or internal errors. * @throws IllegalArgumentException if displayId is not {@link Display#DEFAULT_DISPLAY}. */ public boolean takeScreenshot(int displayId, @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<ScreenshotResult> callback) { Preconditions.checkNotNull(executor, "executor cannot be null"); Preconditions.checkNotNull(callback, "callback cannot be null"); if (displayId != Display.DEFAULT_DISPLAY) { throw new IllegalArgumentException("DisplayId isn't the default display"); } final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getInstance().getConnection( mConnectionId); Loading