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

Commit 9d9107d2 authored by Jason Monk's avatar Jason Monk Committed by The Android Automerger
Browse files

Don't start the keyguard until boot is done.

Create the KeyguardServiceDelegate but don't bind until boot is done.
Until the keyguard is bound, the delegate will assume it should be
in a secure state.

Bug: 17464800
Change-Id: I91650d1e3e3ea993168855bc3444b905aac9aac3
parent da8ccc7c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5268,6 +5268,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    @Override
    public void systemBooted() {
        if (mKeyguardDelegate != null) {
            mKeyguardDelegate.bindService(mContext);
            mKeyguardDelegate.onBootCompleted();
        }
        synchronized (mLock) {
+4 −2
Original line number Diff line number Diff line
@@ -102,9 +102,12 @@ public class KeyguardServiceDelegate {
    };

    public KeyguardServiceDelegate(Context context, LockPatternUtils lockPatternUtils) {
        mScrim = createScrim(context);
    }

    public void bindService(Context context) {
        Intent intent = new Intent();
        intent.setClassName(KEYGUARD_PACKAGE, KEYGUARD_CLASS);
        mScrim = createScrim(context);
        if (!context.bindServiceAsUser(intent, mKeyguardConnection,
                Context.BIND_AUTO_CREATE, UserHandle.OWNER)) {
            if (DEBUG) Log.v(TAG, "*** Keyguard: can't bind to " + KEYGUARD_CLASS);
@@ -250,7 +253,6 @@ public class KeyguardServiceDelegate {
        if (mKeyguardService != null) {
            mKeyguardService.onSystemReady();
        } else {
            if (DEBUG) Log.v(TAG, "onSystemReady() called before keyguard service was ready");
            mKeyguardState.systemIsReady = true;
        }
    }