Skip to content

Commit 9986b2d

Browse files
Brian ColonnaAndroid (Google) Code Review
authored andcommitted
Merge "Suppressing FUL after going to backup fixes b/7449820" into jb-mr1-lockscreen-dev
2 parents 45942ca + 667b5d5 commit 9986b2d

File tree

3 files changed

+26
-43
lines changed

3 files changed

+26
-43
lines changed

core/java/com/android/internal/policy/IFaceLockCallback.aidl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ oneway interface IFaceLockCallback {
2222
void unlock();
2323
void cancel();
2424
void reportFailedAttempt();
25-
void exposeFallback();
2625
void pokeWakelock(int millis);
2726
}

policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
5757
private final int MSG_UNLOCK = 2;
5858
private final int MSG_CANCEL = 3;
5959
private final int MSG_REPORT_FAILED_ATTEMPT = 4;
60-
private final int MSG_EXPOSE_FALLBACK = 5;
61-
private final int MSG_POKE_WAKELOCK = 6;
60+
private final int MSG_POKE_WAKELOCK = 5;
6261

6362
// TODO: This was added for the purpose of adhering to what the biometric interface expects
6463
// the isRunning() function to return. However, it is probably not necessary to have both
@@ -220,9 +219,6 @@ public boolean handleMessage(Message msg) {
220219
case MSG_REPORT_FAILED_ATTEMPT:
221220
handleReportFailedAttempt();
222221
break;
223-
case MSG_EXPOSE_FALLBACK:
224-
handleExposeFallback();
225-
break;
226222
case MSG_POKE_WAKELOCK:
227223
handlePokeWakelock(msg.arg1);
228224
break;
@@ -310,6 +306,10 @@ void handleUnlock() {
310306
*/
311307
void handleCancel() {
312308
if (DEBUG) Log.d(TAG, "handleCancel()");
309+
// We are going to the backup method, so we don't want to see Face Unlock again until the
310+
// next time the user visits keyguard.
311+
KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(false);
312+
313313
mKeyguardScreenCallback.showBackupSecurity();
314314
stop();
315315
mKeyguardScreenCallback.userActivity(BACKUP_LOCK_TIMEOUT);
@@ -320,17 +320,11 @@ void handleCancel() {
320320
*/
321321
void handleReportFailedAttempt() {
322322
if (DEBUG) Log.d(TAG, "handleReportFailedAttempt()");
323-
mKeyguardScreenCallback.reportFailedUnlockAttempt();
324-
}
323+
// We are going to the backup method, so we don't want to see Face Unlock again until the
324+
// next time the user visits keyguard.
325+
KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(false);
325326

326-
/**
327-
* Hides the Face Unlock view to expose the backup lock. Called when the Face Unlock service UI
328-
* is started, indicating there is no need to continue displaying the underlying view because
329-
* the service UI is now covering the backup lock.
330-
*/
331-
void handleExposeFallback() {
332-
if (DEBUG) Log.d(TAG, "handleExposeFallback()");
333-
// No longer required because face unlock doesn't cover backup unlock.
327+
mKeyguardScreenCallback.reportFailedUnlockAttempt();
334328
}
335329

336330
/**
@@ -442,16 +436,6 @@ public void reportFailedAttempt() {
442436
mHandler.sendEmptyMessage(MSG_REPORT_FAILED_ATTEMPT);
443437
}
444438

445-
/**
446-
* Called when the Face Unlock service starts displaying the UI, indicating that the backup
447-
* unlock can be exposed because the Face Unlock service is now covering the backup with its
448-
* UI.
449-
*/
450-
public void exposeFallback() {
451-
if (DEBUG) Log.d(TAG, "exposeFallback()");
452-
mHandler.sendEmptyMessage(MSG_EXPOSE_FALLBACK);
453-
}
454-
455439
/**
456440
* Called when Face Unlock wants to keep the screen alive and active for a specific amount
457441
* of time.

policy/src/com/android/internal/policy/impl/keyguard_obsolete/FaceUnlock.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
6161
private final int MSG_UNLOCK = 4;
6262
private final int MSG_CANCEL = 5;
6363
private final int MSG_REPORT_FAILED_ATTEMPT = 6;
64-
private final int MSG_EXPOSE_FALLBACK = 7;
64+
//private final int MSG_EXPOSE_FALLBACK = 7;
6565
private final int MSG_POKE_WAKELOCK = 8;
6666

6767
// TODO: This was added for the purpose of adhering to what the biometric interface expects
@@ -258,9 +258,9 @@ public boolean handleMessage(Message msg) {
258258
case MSG_REPORT_FAILED_ATTEMPT:
259259
handleReportFailedAttempt();
260260
break;
261-
case MSG_EXPOSE_FALLBACK:
262-
handleExposeFallback();
263-
break;
261+
//case MSG_EXPOSE_FALLBACK:
262+
//handleExposeFallback();
263+
//break;
264264
case MSG_POKE_WAKELOCK:
265265
handlePokeWakelock(msg.arg1);
266266
break;
@@ -401,14 +401,14 @@ void handleReportFailedAttempt() {
401401
* is started, indicating there is no need to continue displaying the underlying view because
402402
* the service UI is now covering the backup lock.
403403
*/
404-
void handleExposeFallback() {
405-
if (DEBUG) Log.d(TAG, "handleExposeFallback()");
406-
if (mFaceUnlockView != null) {
407-
mFaceUnlockView.setVisibility(View.INVISIBLE);
408-
} else {
409-
Log.e(TAG, "mFaceUnlockView is null in handleExposeFallback()");
410-
}
411-
}
404+
//void handleExposeFallback() {
405+
// if (DEBUG) Log.d(TAG, "handleExposeFallback()");
406+
// if (mFaceUnlockView != null) {
407+
// mFaceUnlockView.setVisibility(View.INVISIBLE);
408+
// } else {
409+
// Log.e(TAG, "mFaceUnlockView is null in handleExposeFallback()");
410+
// }
411+
//}
412412

413413
/**
414414
* Pokes the wakelock to keep the screen alive and active for a specific amount of time.
@@ -534,11 +534,11 @@ public void reportFailedAttempt() {
534534
* unlock can be exposed because the Face Unlock service is now covering the backup with its
535535
* UI.
536536
**/
537-
@Override
538-
public void exposeFallback() {
539-
if (DEBUG) Log.d(TAG, "exposeFallback()");
540-
mHandler.sendEmptyMessage(MSG_EXPOSE_FALLBACK);
541-
}
537+
//@Override
538+
//public void exposeFallback() {
539+
// if (DEBUG) Log.d(TAG, "exposeFallback()");
540+
// mHandler.sendEmptyMessage(MSG_EXPOSE_FALLBACK);
541+
//}
542542

543543
/**
544544
* Called when Face Unlock wants to keep the screen alive and active for a specific amount

0 commit comments

Comments
 (0)