From 1aa629cd58fb48335e71dbf88ffa6fb62a4dcbe5 Mon Sep 17 00:00:00 2001 From: jovanak Date: Wed, 29 Aug 2018 09:58:58 -0700 Subject: [PATCH] Adding null check for the case when user switcher is disabled (for example in retail mode). Fixes: 113269334 Test: Observed SysUI crash in retail mode before, and SysUI proper initialization after the fix. Change-Id: I301eac98b4e8c46fd374fa69755e4d177587f679 --- .../src/com/android/systemui/statusbar/car/CarStatusBar.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java index 2450e448c4f72..24665eac76a78 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java @@ -491,6 +491,10 @@ public class CarStatusBar extends StatusBar implements @Override public void onStateChanged(int newState) { super.onStateChanged(newState); + if (mFullscreenUserSwitcher == null) { + return; // Not using the full screen user switcher. + } + if (newState == StatusBarState.FULLSCREEN_USER_SWITCHER) { if (!mFullscreenUserSwitcher.isVisible()) { // Current execution path continues to set state after this, thus we deffer the