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

Commit f1373c50 authored by Steven Ross's avatar Steven Ross Committed by Android Git Automerger
Browse files

am 60ffc8a9: am 93aa70c6: Merge "Only poke the wakelock for FUL if the screen...

am 60ffc8a9: am 93aa70c6: Merge "Only poke the wakelock for FUL if the screen is on fixes 7222901" into jb-mr1-dev

* commit '60ffc8a9':
  Only poke the wakelock for FUL if the screen is on fixes 7222901
parents 593b3d34 60ffc8a9
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.IBinder;
import android.os.Looper;
import android.os.Looper;
import android.os.Message;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.RemoteException;
import android.util.Log;
import android.util.Log;
import android.view.View;
import android.view.View;
@@ -128,6 +129,8 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
     */
     */
    public void hide() {
    public void hide() {
        if (DEBUG) Log.d(TAG, "hide()");
        if (DEBUG) Log.d(TAG, "hide()");
        // Removes any wakelock messages to make sure they don't cause the screen to turn back on.
        mHandler.removeMessages(MSG_POKE_WAKELOCK);
        // Remove messages to prevent a delayed show message from undo-ing the hide
        // Remove messages to prevent a delayed show message from undo-ing the hide
        removeDisplayMessages();
        removeDisplayMessages();
        mHandler.sendEmptyMessage(MSG_HIDE_FACE_UNLOCK_VIEW);
        mHandler.sendEmptyMessage(MSG_HIDE_FACE_UNLOCK_VIEW);
@@ -384,11 +387,15 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
    }
    }


    /**
    /**
     * Pokes the wakelock to keep the screen alive and active for a specific amount of time.
     * If the screen is on, pokes the wakelock to keep the screen alive and active for a specific
     * amount of time.
     */
     */
    void handlePokeWakelock(int millis) {
    void handlePokeWakelock(int millis) {
      PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
      if (powerManager.isScreenOn()) {
        mKeyguardScreenCallback.userActivity(millis);
        mKeyguardScreenCallback.userActivity(millis);
      }
      }
    }


    /**
    /**
     * Removes show and hide messages from the message queue.  Called to prevent delayed show/hide
     * Removes show and hide messages from the message queue.  Called to prevent delayed show/hide