OSDN Git Service

Fix crash.
authorJoel Galenson <jgalenson@google.com>
Thu, 18 Apr 2019 20:30:45 +0000 (13:30 -0700)
committerMady Mellor <madym@google.com>
Thu, 18 Apr 2019 20:34:45 +0000 (20:34 +0000)
Fix a SysUI NullPointerException.

Bug: 130821357
Test: atest BubbleControllerTest KeyButtonViewTest
Change-Id: I56923480bd2c3441cd9328e52b4b5bd35d676dc2

packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java

index b755f28..9d9c88f 100644 (file)
@@ -542,6 +542,9 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
      * status bar, otherwise returns {@link Display#INVALID_DISPLAY}.
      */
     public int getExpandedDisplayId(Context context) {
+        if (mStackView == null) {
+            return INVALID_DISPLAY;
+        }
         boolean defaultDisplay = context.getDisplay() != null
                 && context.getDisplay().getDisplayId() == DEFAULT_DISPLAY;
         Bubble b = mStackView.getExpandedBubble();