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

Commit 0d3b1dcf authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Use legacy layer name for screenshot shell display rotation" into...

Merge "Use legacy layer name for screenshot shell display rotation" into tm-qpr-dev am: 1a27751c am: 3decda91

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19928105



Change-Id: I6330677a57b5993e63c42cba01851c0d639a5a5b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3b33c486 3decda91
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2120,8 +2120,12 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
                Slog.w(TAG, "Failed to capture screenshot for " + wc);
                return false;
            }
            final boolean isDisplayRotation = wc.asDisplayContent() != null
                    && wc.asDisplayContent().isRotationChanging();
            // Some tests may check the name "RotationLayer" to detect display rotation.
            final String name = isDisplayRotation ? "RotationLayer" : "transition snapshot: " + wc;
            SurfaceControl snapshotSurface = wc.makeAnimationLeash()
                    .setName("transition snapshot: " + wc.toString())
                    .setName(name)
                    .setOpaque(true)
                    .setParent(wc.getSurfaceControl())
                    .setSecure(screenshotBuffer.containsSecureLayers())
@@ -2131,9 +2135,8 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
            mFrozen.add(wc);
            final ChangeInfo changeInfo = Objects.requireNonNull(mChanges.get(wc));
            changeInfo.mSnapshot = snapshotSurface;
            if (wc.asDisplayContent() != null) {
                // This isn't cheap, so only do it for rotations: assume display-level is rotate
                // since most of the time it is.
            if (isDisplayRotation) {
                // This isn't cheap, so only do it for display rotations.
                changeInfo.mSnapshotLuma = RotationAnimationUtils.getMedianBorderLuma(
                        screenshotBuffer.getHardwareBuffer(), screenshotBuffer.getColorSpace());
            }