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

Commit 1a56b984 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Allow IME snapshot to capture with secure layer for transition" into main

parents f7582a00 50e17a52
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -232,8 +232,14 @@ class TaskSnapshotController extends AbsAppSnapshotController<Task, TaskSnapshot
        if (imeWindow != null && imeWindow.isVisible()) {
            final Rect bounds = imeWindow.getParentFrame();
            bounds.offsetTo(0, 0);
            imeBuffer = ScreenCapture.captureLayersExcluding(imeWindow.getSurfaceControl(),
                    bounds, 1.0f, pixelFormat, null);
            ScreenCapture.LayerCaptureArgs captureArgs = new ScreenCapture.LayerCaptureArgs.Builder(
                    imeWindow.getSurfaceControl())
                    .setSourceCrop(bounds)
                    .setFrameScale(1.0f)
                    .setPixelFormat(pixelFormat)
                    .setCaptureSecureLayers(true)
                    .build();
            imeBuffer = ScreenCapture.captureLayers(captureArgs);
        }
        return imeBuffer;
    }