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

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

Skip initializing unused system bar painter am: 2b1a1bcc

parents b2c0d58c 2b1a1bcc
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -152,10 +152,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);
@@ -396,9 +398,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);
    }