From 5ae394be12fc07088145128ca9e40fd77358f488 Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Mon, 19 Oct 2020 17:57:55 -0500 Subject: [PATCH] Protect against NPE thrown by flaky integration test Bug: 150344903 Test: atest PlatformScenarioTests:android.platform.test.scenario.sysui.bubble.Overflow -s [device] --rerun-until-failure 3 Change-Id: I603ee92a4bc83017d877bde721d1a2f4ccf15fa2 --- .../src/com/android/systemui/bubbles/BubbleStackView.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index 431719f98ad93..4b6a1df454d9a 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -2216,9 +2216,10 @@ public class BubbleStackView extends FrameLayout } // Stop suppressing the dot now that the flyout has morphed into the dot. - bubble.getIconView().removeDotSuppressionFlag( - BadgedImageView.SuppressionFlag.FLYOUT_VISIBLE); - + if (bubble.getIconView() != null) { + bubble.getIconView().removeDotSuppressionFlag( + BadgedImageView.SuppressionFlag.FLYOUT_VISIBLE); + } // Hide the stack after a delay, if needed. updateTemporarilyInvisibleAnimation(false /* hideImmediately */); };