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

Commit 2bc75f08 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Fix crash from USER_PRESENT broadcast in sysui" into lmp-dev

parents 72cc3702 cf5a9530
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -170,6 +170,8 @@ public class KeyguardViewMediator extends SystemUI {
    private boolean mSwitchingUser;

    private boolean mSystemReady;
    private boolean mBootCompleted;
    private boolean mBootSendUserPresent;

    // Whether the next call to playSounds() should be skipped.  Defaults to
    // true because the first lock (on boot) should be silent.
@@ -1145,8 +1147,14 @@ public class KeyguardViewMediator extends SystemUI {
    }

    private void sendUserPresentBroadcast() {
        synchronized (this) {
            if (mBootCompleted) {
                final UserHandle currentUser = new UserHandle(mLockPatternUtils.getCurrentUser());
                mContext.sendBroadcastAsUser(USER_PRESENT_INTENT, currentUser);
            } else {
                mBootSendUserPresent = true;
            }
        }
    }

    /**
@@ -1406,6 +1414,12 @@ public class KeyguardViewMediator extends SystemUI {

    public void onBootCompleted() {
        mUpdateMonitor.dispatchBootCompleted();
        synchronized (this) {
            mBootCompleted = true;
            if (mBootSendUserPresent) {
                sendUserPresentBroadcast();
            }
        }
    }

    public StatusBarKeyguardViewManager registerStatusBar(PhoneStatusBar phoneStatusBar,