Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e556382b authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

DO NOT MERGE - Fix StatusBar.updateIsKeyguard() when suspending to RAM. am: fea5c4af

Change-Id: I82b59001909d955b7cd8c89d770f49ce213efb9e
parents b53b1f67 fea5c4af
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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