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

Commit 8657504d authored by Santos Cordon's avatar Santos Cordon
Browse files

Move call to captureDisplay outside of the synchronized block.

Bug: 224509101
Test: atest com.android.server.display
Test: manually ensure the fade-to-black feature still works.
Change-Id: I3ad87d990c16e242e1613116ec2c30fd9d2b879e
parent 6d1be01f
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -2084,6 +2084,7 @@ public final class DisplayManagerService extends SystemService {
    }

    private SurfaceControl.ScreenshotHardwareBuffer systemScreenshotInternal(int displayId) {
        final SurfaceControl.DisplayCaptureArgs captureArgs;
        synchronized (mSyncRoot) {
            final IBinder token = getDisplayToken(displayId);
            if (token == null) {
@@ -2095,15 +2096,14 @@ public final class DisplayManagerService extends SystemService {
            }

            final DisplayInfo displayInfo = logicalDisplay.getDisplayInfoLocked();
            final SurfaceControl.DisplayCaptureArgs captureArgs =
                    new SurfaceControl.DisplayCaptureArgs.Builder(token)
            captureArgs = new SurfaceControl.DisplayCaptureArgs.Builder(token)
                    .setSize(displayInfo.getNaturalWidth(), displayInfo.getNaturalHeight())
                    .setUseIdentityTransform(true)
                    .setCaptureSecureLayers(true)
                    .setAllowProtected(true)
                    .build();
            return SurfaceControl.captureDisplay(captureArgs);
        }
        return SurfaceControl.captureDisplay(captureArgs);
    }

    private SurfaceControl.ScreenshotHardwareBuffer userScreenshotInternal(int displayId) {