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

Commit 15ea55a6 authored by Brian Colonna's avatar Brian Colonna
Browse files

Moved FaceLock bind/unbind calls inside of null check

- I am not sure under what circumstances mKeyguardView can be null in
  onScreenTurnedOn() and I never saw this behavior before the commit,
  but it can happen and prevent the device from booting

- Patched to fix line length

Change-Id: I39efa5c1d68158af5c108430036fe7c715ef855b
parent 8b83a729
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -197,22 +197,22 @@ public class KeyguardViewManager implements KeyguardWindowController {
        mScreenOn = false;
        if (mKeyguardView != null) {
            mKeyguardView.onScreenTurnedOff();
        }

        // When screen is turned off, need to unbind from FaceLock service if we are using FaceLock
            // When screen is turned off, need to unbind from FaceLock service if using FaceLock
            mKeyguardView.stopAndUnbindFromFaceLock();
        }
    }

    public synchronized void onScreenTurnedOn() {
        if (DEBUG) Log.d(TAG, "onScreenTurnedOn()");
        mScreenOn = true;
        if (mKeyguardView != null) {
            mKeyguardView.onScreenTurnedOn();
        }

            // When screen is turned on, need to bind to FaceLock service if we are using FaceLock
            mKeyguardView.bindToFaceLock();
        }
    }

    public synchronized void verifyUnlock() {
        if (DEBUG) Log.d(TAG, "verifyUnlock()");
@@ -248,9 +248,11 @@ public class KeyguardViewManager implements KeyguardWindowController {
    public synchronized void hide() {
        if (DEBUG) Log.d(TAG, "hide()");

        if (mKeyguardView != null) {
            // When view is hidden, need to unbind from FaceLock service if we are using FaceLock
            // e.g., when device becomes unlocked
            mKeyguardView.stopAndUnbindFromFaceLock();
        }

        if (mKeyguardHost != null) {
            mKeyguardHost.setVisibility(View.GONE);