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

Commit d0d63d0a authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Skip initializing unused system bar painter" into main

parents 21685785 7913d259
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -151,10 +151,12 @@ public class SnapshotDrawerUtils {
        @VisibleForTesting
        public void setFrames(Rect frame, Rect systemBarInsets) {
            mFrame.set(frame);
            mSystemBarInsets.set(systemBarInsets);
            mSizeMismatch = (mFrame.width() != mSnapshotW || mFrame.height() != mSnapshotH);
            if (!Flags.drawSnapshotAspectRatioMatch() && systemBarInsets != null) {
                mSystemBarInsets.set(systemBarInsets);
                mSystemBarBackgroundPainter.setInsets(systemBarInsets);
            }
        }

        private void drawSnapshot(boolean releaseAfterDraw) {
            Log.v(TAG, "Drawing snapshot surface sizeMismatch=" + mSizeMismatch);
@@ -394,9 +396,12 @@ public class SnapshotDrawerUtils {
        final ActivityManager.RunningTaskInfo runningTaskInfo = info.taskInfo;
        final ActivityManager.TaskDescription taskDescription =
                getOrCreateTaskDescription(runningTaskInfo);
        Rect systemBarInsets = null;
        if (!Flags.drawSnapshotAspectRatioMatch()) {
            drawSurface.initiateSystemBarPainter(lp.flags, lp.privateFlags,
                    attrs.insetsFlags.appearance, taskDescription, info.requestedVisibleTypes);
        final Rect systemBarInsets = getSystemBarInsets(windowBounds, topWindowInsetsState);
            systemBarInsets = getSystemBarInsets(windowBounds, topWindowInsetsState);
        }
        drawSurface.setFrames(windowBounds, systemBarInsets);
        drawSurface.drawSnapshot(releaseAfterDraw);
    }