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

Commit cbe76330 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Skip resize changing transition if display is rotating

Though the bounds change transactions are not updated synchronously with
display rotation, the rotation animation will wait until visible windows
are drawn with new configuration. So even if the bounds change for task
fragment are sent after receiving onTaskFragmentParentInfoChanged due to
rotation change, it can still be covered by rotation animation.

Bug: 197983252
Test: Launch split embedded activities and rotated device.

Change-Id: I4517eac3ba221b45a20b7d7bd5f05c4def33e8c4
parent 61babbcf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -8411,7 +8411,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                startFreezingScreenLocked(globalChanges);
            }
            forceNewConfig = false;
            preserveWindow &= isResizeOnlyChange(changes);
            // Do not preserve window if it is freezing screen because the original window won't be
            // able to update drawn state that causes freeze timeout.
            preserveWindow &= isResizeOnlyChange(changes) && !mFreezingScreen;
            final boolean hasResizeChange = hasResizeChange(changes & ~info.getRealConfigChanged());
            if (hasResizeChange) {
                final boolean isDragResizing = task.isDragResizing();
+6 −0
Original line number Diff line number Diff line
@@ -3139,6 +3139,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        return mScreenRotationAnimation;
    }

    /** If the display is in transition, there should be a screenshot covering it. */
    @Override
    boolean inTransition() {
        return mScreenRotationAnimation != null || super.inTransition();
    }

    @Override
    public void dumpDebug(ProtoOutputStream proto, long fieldId,
            @WindowTraceLogLevel int logLevel) {
+6 −1
Original line number Diff line number Diff line
@@ -729,7 +729,12 @@ class ScreenRotationAnimation {
                mScreenshotRotationAnimator = null;
                mRotateScreenAnimator = null;
                mService.mAnimator.mBulkUpdateParams |= WindowSurfacePlacer.SET_UPDATE_ROTATION;
                if (mDisplayContent.getRotationAnimation() == ScreenRotationAnimation.this) {
                    // It also invokes kill().
                    mDisplayContent.setRotationAnimation(null);
                } else {
                    kill();
                }
                mService.updateRotation(false, false);
            }
        }
+2 −0
Original line number Diff line number Diff line
@@ -2014,6 +2014,8 @@ class TaskFragment extends WindowContainer<WindowContainer> {
                || mDisplayContent == null
                || mTaskFragmentOrganizer == null
                || getSurfaceControl() == null
                // The change transition will be covered by display.
                || mDisplayContent.inTransition()
                || !isVisible()) {
            return false;
        }
+4 −0
Original line number Diff line number Diff line
@@ -987,6 +987,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        return mDisplayContent != null && mDisplayContent.mChangingContainers.contains(this);
    }

    boolean inTransition() {
        return mWmService.mAtmService.getTransitionController().inTransition(this);
    }

    void sendAppVisibilityToClients() {
        for (int i = mChildren.size() - 1; i >= 0; --i) {
            final WindowContainer wc = mChildren.get(i);