Loading core/java/android/app/UiAutomationConnection.java +8 −7 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.view.WindowAnimationFrameStats; import android.view.WindowContentFrameStats; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.IAccessibilityManager; import android.window.ScreenCapture; import libcore.io.IoUtils; Loading Loading @@ -220,13 +221,13 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { int width = crop.width(); int height = crop.height(); final IBinder displayToken = SurfaceControl.getInternalDisplayToken(); final SurfaceControl.DisplayCaptureArgs captureArgs = new SurfaceControl.DisplayCaptureArgs.Builder(displayToken) final ScreenCapture.DisplayCaptureArgs captureArgs = new ScreenCapture.DisplayCaptureArgs.Builder(displayToken) .setSourceCrop(crop) .setSize(width, height) .build(); final SurfaceControl.ScreenshotHardwareBuffer screenshotBuffer = SurfaceControl.captureDisplay(captureArgs); final ScreenCapture.ScreenshotHardwareBuffer screenshotBuffer = ScreenCapture.captureDisplay(captureArgs); return screenshotBuffer == null ? null : screenshotBuffer.asBitmap(); } finally { Binder.restoreCallingIdentity(identity); Loading @@ -242,11 +243,11 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { throwIfNotConnectedLocked(); } SurfaceControl.ScreenshotHardwareBuffer captureBuffer; ScreenCapture.ScreenshotHardwareBuffer captureBuffer; final long identity = Binder.clearCallingIdentity(); try { captureBuffer = SurfaceControl.captureLayers( new SurfaceControl.LayerCaptureArgs.Builder(surfaceControl) captureBuffer = ScreenCapture.captureLayers( new ScreenCapture.LayerCaptureArgs.Builder(surfaceControl) .setChildrenOnly(false) .build()); } finally { Loading core/java/android/hardware/display/DisplayManagerInternal.java +3 −3 Original line number Diff line number Diff line Loading @@ -28,9 +28,9 @@ import android.util.Slog; import android.util.SparseArray; import android.view.Display; import android.view.DisplayInfo; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import android.window.DisplayWindowPolicyController; import android.window.ScreenCapture; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -118,7 +118,7 @@ public abstract class DisplayManagerInternal { * @param displayId The display id to take the screenshot of. * @return The buffer or null if we have failed. */ public abstract SurfaceControl.ScreenshotHardwareBuffer systemScreenshot(int displayId); public abstract ScreenCapture.ScreenshotHardwareBuffer systemScreenshot(int displayId); /** * General screenshot functionality that excludes secure layers and applies appropriate Loading @@ -127,7 +127,7 @@ public abstract class DisplayManagerInternal { * @param displayId The display id to take the screenshot of. * @return The buffer or null if we have failed. */ public abstract SurfaceControl.ScreenshotHardwareBuffer userScreenshot(int displayId); public abstract ScreenCapture.ScreenshotHardwareBuffer userScreenshot(int displayId); /** * Returns information about the specified logical display. Loading core/java/android/service/wallpaper/WallpaperService.java +4 −3 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ import android.view.WindowLayout; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.window.ClientWindowFrames; import android.window.ScreenCapture; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.HandlerCaller; Loading Loading @@ -1989,9 +1990,9 @@ public abstract class WallpaperService extends Service { cleanUpScreenshotSurfaceControl(); } SurfaceControl.ScreenshotHardwareBuffer screenshotBuffer = SurfaceControl.captureLayers( new SurfaceControl.LayerCaptureArgs.Builder(mSurfaceControl) ScreenCapture.ScreenshotHardwareBuffer screenshotBuffer = ScreenCapture.captureLayers( new ScreenCapture.LayerCaptureArgs.Builder(mSurfaceControl) // Needed because SurfaceFlinger#validateScreenshotPermissions // uses this parameter to check whether a caller only attempts // to screenshot itself when call doesn't come from the system. Loading Loading
core/java/android/app/UiAutomationConnection.java +8 −7 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.view.WindowAnimationFrameStats; import android.view.WindowContentFrameStats; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.IAccessibilityManager; import android.window.ScreenCapture; import libcore.io.IoUtils; Loading Loading @@ -220,13 +221,13 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { int width = crop.width(); int height = crop.height(); final IBinder displayToken = SurfaceControl.getInternalDisplayToken(); final SurfaceControl.DisplayCaptureArgs captureArgs = new SurfaceControl.DisplayCaptureArgs.Builder(displayToken) final ScreenCapture.DisplayCaptureArgs captureArgs = new ScreenCapture.DisplayCaptureArgs.Builder(displayToken) .setSourceCrop(crop) .setSize(width, height) .build(); final SurfaceControl.ScreenshotHardwareBuffer screenshotBuffer = SurfaceControl.captureDisplay(captureArgs); final ScreenCapture.ScreenshotHardwareBuffer screenshotBuffer = ScreenCapture.captureDisplay(captureArgs); return screenshotBuffer == null ? null : screenshotBuffer.asBitmap(); } finally { Binder.restoreCallingIdentity(identity); Loading @@ -242,11 +243,11 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { throwIfNotConnectedLocked(); } SurfaceControl.ScreenshotHardwareBuffer captureBuffer; ScreenCapture.ScreenshotHardwareBuffer captureBuffer; final long identity = Binder.clearCallingIdentity(); try { captureBuffer = SurfaceControl.captureLayers( new SurfaceControl.LayerCaptureArgs.Builder(surfaceControl) captureBuffer = ScreenCapture.captureLayers( new ScreenCapture.LayerCaptureArgs.Builder(surfaceControl) .setChildrenOnly(false) .build()); } finally { Loading
core/java/android/hardware/display/DisplayManagerInternal.java +3 −3 Original line number Diff line number Diff line Loading @@ -28,9 +28,9 @@ import android.util.Slog; import android.util.SparseArray; import android.view.Display; import android.view.DisplayInfo; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import android.window.DisplayWindowPolicyController; import android.window.ScreenCapture; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -118,7 +118,7 @@ public abstract class DisplayManagerInternal { * @param displayId The display id to take the screenshot of. * @return The buffer or null if we have failed. */ public abstract SurfaceControl.ScreenshotHardwareBuffer systemScreenshot(int displayId); public abstract ScreenCapture.ScreenshotHardwareBuffer systemScreenshot(int displayId); /** * General screenshot functionality that excludes secure layers and applies appropriate Loading @@ -127,7 +127,7 @@ public abstract class DisplayManagerInternal { * @param displayId The display id to take the screenshot of. * @return The buffer or null if we have failed. */ public abstract SurfaceControl.ScreenshotHardwareBuffer userScreenshot(int displayId); public abstract ScreenCapture.ScreenshotHardwareBuffer userScreenshot(int displayId); /** * Returns information about the specified logical display. Loading
core/java/android/service/wallpaper/WallpaperService.java +4 −3 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ import android.view.WindowLayout; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.window.ClientWindowFrames; import android.window.ScreenCapture; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.HandlerCaller; Loading Loading @@ -1989,9 +1990,9 @@ public abstract class WallpaperService extends Service { cleanUpScreenshotSurfaceControl(); } SurfaceControl.ScreenshotHardwareBuffer screenshotBuffer = SurfaceControl.captureLayers( new SurfaceControl.LayerCaptureArgs.Builder(mSurfaceControl) ScreenCapture.ScreenshotHardwareBuffer screenshotBuffer = ScreenCapture.captureLayers( new ScreenCapture.LayerCaptureArgs.Builder(mSurfaceControl) // Needed because SurfaceFlinger#validateScreenshotPermissions // uses this parameter to check whether a caller only attempts // to screenshot itself when call doesn't come from the system. Loading