Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e06b011 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "Explicitly exclude IME from Task Snapshots" into rvc-dev

parents db95fd78 689a1b0f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1960,7 +1960,7 @@ public final class SurfaceControl implements Parcelable {
     * @hide
     */
    public static ScreenshotGraphicBuffer captureLayersExcluding(SurfaceControl layer,
            Rect sourceCrop, float frameScale, SurfaceControl[] exclude) {
          Rect sourceCrop, float frameScale, int format, SurfaceControl[] exclude) {
        final IBinder displayToken = SurfaceControl.getInternalDisplayToken();
        long[] nativeExcludeObjects = new long[exclude.length];
        for (int i = 0; i < exclude.length; i++) {
+12 −2
Original line number Diff line number Diff line
@@ -352,9 +352,19 @@ class TaskSnapshotController {
        }
        task.getBounds(mTmpRect);
        mTmpRect.offsetTo(0, 0);

        SurfaceControl[] excludeLayers;
        final WindowState imeWindow = task.getDisplayContent().mInputMethodWindow;
        if (imeWindow != null) {
            excludeLayers = new SurfaceControl[1];
            excludeLayers[0] = imeWindow.getSurfaceControl();
        } else {
            excludeLayers = new SurfaceControl[0];
        }
        final SurfaceControl.ScreenshotGraphicBuffer screenshotBuffer =
                SurfaceControl.captureLayers(
                        task.getSurfaceControl(), mTmpRect, scaleFraction, pixelFormat);
                SurfaceControl.captureLayersExcluding(
                        task.getSurfaceControl(), mTmpRect, scaleFraction,
                        pixelFormat, excludeLayers);
        if (outTaskSize != null) {
            outTaskSize.x = mTmpRect.width();
            outTaskSize.y = mTmpRect.height();