summaryrefslogtreecommitdiff
path: root/packages/CarSystemUI/src
diff options
context:
space:
mode:
authorHeemin Seog <hseog@google.com>2020-09-23 14:19:25 -0700
committerHeemin Seog <hseog@google.com>2020-09-23 14:19:25 -0700
commitfbec38f2ae804519be36b146c4c5a3772ad0327a (patch)
tree409c120f00dfaf377b527ef24af53a319cd1f2ed /packages/CarSystemUI/src
parente530998c9edf8210dc8078cd9100a8a904ac556f (diff)
Ensure the notif panel is inflated
Bug: 168823233 Test: manual Change-Id: I1ed35a0c240acb2fa06241f34aa9c7a549dc360b
Diffstat (limited to 'packages/CarSystemUI/src')
-rw-r--r--packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java6
1 files changed, 6 insertions, 0 deletions
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 65de46d36dd0..fd804c71c9d0 100644
--- a/packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java
+++ b/packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java
@@ -192,6 +192,12 @@ public class NotificationPanelViewController extends OverlayPanelViewController
boolean isKeyboardVisible = (vis & InputMethodService.IME_VISIBLE) != 0;
int bottomMargin = isKeyboardVisible ? 0 : mNavBarHeight;
ViewGroup container = (ViewGroup) getLayout();
+ if (container == null) {
+ // Notification panel hasn't been inflated before. We shouldn't try to update the layout
+ // params.
+ return;
+ }
+
ViewGroup.MarginLayoutParams params =
(ViewGroup.MarginLayoutParams) container.getLayoutParams();
params.setMargins(params.leftMargin, params.topMargin, params.rightMargin, bottomMargin);