From 04cdf3a7d4077046d6a9e45d5298ab8b0aeda12c Mon Sep 17 00:00:00 2001 From: Alex Stetson Date: Wed, 17 Mar 2021 09:26:13 -0700 Subject: [PATCH] DO NOT MERGE Inflate NotificationPanel on instantiation If the NotificationPanel is not inflated, the proper listeners are not setup and certain behavior will be broken until the panel is opened for the first time. Bug: 182531816 Test: manual Change-Id: If55156b963c0a83ff644524dea0106708f1635cc --- .../car/notification/NotificationPanelViewController.java | 4 ++++ 1 file changed, 4 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 d7d7f53eb46d3..3d79b06ca3252 100644 --- a/packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java +++ b/packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java @@ -166,6 +166,10 @@ public class NotificationPanelViewController extends OverlayPanelViewController mEnableHeadsUpNotificationWhenNotificationShadeOpen = mResources.getBoolean( com.android.car.notification.R.bool .config_enableHeadsUpNotificationWhenNotificationShadeOpen); + + // Inflate view on instantiation to properly initialize listeners even if panel has + // not been opened. + getOverlayViewGlobalStateController().inflateView(this); } // CommandQueue.Callbacks