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

Commit 87f7c178 authored by liulijun's avatar liulijun Committed by Riddle Hsu
Browse files

wm fixedTransformHint with installOrientation



primary_display_orientation is 270, rotate the device.
wm call setFixedTransformHint() avoid using old rotation.
the fixedTransformHint need with installOrientation.

Bug: 381832929
Flag: EXEMPT bugfix
Test: CtsWindowManagerDeviceDisplay
Change-Id: I47ec37efcffb9c4f0c1eb3a55be50d31a93fb276
Signed-off-by: default avatarLiu Lijun <liulijun@xiaomi.corp-partner.google.com>
parent b8debc69
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2266,7 +2266,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);
@@ -2276,6 +2276,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);