Loading policy/src/com/android/internal/policy/impl/BiometricSensorUnlock.java +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ interface BiometricSensorUnlock { // Show the interface, but don't start the unlock procedure. The interface should disappear // after the specified timeout. If the timeout is 0, the interface shows until another event, // such as calling hide(), causes it to disappear. // Called on the UI Thread public void show(long timeoutMilliseconds); // Hide the interface, if any, exposing the lockscreen. Loading @@ -39,6 +40,7 @@ interface BiometricSensorUnlock { // Start the unlock procedure. Returns ‘false’ if it can’t be started or if the backup should // be used. // Called on the UI thread. public boolean start(boolean suppressBiometricUnlock); // Provide a view to work within. Loading policy/src/com/android/internal/policy/impl/FaceUnlock.java +22 −13 Original line number Diff line number Diff line Loading @@ -88,7 +88,9 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { } // Shows the FaceLock area for a period of time // Called on the UI thread public void show(long timeoutMillis) { removeAreaDisplayMessages(); showArea(); if (timeoutMillis > 0) mHandler.sendEmptyMessageDelayed(MSG_HIDE_AREA_VIEW, timeoutMillis); Loading Loading @@ -134,6 +136,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { /** * When screen is turned on and focused, need to bind to FaceLock service if we are using * FaceLock, but only if we're not dealing with a call * Called on the UI thread */ public boolean start(boolean suppressBiometricUnlock) { final boolean tooManyFaceUnlockTries = mUpdateMonitor.getMaxFaceUnlockAttemptsReached(); Loading @@ -146,12 +149,13 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { && !suppressBiometricUnlock && !tooManyFaceUnlockTries && !backupIsTimedOut) { bind(); // Show FaceLock area, but only for a little bit so lockpattern will become visible if // FaceLock fails to start or crashes // This must show before bind to guarantee that Face Unlock has a place to display show(VIEW_AREA_SERVICE_TIMEOUT); bind(); // When switching between portrait and landscape view while FaceLock is running, the // screen will eventually go dark unless we poke the wakelock when FaceLock is // restarted Loading @@ -170,6 +174,8 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { mAreaView = topView.findViewById(R.id.faceLockAreaView); if (mAreaView == null) { Log.e(TAG, "Layout does not have areaView and FaceLock is enabled"); } else { show(0); } } else { mAreaView = null; // Set to null if not using FaceLock Loading @@ -192,6 +198,14 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { return DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK; } // Shows the FaceLock area // Called on the UI thread private void showArea() { if (mAreaView != null) { mAreaView.setVisibility(View.VISIBLE); } } // Handles covering or exposing FaceLock area on the client side when FaceLock starts or stops // This needs to be done in a handler because the call could be coming from a callback from the // FaceLock service that is in a thread that can't modify the UI Loading @@ -199,9 +213,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { public boolean handleMessage(Message msg) { switch (msg.what) { case MSG_SHOW_AREA_VIEW: if (mAreaView != null) { mAreaView.setVisibility(View.VISIBLE); } showArea(); break; case MSG_HIDE_AREA_VIEW: if (mAreaView != null) { Loading @@ -221,13 +233,6 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { mHandler.removeMessages(MSG_HIDE_AREA_VIEW); } // Shows the FaceLock area immediately private void showArea() { // Remove messages to prevent a delayed hide message from undo-ing the show removeAreaDisplayMessages(); mHandler.sendEmptyMessage(MSG_SHOW_AREA_VIEW); } // Binds to FaceLock service. This call does not tell it to start, but it causes the service // to call the onServiceConnected callback, which then starts FaceLock. private void bind() { Loading Loading @@ -329,7 +334,11 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { @Override public void unlock() { if (DEBUG) Log.d(TAG, "FaceLock unlock()"); showArea(); // Keep fallback covered // Keep fallback covered removeAreaDisplayMessages(); mHandler.sendEmptyMessage(MSG_SHOW_AREA_VIEW); stop(); mKeyguardScreenCallback.keyguardDone(true); Loading policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +1 −7 Original line number Diff line number Diff line Loading @@ -613,13 +613,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase { ((KeyguardScreen) mUnlockScreen).onResume(); } if (mBiometricUnlock.installedAndSelected() && !mSupressBiometricUnlock) { // Note that show() gets called before the screen turns off to set it up for next time // it is turned on. We don't want to set a timeout on the biometric unlock here because // it may be gone by the time the screen is turned on again. We set the timeout when // the screen turns on instead. mBiometricUnlock.show(0); } else { if (!mBiometricUnlock.installedAndSelected() || mSupressBiometricUnlock) { mBiometricUnlock.hide(); } } Loading Loading
policy/src/com/android/internal/policy/impl/BiometricSensorUnlock.java +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ interface BiometricSensorUnlock { // Show the interface, but don't start the unlock procedure. The interface should disappear // after the specified timeout. If the timeout is 0, the interface shows until another event, // such as calling hide(), causes it to disappear. // Called on the UI Thread public void show(long timeoutMilliseconds); // Hide the interface, if any, exposing the lockscreen. Loading @@ -39,6 +40,7 @@ interface BiometricSensorUnlock { // Start the unlock procedure. Returns ‘false’ if it can’t be started or if the backup should // be used. // Called on the UI thread. public boolean start(boolean suppressBiometricUnlock); // Provide a view to work within. Loading
policy/src/com/android/internal/policy/impl/FaceUnlock.java +22 −13 Original line number Diff line number Diff line Loading @@ -88,7 +88,9 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { } // Shows the FaceLock area for a period of time // Called on the UI thread public void show(long timeoutMillis) { removeAreaDisplayMessages(); showArea(); if (timeoutMillis > 0) mHandler.sendEmptyMessageDelayed(MSG_HIDE_AREA_VIEW, timeoutMillis); Loading Loading @@ -134,6 +136,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { /** * When screen is turned on and focused, need to bind to FaceLock service if we are using * FaceLock, but only if we're not dealing with a call * Called on the UI thread */ public boolean start(boolean suppressBiometricUnlock) { final boolean tooManyFaceUnlockTries = mUpdateMonitor.getMaxFaceUnlockAttemptsReached(); Loading @@ -146,12 +149,13 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { && !suppressBiometricUnlock && !tooManyFaceUnlockTries && !backupIsTimedOut) { bind(); // Show FaceLock area, but only for a little bit so lockpattern will become visible if // FaceLock fails to start or crashes // This must show before bind to guarantee that Face Unlock has a place to display show(VIEW_AREA_SERVICE_TIMEOUT); bind(); // When switching between portrait and landscape view while FaceLock is running, the // screen will eventually go dark unless we poke the wakelock when FaceLock is // restarted Loading @@ -170,6 +174,8 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { mAreaView = topView.findViewById(R.id.faceLockAreaView); if (mAreaView == null) { Log.e(TAG, "Layout does not have areaView and FaceLock is enabled"); } else { show(0); } } else { mAreaView = null; // Set to null if not using FaceLock Loading @@ -192,6 +198,14 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { return DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK; } // Shows the FaceLock area // Called on the UI thread private void showArea() { if (mAreaView != null) { mAreaView.setVisibility(View.VISIBLE); } } // Handles covering or exposing FaceLock area on the client side when FaceLock starts or stops // This needs to be done in a handler because the call could be coming from a callback from the // FaceLock service that is in a thread that can't modify the UI Loading @@ -199,9 +213,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { public boolean handleMessage(Message msg) { switch (msg.what) { case MSG_SHOW_AREA_VIEW: if (mAreaView != null) { mAreaView.setVisibility(View.VISIBLE); } showArea(); break; case MSG_HIDE_AREA_VIEW: if (mAreaView != null) { Loading @@ -221,13 +233,6 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { mHandler.removeMessages(MSG_HIDE_AREA_VIEW); } // Shows the FaceLock area immediately private void showArea() { // Remove messages to prevent a delayed hide message from undo-ing the show removeAreaDisplayMessages(); mHandler.sendEmptyMessage(MSG_SHOW_AREA_VIEW); } // Binds to FaceLock service. This call does not tell it to start, but it causes the service // to call the onServiceConnected callback, which then starts FaceLock. private void bind() { Loading Loading @@ -329,7 +334,11 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { @Override public void unlock() { if (DEBUG) Log.d(TAG, "FaceLock unlock()"); showArea(); // Keep fallback covered // Keep fallback covered removeAreaDisplayMessages(); mHandler.sendEmptyMessage(MSG_SHOW_AREA_VIEW); stop(); mKeyguardScreenCallback.keyguardDone(true); Loading
policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +1 −7 Original line number Diff line number Diff line Loading @@ -613,13 +613,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase { ((KeyguardScreen) mUnlockScreen).onResume(); } if (mBiometricUnlock.installedAndSelected() && !mSupressBiometricUnlock) { // Note that show() gets called before the screen turns off to set it up for next time // it is turned on. We don't want to set a timeout on the biometric unlock here because // it may be gone by the time the screen is turned on again. We set the timeout when // the screen turns on instead. mBiometricUnlock.show(0); } else { if (!mBiometricUnlock.installedAndSelected() || mSupressBiometricUnlock) { mBiometricUnlock.hide(); } } Loading