diff options
author | 2019-12-17 03:21:16 +0000 | |
---|---|---|
committer | 2019-12-17 03:21:16 +0000 | |
commit | ee9c25e7ea89b6d883fb4d1f61dc249cc0b054b4 (patch) | |
tree | 64001223b4a65e4e10701c9a556b5bb618803523 | |
parent | 7fd29af1f02d4ce910885755717af09bbd567813 (diff) | |
parent | fea5c4af0ef08a1c56b7334813a3fcb325208598 (diff) |
Merge "DO NOT MERGE - Fix StatusBar.updateIsKeyguard() when suspending to RAM." into qt-qpr1-dev
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 91cf89ce1b05..a589ca588fa7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -3055,10 +3055,21 @@ public class StatusBar extends SystemUI implements DemoMode, return mState == StatusBarState.FULLSCREEN_USER_SWITCHER; } + private boolean isAutomotive() { + return mContext != null + && mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE); + } + private boolean updateIsKeyguard() { boolean wakeAndUnlocking = mBiometricUnlockController.getMode() == BiometricUnlockController.MODE_WAKE_AND_UNLOCK; + if (mScreenLifecycle == null && isAutomotive()) { + // TODO(b/146144370): workaround to avoid NPE when device goes into STR (Suspend to RAM) + Log.w(TAG, "updateIsKeyguard(): mScreenLifeCycle not set yet"); + mScreenLifecycle = Dependency.get(ScreenLifecycle.class); + } + // For dozing, keyguard needs to be shown whenever the device is non-interactive. Otherwise // there's no surface we can show to the user. Note that the device goes fully interactive // late in the transition, so we also allow the device to start dozing once the screen has |