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

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

Merge "Fix lastDispatchedState sources change" into main

parents 964d2f3b b5600f5f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ 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;
@@ -890,7 +891,9 @@ 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 = newState.sourceAt(i);
            final InsetsSource source = insetsControlSeq()
                    ? new InsetsSource(newState.sourceAt(i))
                    : newState.sourceAt(i);
            @InsetsType int type = source.getType();
            @AnimationType int animationType = getAnimationType(type);
            final InsetsSourceConsumer consumer = mSourceConsumers.get(source.getId());
+4 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ 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;
@@ -410,7 +411,9 @@ 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())