Log non-hun animations on hun views
Bug: 198359689 Test: no clear path Change-Id: I408d468a4bae5c334977ea17ec8cfa6f139df665
This commit is contained in:
@@ -343,9 +343,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 ==
|
||||
@@ -357,6 +359,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);
|
||||
|
||||
@@ -398,9 +403,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)) {
|
||||
@@ -430,8 +444,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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user