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

Commit 1a29879e authored by Tiger Huang's avatar Tiger Huang
Browse files

Remove unused InsetsSourceProvider#mSeamlessRotating

The related logic should be removed since commit:
19be81cc

Bug: 365884835
Flag: EXEMPT remove unused code
Test: atest InsetsSourceProviderTest
Change-Id: Iccb3cf1c024f3a6e4b7acd19e75b38dc9e81b4e0
parent f6a30104
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSource
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.FRAME;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.IS_LEASH_READY_FOR_DISPATCHING;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.PENDING_CONTROL_TARGET_IDENTIFIER;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.SEAMLESS_ROTATING;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.SERVER_VISIBLE;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.SOURCE;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.SOURCE_WINDOW_STATE_IDENTIFIER;
@@ -127,8 +126,6 @@ class InsetsSourceProvider {
     */
    private boolean mServerVisible;

    private boolean mSeamlessRotating;

    private final boolean mControllable;

    InsetsSourceProvider(@NonNull InsetsSource source,
@@ -221,7 +218,6 @@ class InsetsSourceProvider {
            // animate-out as new one animates-in.
            mWin.cancelAnimation();
            mWin.getInsetsSourceProviders().remove(mSource.getId());
            mSeamlessRotating = false;
            mHasPendingPosition = false;
        }
        ProtoLog.d(WM_DEBUG_WINDOW_INSETS, "setWin %s for type %s",
@@ -459,11 +455,6 @@ class InsetsSourceProvider {

    void updateControlForTarget(@Nullable InsetsControlTarget target, boolean force,
            @Nullable ImeTracker.Token statsToken) {
        if (mSeamlessRotating) {
            // We are un-rotating the window against the display rotation. We don't want the target
            // to control the window for now.
            return;
        }
        mPendingControlTarget = target;

        if (mWin != null && mWin.getSurfaceControl() == null) {
@@ -554,19 +545,6 @@ class InsetsSourceProvider {
        mStateController.notifySurfaceTransactionReady(this, 0, false);
    }

    void startSeamlessRotation() {
        if (!mSeamlessRotating) {
            mSeamlessRotating = true;
            if (mWin != null) {
                mWin.cancelAnimation();
            }
        }
    }

    void finishSeamlessRotation() {
        mSeamlessRotating = false;
    }

    boolean updateClientVisibility(@NonNull InsetsTarget caller,
            @Nullable ImeTracker.Token statsToken) {
        final boolean requestedVisible = caller.isRequestedVisible(mSource.getType());
@@ -759,7 +737,6 @@ class InsetsSourceProvider {
        proto.write(IS_LEASH_READY_FOR_DISPATCHING, isLeashReadyForDispatching());
        proto.write(CLIENT_VISIBLE, mClientVisible);
        proto.write(SERVER_VISIBLE, mServerVisible);
        proto.write(SEAMLESS_ROTATING, mSeamlessRotating);
        proto.write(CONTROLLABLE, mControllable);
        if (mWin != null) {
            mWin.writeIdentifierToProto(proto, SOURCE_WINDOW_STATE_IDENTIFIER);
+0 −15
Original line number Diff line number Diff line
@@ -128,21 +128,6 @@ public class InsetsSourceProviderTest extends WindowTestsBase {
        assertNotNull(mProvider.getControl(target));
        assertNotNull(mProvider.getControlTarget());

        // We must not have control or control target while we are performing seamless rotation.
        // And the control and the control target must not be updated during that.
        mProvider.startSeamlessRotation();
        assertNull(mProvider.getControl(target));
        assertNull(mProvider.getControlTarget());
        mProvider.updateControlForTarget(target, true /* force */, null /* statsToken */);
        assertNull(mProvider.getControl(target));
        assertNull(mProvider.getControlTarget());

        // We can have the control and the control target after seamless rotation.
        mProvider.finishSeamlessRotation();
        mProvider.updateControlForTarget(target, false /* force */, null /* statsToken */);
        assertNotNull(mProvider.getControl(target));
        assertNotNull(mProvider.getControlTarget());

        // We can clear the control and the control target.
        mProvider.updateControlForTarget(null, false /* force */, null /* statsToken */);
        assertNull(mProvider.getControl(target));