From 0be1b45d64d250965504f1c128c80e59945bf88b Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Fri, 7 Jan 2022 14:21:19 -0800 Subject: [PATCH] Fix possible NPE Test: manual - make sure dot works normally / no regression Bug: 213027822 Change-Id: I819f73cb8c7d613796c3d3bb4b55b80b337c6126 --- .../src/com/android/wm/shell/bubbles/BubbleFlyoutView.java | 3 ++- .../src/com/android/wm/shell/bubbles/BubbleStackView.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java index 9374da4c4faba..f878a46d26f24 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java @@ -231,8 +231,9 @@ public class BubbleFlyoutView extends FrameLayout { * Fade animation for consecutive flyouts. */ void animateUpdate(Bubble.FlyoutMessage flyoutMessage, PointF stackPos, - boolean hideDot, Runnable onHide) { + boolean hideDot, float[] dotCenter, Runnable onHide) { mOnHide = onHide; + mDotCenter = dotCenter; final Runnable afterFadeOut = () -> { updateFlyoutMessage(flyoutMessage); // Wait for TextViews to layout with updated height. diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index b40021ec82a77..620c291b357b1 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -2494,6 +2494,7 @@ public class BubbleStackView extends FrameLayout if (mFlyout.getVisibility() == View.VISIBLE) { mFlyout.animateUpdate(bubble.getFlyoutMessage(), mStackAnimationController.getStackPosition(), !bubble.showDot(), + bubble.getIconView().getDotCenter(), mAfterFlyoutHidden /* onHide */); } else { mFlyout.setVisibility(INVISIBLE);