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

Commit c753a186 authored by Steven Ross's avatar Steven Ross
Browse files

Not showing facelock when plugging/unplugging fixes 5438524

This will close down or prevent the start of FaceUnlock if
the device is plugged in or unplugged,
unless FaceUnlock is currently active.

Change-Id: I216831964472da47fb24644070d1717dffe1b7f7
parent ac62c901
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -150,6 +150,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
    //True if a dialog is currently displaying on top of this window
    //Unlike other overlays, this does not close with a power button cycle
    private boolean mHasDialog = false;
    //True if this device is currently plugged in
    private boolean mPluggedIn;


    /**
@@ -312,6 +314,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
        mLockPatternUtils = lockPatternUtils;
        mWindowController = controller;
        mHasOverlay = false;
        mPluggedIn = mUpdateMonitor.isDevicePluggedIn();

        mUpdateMonitor.registerInfoCallback(this);

@@ -717,10 +720,19 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
        post(mRecreateRunnable);
    }

    //Ignore these events; they are implemented only because they come from the same interface
    /** When somebody plugs in or unplugs the device, we don't want to display faceunlock */
    @Override
    public void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn, int batteryLevel)
    {}
    public void onRefreshBatteryInfo(boolean showBatteryInfo, boolean pluggedIn, int batteryLevel) {
        mHasOverlay |= mPluggedIn != pluggedIn;
        mPluggedIn = pluggedIn;
        //If it's already running, don't close it down: the unplug didn't start it
        if (!mFaceLockServiceRunning) {
            stopAndUnbindFromFaceLock();
            hideFaceLockArea();
        }
    }

    //Ignore these events; they are implemented only because they come from the same interface
    @Override
    public void onTimeChanged() {}
    @Override