From d0382078ba333a0d7f7891e33711002d15e5e51d Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Thu, 15 Sep 2022 11:50:46 -0700 Subject: [PATCH] Fix NPE where BubbleExpandedView is null when we want to show manage education view mManageEduView.show() requires a non-null BubbleExpandedView but getExpandedView() is declared as nullable. Bug: 246824356 Bug: 246902054 Test: manual Change-Id: I19d733ced80d121c7dab40936721c9cc8be1a12e --- .../Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 aeaf6eda98092..be100bb1dd343 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 @@ -1270,7 +1270,7 @@ public class BubbleStackView extends FrameLayout } final boolean seen = getPrefBoolean(ManageEducationViewKt.PREF_MANAGED_EDUCATION); final boolean shouldShow = (!seen || BubbleDebugConfig.forceShowUserEducation(mContext)) - && mExpandedBubble != null; + && mExpandedBubble != null && mExpandedBubble.getExpandedView() != null; if (BubbleDebugConfig.DEBUG_USER_EDUCATION) { Log.d(TAG, "Show manage edu: " + shouldShow); }