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

Commit 484a35da authored by Jay Aliomer's avatar Jay Aliomer Committed by Android (Google) Code Review
Browse files

Merge "Log non-hun animations on hun views"

parents c51b3b73 6410e6ea
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -344,9 +344,11 @@ public class StackStateAnimator {
        for (NotificationStackScrollLayout.AnimationEvent event : animationEvents) {
            final ExpandableView changingView = (ExpandableView) event.mChangingView;
            boolean loggable = false;
            boolean isHeadsUp = false;
            String key = null;
            if (changingView instanceof ExpandableNotificationRow && mLogger != null) {
                loggable = true;
                isHeadsUp = ((ExpandableNotificationRow) changingView).isHeadsUp();
                key = ((ExpandableNotificationRow) changingView).getEntry().getKey();
            }
            if (event.animationType ==
@@ -358,6 +360,9 @@ public class StackStateAnimator {
                    // The position for this child was never generated, let's continue.
                    continue;
                }
                if (loggable && isHeadsUp) {
                    mLogger.logHUNViewAppearingWithAddEvent(key);
                }
                viewState.applyToView(changingView);
                mNewAddChildren.add(changingView);

@@ -399,9 +404,18 @@ public class StackStateAnimator {
                    translationDirection = Math.max(Math.min(translationDirection, 1.0f),-1.0f);

                }
                Runnable postAnimation = changingView::removeFromTransientContainer;
                if (loggable && isHeadsUp) {
                    mLogger.logHUNViewDisappearingWithRemoveEvent(key);
                    String finalKey = key;
                    postAnimation = () -> {
                        mLogger.disappearAnimationEnded(finalKey);
                        changingView.removeFromTransientContainer();
                    };
                }
                changingView.performRemoveAnimation(ANIMATION_DURATION_APPEAR_DISAPPEAR,
                        0 /* delay */, translationDirection, false /* isHeadsUpAppear */,
                        0, changingView::removeFromTransientContainer, null);
                        0, postAnimation, null);
            } else if (event.animationType ==
                NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_REMOVE_SWIPED_OUT) {
                if (mHostLayout.isFullySwipedOut(changingView)) {
@@ -431,8 +445,7 @@ public class StackStateAnimator {
                // this only captures HEADS_UP_APPEAR animations, but HUNs can appear with normal
                // ADD animations, which would not be logged here.
                if (loggable) {
                    mLogger.logHUNViewAppearing(
                            ((ExpandableNotificationRow) changingView).getEntry().getKey());
                    mLogger.logHUNViewAppearing(key);
                }

                mTmpState.applyToView(changingView);
+16 −0
Original line number Diff line number Diff line
@@ -24,6 +24,22 @@ class StackStateLogger @Inject constructor(
        })
    }

    fun logHUNViewDisappearingWithRemoveEvent(key: String) {
        buffer.log(TAG, LogLevel.ERROR, {
            str1 = key
        }, {
            "Heads up view disappearing $str1 for ANIMATION_TYPE_REMOVE"
        })
    }

    fun logHUNViewAppearingWithAddEvent(key: String) {
        buffer.log(TAG, LogLevel.ERROR, {
            str1 = key
        }, {
            "Heads up view disappearing $str1 for ANIMATION_TYPE_ADD"
        })
    }

    fun disappearAnimationEnded(key: String) {
        buffer.log(TAG, LogLevel.INFO, {
            str1 = key