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

Commit 450cf9b9 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by android-build-merger
Browse files

Merge "Only run layout if we didn't have content" into pi-dev

am: 81099601

Change-Id: Ice26ae13d3ed8b80ac96b321341f7b68489b2257
parents fef5a7ab 81099601
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -400,6 +400,9 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo

    private MagnificationSpec mMagnificationSpec;

    /** Caches the value whether told display manager that we have content. */
    private boolean mLastHasContent;

    private final Consumer<WindowState> mUpdateWindowsForAnimator = w -> {
        WindowStateAnimator winAnimator = w.mWinAnimator;
        final AppWindowToken atoken = w.mAppToken;
@@ -2916,8 +2919,9 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        forAllWindows(mApplySurfaceChangesTransaction, true /* traverseTopToBottom */);
        prepareSurfaces();

        mLastHasContent = mTmpApplySurfaceChangesTransactionState.displayHasContent;
        mService.mDisplayManagerInternal.setDisplayProperties(mDisplayId,
                mTmpApplySurfaceChangesTransactionState.displayHasContent,
                mLastHasContent,
                mTmpApplySurfaceChangesTransactionState.preferredRefreshRate,
                mTmpApplySurfaceChangesTransactionState.preferredModeId,
                true /* inTraversal, must call performTraversalInTrans... below */);
@@ -4052,4 +4056,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    private boolean canUpdateImeTarget() {
        return mDeferUpdateImeTargetCount == 0;
    }

    /**
     * @return Cached value whether we told display manager that we have content.
     */
    boolean getLastHasContent() {
        return mLastHasContent;
    }
}
+11 −9
Original line number Diff line number Diff line
@@ -1185,6 +1185,7 @@ class WindowStateAnimator {
                        if (mIsWallpaper) {
                            w.dispatchWallpaperVisibility(true);
                        }
                        if (!w.getDisplayContent().getLastHasContent()) {
                            // This draw means the difference between unique content and mirroring.
                            // Run another pass through performLayout to set mHasContent in the
                            // LogicalDisplay.
@@ -1195,6 +1196,7 @@ class WindowStateAnimator {
                                        "showSurfaceRobustlyLocked " + w,
                                        mAnimator.getPendingLayoutChanges(w.getDisplayId()));
                            }
                        }
                    } else {
                        w.setOrientationChanging(false);
                    }