From b700beab665f5d2cc8e6414bb2e9d5083730be93 Mon Sep 17 00:00:00 2001 From: kwaky Date: Mon, 8 Mar 2021 10:05:57 -0800 Subject: [PATCH] DO NOT MERGE Do not reinflate the layout if it has not been already inflated. This fixes the NPE caused when reinflate method is called before the layout is inflated. Bug: 180534861 Test: Manual Change-Id: Ia3fb6867e55c63a5fe7c17df1c3f86d048b4d1a8 --- .../car/notification/NotificationPanelViewController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java b/packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java index b83fcf4bf8b5c..7b81974e8ec1e 100644 --- a/packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java +++ b/packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java @@ -240,6 +240,9 @@ public class NotificationPanelViewController extends OverlayPanelViewController /** Reinflates the view. */ public void reinflate() { + // Do not reinflate the view if it has not been inflated at all. + if (!isInflated()) return; + ViewGroup container = (ViewGroup) getLayout(); container.removeView(mNotificationView);