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

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

Merge "wm fixedTransformHint with installOrientation" into main

parents 28745639 87f7c178
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2274,7 +2274,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        if (shellTransitions) {
            // Before setDisplayProjection is applied by the start transaction of transition,
            // set the transform hint to avoid using surface in old rotation.
            getPendingTransaction().setFixedTransformHint(mSurfaceControl, rotation);
            setFixedTransformHint(getPendingTransaction(), mSurfaceControl, rotation);
            // The sync transaction should already contains setDisplayProjection, so unset the
            // hint to restore the natural state when the transaction is applied.
            transaction.unsetFixedTransformHint(mSurfaceControl);
@@ -2284,6 +2284,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        mWmService.mRotationWatcherController.dispatchDisplayRotationChange(mDisplayId, rotation);
    }

    void setFixedTransformHint(Transaction t, SurfaceControl sc, int rotation) {
        t.setFixedTransformHint(sc, (rotation + mDisplayInfo.installOrientation) % 4);
    }

    void configureDisplayPolicy() {
        mRootWindowContainer.updateDisplayImePolicyCache();
        mDisplayPolicy.updateConfigurationAndScreenSizeDependentBehaviors();
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public class SeamlessRotator {
        mOldRotation = oldRotation;
        mNewRotation = newRotation;
        mApplyFixedTransformHint = applyFixedTransformationHint;
        mFixedTransformHint = oldRotation;
        mFixedTransformHint = (oldRotation + info.installOrientation) % 4;
        final boolean flipped = info.rotation == ROTATION_90 || info.rotation == ROTATION_270;
        final int pH = flipped ? info.logicalWidth : info.logicalHeight;
        final int pW = flipped ? info.logicalHeight : info.logicalWidth;
+1 −1
Original line number Diff line number Diff line
@@ -3733,7 +3733,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
                && !mTransitionController.useShellTransitionsRotation()) {
            if (deltaRotation != Surface.ROTATION_0) {
                updateSurfaceRotation(t, deltaRotation, null /* positionLeash */);
                getPendingTransaction().setFixedTransformHint(mSurfaceControl,
                mDisplayContent.setFixedTransformHint(getPendingTransaction(), mSurfaceControl,
                        getWindowConfiguration().getDisplayRotation());
            } else if (deltaRotation != mLastDeltaRotation) {
                t.setMatrix(mSurfaceControl, 1, 0, 0, 1);
+1 −1
Original line number Diff line number Diff line
@@ -629,7 +629,7 @@ class WindowToken extends WindowContainer<WindowState> {
                .build();
        t.setPosition(leash, mLastSurfacePosition.x, mLastSurfacePosition.y);
        t.reparent(getSurfaceControl(), leash);
        getPendingTransaction().setFixedTransformHint(leash,
        mDisplayContent.setFixedTransformHint(getPendingTransaction(), leash,
                getWindowConfiguration().getDisplayRotation());
        mFixedRotationTransformLeash = leash;
        updateSurfaceRotation(t, rotation, mFixedRotationTransformLeash);