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

Commit 169e1f90 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove unused InsetsSourceProvider#mSeamlessRotating" into main

parents e403e450 1a29879e
Loading
Loading
Loading
Loading
+0 −23
Original line number Original line 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.FRAME;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.IS_LEASH_READY_FOR_DISPATCHING;
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.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.SERVER_VISIBLE;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.SOURCE;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.SOURCE;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.SOURCE_WINDOW_STATE_IDENTIFIER;
import static android.internal.perfetto.protos.Windowmanagerservice.InsetsSourceProviderProto.SOURCE_WINDOW_STATE_IDENTIFIER;
@@ -127,8 +126,6 @@ class InsetsSourceProvider {
     */
     */
    private boolean mServerVisible;
    private boolean mServerVisible;


    private boolean mSeamlessRotating;

    private final boolean mControllable;
    private final boolean mControllable;


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


    void updateControlForTarget(@Nullable InsetsControlTarget target, boolean force,
    void updateControlForTarget(@Nullable InsetsControlTarget target, boolean force,
            @Nullable ImeTracker.Token statsToken) {
            @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;
        mPendingControlTarget = target;


        if (mWin != null && mWin.getSurfaceControl() == null) {
        if (mWin != null && mWin.getSurfaceControl() == null) {
@@ -567,19 +558,6 @@ class InsetsSourceProvider {
        mStateController.notifySurfaceTransactionReady(this, 0, false);
        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,
    boolean updateClientVisibility(@NonNull InsetsTarget caller,
            @Nullable ImeTracker.Token statsToken) {
            @Nullable ImeTracker.Token statsToken) {
        final boolean requestedVisible = caller.isRequestedVisible(mSource.getType());
        final boolean requestedVisible = caller.isRequestedVisible(mSource.getType());
@@ -772,7 +750,6 @@ class InsetsSourceProvider {
        proto.write(IS_LEASH_READY_FOR_DISPATCHING, isLeashReadyForDispatching());
        proto.write(IS_LEASH_READY_FOR_DISPATCHING, isLeashReadyForDispatching());
        proto.write(CLIENT_VISIBLE, mClientVisible);
        proto.write(CLIENT_VISIBLE, mClientVisible);
        proto.write(SERVER_VISIBLE, mServerVisible);
        proto.write(SERVER_VISIBLE, mServerVisible);
        proto.write(SEAMLESS_ROTATING, mSeamlessRotating);
        proto.write(CONTROLLABLE, mControllable);
        proto.write(CONTROLLABLE, mControllable);
        if (mWin != null) {
        if (mWin != null) {
            mWin.writeIdentifierToProto(proto, SOURCE_WINDOW_STATE_IDENTIFIER);
            mWin.writeIdentifierToProto(proto, SOURCE_WINDOW_STATE_IDENTIFIER);
+0 −15
Original line number Original line Diff line number Diff line
@@ -132,21 +132,6 @@ public class InsetsSourceProviderTest extends WindowTestsBase {
        assertNotNull(mProvider.getControl(target));
        assertNotNull(mProvider.getControl(target));
        assertNotNull(mProvider.getControlTarget());
        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.
        // We can clear the control and the control target.
        mProvider.updateControlForTarget(null, false /* force */, null /* statsToken */);
        mProvider.updateControlForTarget(null, false /* force */, null /* statsToken */);
        assertNull(mProvider.getControl(target));
        assertNull(mProvider.getControl(target));