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

Commit e8f321e7 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Update callbacks when initializing to initial state

This fixes a bug where activity manager was not informed about the
lockscreen state if Keyguard was disabled and SystemUI crashed, so
we just displayed a black screen.

Test:
- Set no lockscreen
- Crash SystemUI

Change-Id: I93b8ed74dd12af6903ffdb05b59c78f2f12febb4
parent 8d5a6e7c
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -645,9 +645,7 @@ public class KeyguardViewMediator extends SystemUI {

        // Assume keyguard is showing (unless it's disabled) until we know for sure...
        setShowingLocked(!shouldWaitForProvisioning() && !mLockPatternUtils.isLockScreenDisabled(
                KeyguardUpdateMonitor.getCurrentUser()));
        updateInputRestrictedLocked();
        mTrustManager.reportKeyguardShowingChanged();
                KeyguardUpdateMonitor.getCurrentUser()), true /* forceCallbacks */);

        mStatusBarKeyguardViewManager =
                SystemUIFactory.getInstance().createStatusBarKeyguardViewManager(mContext,
@@ -1980,7 +1978,11 @@ public class KeyguardViewMediator extends SystemUI {
    }

    private void setShowingLocked(boolean showing) {
        if (showing != mShowing) {
        setShowingLocked(showing, false /* forceCallbacks */);
    }

    private void setShowingLocked(boolean showing, boolean forceCallbacks) {
        if (showing != mShowing || forceCallbacks) {
            mShowing = showing;
            int size = mKeyguardStateCallbacks.size();
            for (int i = size - 1; i >= 0; i--) {