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

Commit 231bca10 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Cleanup insets_control_seq" into main

parents cd59885b 63425b50
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import static android.view.WindowInsets.Type.captionBar;
import static android.view.WindowInsets.Type.ime;

import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
import static com.android.window.flags.Flags.insetsControlSeq;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -877,9 +876,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
        @InsetsType int visibleTypes = 0;
        @InsetsType int[] cancelledUserAnimationTypes = {0};
        for (int i = 0, size = newState.sourceSize(); i < size; i++) {
            final InsetsSource source = insetsControlSeq()
                    ? new InsetsSource(newState.sourceAt(i))
                    : newState.sourceAt(i);
            final InsetsSource source = new InsetsSource(newState.sourceAt(i));
            @InsetsType int type = source.getType();
            @AnimationType int animationType = getAnimationType(type);
            final InsetsSourceConsumer consumer = mSourceConsumers.get(source.getId());
+0 −4
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import static android.view.InsetsSourceConsumerProto.SOURCE_CONTROL;
import static android.view.InsetsSourceConsumerProto.TYPE_NUMBER;

import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
import static com.android.window.flags.Flags.insetsControlSeq;

import android.annotation.IntDef;
import android.annotation.Nullable;
@@ -431,9 +430,6 @@ public class InsetsSourceConsumer {

        // Frame is changing while animating. Keep note of the new frame but keep existing frame
        // until animation is finished.
        if (!insetsControlSeq()) {
            newSource = new InsetsSource(newSource);
        }
        mPendingFrame = new Rect(newSource.getFrame());
        mPendingVisibleFrame = newSource.getVisibleFrame() != null
                ? new Rect(newSource.getVisibleFrame())
+12 −23
Original line number Diff line number Diff line
@@ -130,7 +130,6 @@ import static android.window.flags.DesktopModeFlags.ENABLE_CAPTION_COMPAT_INSET_
import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
import static com.android.text.flags.Flags.disableHandwritingInitiatorForIme;
import static com.android.window.flags.Flags.enableBufferTransformHintFromDisplay;
import static com.android.window.flags.Flags.insetsControlSeq;
import static com.android.window.flags.Flags.setScPropertiesInClient;
import static com.android.window.flags.Flags.systemUiImmersiveConfirmationDialog;
@@ -888,10 +887,7 @@ public final class ViewRootImpl implements ViewParent,
    /** Non-{@code null} if {@link #mActivityConfigCallback} is not {@code null}. */
    @Nullable
    private ActivityWindowInfo mLastReportedActivityWindowInfo;
    @Nullable
    private final ClientWindowFrames mLastReportedFrames = insetsControlSeq()
            ? new ClientWindowFrames()
            : null;
    private final ClientWindowFrames mLastReportedFrames = new ClientWindowFrames();
    private int mLastReportedInsetsStateSeq = getInitSeq();
    private int mLastReportedActiveControlsSeq = getInitSeq();
@@ -2316,9 +2312,6 @@ public final class ViewRootImpl implements ViewParent,
    }
    private void onClientWindowFramesChanged(@NonNull ClientWindowFrames inOutFrames) {
        if (mLastReportedFrames == null) {
            return;
        }
        if (isIncomingSeqStale(mLastReportedFrames.seq, inOutFrames.seq)) {
            // If the incoming is stale, use the last reported instead.
            inOutFrames.setTo(mLastReportedFrames);
@@ -2329,14 +2322,12 @@ public final class ViewRootImpl implements ViewParent,
    }
    private void onInsetsStateChanged(@NonNull InsetsState insetsState) {
        if (insetsControlSeq()) {
        if (isIncomingSeqStale(mLastReportedInsetsStateSeq, insetsState.getSeq())) {
            // The incoming is stale. Skip.
            return;
        }
        // Keep track of the latest.
        mLastReportedInsetsStateSeq = insetsState.getSeq();
        }
        if (mTranslator != null) {
            mTranslator.translateInsetsStateInScreenToAppWindow(insetsState);
@@ -2351,7 +2342,6 @@ public final class ViewRootImpl implements ViewParent,
            return;
        }
        if (insetsControlSeq()) {
        if (isIncomingSeqStale(mLastReportedActiveControlsSeq, activeControls.getSeq())) {
            // The incoming is stale. Skip.
            activeControls.release();
@@ -2359,7 +2349,6 @@ public final class ViewRootImpl implements ViewParent,
        }
        // Keep track of the latest.
        mLastReportedActiveControlsSeq = activeControls.getSeq();
        }
        final InsetsSourceControl[] controls = activeControls.get();
        if (mTranslator != null) {
+0 −11
Original line number Diff line number Diff line
@@ -66,17 +66,6 @@ flag {
    bug: "293658614"
}

flag {
    namespace: "windowing_sdk"
    name: "insets_control_seq"
    description: "Add seqId to InsetsControls to ensure the stale update is ignored"
    bug: "339380439"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "windowing_sdk"
     name: "move_animation_options_to_change"
+0 −2
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@ import android.graphics.Rect;
import android.hardware.display.DisplayManagerGlobal;
import android.os.Binder;
import android.os.SystemProperties;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.annotations.Presubmit;
import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
@@ -1599,7 +1598,6 @@ public class ViewRootImplTest {
                nativeCreateASurfaceControlFromSurface(mViewRootImpl.mSurface));
    }

    @EnableFlags(Flags.FLAG_INSETS_CONTROL_SEQ)
    @Test
    public void testHandleInsetsControlChanged() {
        mView = new View(sContext);