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

Commit 28b34045 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Make sure updateSurface is called for rotation change

The condition to call updateSurface requires relayout request.
And keep the previous requested force-next-relayout to avoid
the value set from performConfigurationChange being replaced,
or before performing traversal, there is another resize event
that erases the pending relayout request.

Bug: 231282871
Test: Set allow home rotation.
      No flickering when rotating 180 degree.
Change-Id: I0fd6701ebe0c17e0e319b1360d48132e0c256358
parent 6cfafc4b
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1772,7 +1772,7 @@ public final class ViewRootImpl implements ViewParent,
            }
            }
        }
        }


        mForceNextWindowRelayout = forceNextWindowRelayout;
        mForceNextWindowRelayout |= forceNextWindowRelayout;
        mPendingAlwaysConsumeSystemBars = args.argi2 != 0;
        mPendingAlwaysConsumeSystemBars = args.argi2 != 0;
        mSyncSeqId = args.argi4 > mSyncSeqId ? args.argi4 : mSyncSeqId;
        mSyncSeqId = args.argi4 > mSyncSeqId ? args.argi4 : mSyncSeqId;


@@ -5233,6 +5233,9 @@ public final class ViewRootImpl implements ViewParent,
            // the buffers may still have content in previous rotation. And the next draw may
            // the buffers may still have content in previous rotation. And the next draw may
            // not update all regions, that causes some afterimages to flicker.
            // not update all regions, that causes some afterimages to flicker.
            mUpdateSurfaceNeeded = true;
            mUpdateSurfaceNeeded = true;
            if (!mIsInTraversal) {
                mForceNextWindowRelayout = true;
            }
        }
        }


        Configuration globalConfig = mergedConfiguration.getGlobalConfiguration();
        Configuration globalConfig = mergedConfiguration.getGlobalConfiguration();