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

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

Merge "Do not use cached insets if rotation is different" into main

parents 90389a33 dba38a8c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2219,6 +2219,7 @@ public class DisplayPolicy {
            ArrayList<InsetsSource> mPreservedInsets;
            ArrayList<InsetsSource> mRegularBarsInsets;
            PrivacyIndicatorBounds mPrivacyIndicatorBounds;
            int mRotation;

            Cache(DisplayContent dc) {
                mDecorInsets = new DecorInsets(dc);
@@ -2321,7 +2322,9 @@ public class DisplayPolicy {
            prevCache = new DecorInsets(mDisplayContent);
            prevCache.setTo(mCachedDecorInsets.mDecorInsets);
            privacyIndicatorBounds = mCachedDecorInsets.mPrivacyIndicatorBounds;
            mCachedDecorInsets.mPreservedInsets = mCachedDecorInsets.mRegularBarsInsets;
            mCachedDecorInsets.mPreservedInsets =
                    mCachedDecorInsets.mRotation == mDisplayContent.mDisplayFrames.mRotation
                            ? mCachedDecorInsets.mRegularBarsInsets : null;
        }
        // Set a special id to preserve it before a real id is available from transition.
        mCachedDecorInsets.mPreserveId = DecorInsets.Cache.ID_UPDATING_CONFIG;
@@ -2330,6 +2333,7 @@ public class DisplayPolicy {
        if (com.android.window.flags.Flags.useCachedInsetsForDisplaySwitch()) {
            mCachedDecorInsets.mRegularBarsInsets = DecorInsets.Cache.copyRegularBarInsets(
                    mDisplayContent.mDisplayFrames.mInsetsState);
            mCachedDecorInsets.mRotation = mDisplayContent.mDisplayFrames.mRotation;
            mCachedDecorInsets.mPrivacyIndicatorBounds =
                    mDisplayContent.mCurrentPrivacyIndicatorBounds;
        } else {