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

Commit 9e8b0cb5 authored by Winson Chung's avatar Winson Chung
Browse files

Fix issue with wrong content insets immediately after rotation

- Force a layout to ensure that the content insets are updated for the
  home activity prior to notifying the recents callback

Bug: 112205777
Test: Rotate phone, swipe up and ensure that home gets the right content
      insets

Change-Id: If99242dc647f62268da90e7b3151531e5fc8b02a
parent c4c8ab53
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -361,6 +361,11 @@ public class RecentsAnimationController implements DeathRecipient {
                    new RemoteAnimationTarget[appAnimations.size()]);
            mPendingStart = false;

            // Perform layout if it was scheduled before to make sure that we get correct content
            // insets for the target app window after a rotation
            final DisplayContent displayContent = mService.mRoot.getDisplayContent(mDisplayId);
            displayContent.performLayout(false /* initial */, false /* updateInputWindows */);

            final Rect minimizedHomeBounds = mTargetAppToken != null
                    && mTargetAppToken.inSplitScreenSecondaryWindowingMode()
                            ? mMinimizedHomeBounds
@@ -369,8 +374,7 @@ public class RecentsAnimationController implements DeathRecipient {
                    && mTargetAppToken.findMainWindow() != null
                            ? mTargetAppToken.findMainWindow().mContentInsets
                            : null;
            mRunner.onAnimationStart(mController, appTargets, contentInsets,
                    minimizedHomeBounds);
            mRunner.onAnimationStart(mController, appTargets, contentInsets, minimizedHomeBounds);
            if (DEBUG_RECENTS_ANIMATIONS) {
                Slog.d(TAG, "startAnimation(): Notify animation start:");
                for (int i = 0; i < mPendingAnimations.size(); i++) {