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

Commit 44685511 authored by Tiger Huang's avatar Tiger Huang Committed by Automerger Merge Worker
Browse files

Merge "Don't set animation pending when gaining fake control" into tm-dev am:...

Merge "Don't set animation pending when gaining fake control" into tm-dev am: c15af2cb am: 7da22313

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17822750



Change-Id: Id05e430c42bddb952307e8f6ba0833fdfacdfcce
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 82c0b65c 7da22313
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ import static android.view.InsetsSourceConsumerProto.IS_REQUESTED_VISIBLE;
import static android.view.InsetsSourceConsumerProto.PENDING_FRAME;
import static android.view.InsetsSourceConsumerProto.PENDING_FRAME;
import static android.view.InsetsSourceConsumerProto.PENDING_VISIBLE_FRAME;
import static android.view.InsetsSourceConsumerProto.PENDING_VISIBLE_FRAME;
import static android.view.InsetsSourceConsumerProto.SOURCE_CONTROL;
import static android.view.InsetsSourceConsumerProto.SOURCE_CONTROL;
import static android.view.InsetsSourceControl.INVALID_HINTS;
import static android.view.InsetsState.ITYPE_IME;
import static android.view.InsetsState.ITYPE_IME;
import static android.view.InsetsState.getDefaultVisibility;
import static android.view.InsetsState.getDefaultVisibility;
import static android.view.InsetsState.toPublicType;
import static android.view.InsetsState.toPublicType;
@@ -163,8 +164,10 @@ public class InsetsSourceConsumer {
            // We are gaining control, and need to run an animation since previous state
            // We are gaining control, and need to run an animation since previous state
            // didn't match
            // didn't match
            final boolean requestedVisible = isRequestedVisibleAwaitingControl();
            final boolean requestedVisible = isRequestedVisibleAwaitingControl();
            final boolean needAnimation = requestedVisible != mState.getSource(mType).isVisible();
            final boolean fakeControl = INVALID_HINTS.equals(control.getInsetsHint());
            if (control.getLeash() != null && (needAnimation || mIsAnimationPending)) {
            final boolean needsAnimation = requestedVisible != mState.getSource(mType).isVisible()
                    && !fakeControl;
            if (control.getLeash() != null && (needsAnimation || mIsAnimationPending)) {
                if (DEBUG) Log.d(TAG, String.format("Gaining control in %s, requestedVisible: %b",
                if (DEBUG) Log.d(TAG, String.format("Gaining control in %s, requestedVisible: %b",
                        mController.getHost().getRootViewTitle(), requestedVisible));
                        mController.getHost().getRootViewTitle(), requestedVisible));
                if (requestedVisible) {
                if (requestedVisible) {
@@ -174,7 +177,7 @@ public class InsetsSourceConsumer {
                }
                }
                mIsAnimationPending = false;
                mIsAnimationPending = false;
            } else {
            } else {
                if (needAnimation) {
                if (needsAnimation) {
                    // We need animation but we haven't had a leash yet. Set this flag that when we
                    // We need animation but we haven't had a leash yet. Set this flag that when we
                    // get the leash we can play the deferred animation.
                    // get the leash we can play the deferred animation.
                    mIsAnimationPending = true;
                    mIsAnimationPending = true;
+2 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,8 @@ import java.util.function.Consumer;
 */
 */
public class InsetsSourceControl implements Parcelable {
public class InsetsSourceControl implements Parcelable {


    public static final Insets INVALID_HINTS = Insets.of(-1, -1, -1, -1);

    private final @InternalInsetsType int mType;
    private final @InternalInsetsType int mType;
    private final @Nullable SurfaceControl mLeash;
    private final @Nullable SurfaceControl mLeash;
    private final Point mSurfacePosition;
    private final Point mSurfacePosition;
+1 −1
Original line number Original line Diff line number Diff line
@@ -123,7 +123,7 @@ abstract class InsetsSourceProvider {
        mDisplayContent = displayContent;
        mDisplayContent = displayContent;
        mStateController = stateController;
        mStateController = stateController;
        mFakeControl = new InsetsSourceControl(
        mFakeControl = new InsetsSourceControl(
                source.getType(), null /* leash */, new Point(), Insets.NONE);
                source.getType(), null /* leash */, new Point(), InsetsSourceControl.INVALID_HINTS);
        mControllable = InsetsPolicy.isInsetsTypeControllable(source.getType());
        mControllable = InsetsPolicy.isInsetsTypeControllable(source.getType());
    }
    }