Merge "Don't collapse the shade when SHOW_BOUNCER" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
693e5f6d34
@@ -177,7 +177,6 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
private KeyguardViewMediator mKeyguardViewMediator;
|
private KeyguardViewMediator mKeyguardViewMediator;
|
||||||
private ScrimController mScrimController;
|
private ScrimController mScrimController;
|
||||||
private PendingAuthenticated mPendingAuthenticated = null;
|
private PendingAuthenticated mPendingAuthenticated = null;
|
||||||
private boolean mPendingShowBouncer;
|
|
||||||
private boolean mHasScreenTurnedOnSinceAuthenticating;
|
private boolean mHasScreenTurnedOnSinceAuthenticating;
|
||||||
private boolean mFadedAwayAfterWakeAndUnlock;
|
private boolean mFadedAwayAfterWakeAndUnlock;
|
||||||
private BiometricModeListener mBiometricModeListener;
|
private BiometricModeListener mBiometricModeListener;
|
||||||
@@ -474,31 +473,22 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
break;
|
break;
|
||||||
case MODE_UNLOCK_COLLAPSING:
|
case MODE_UNLOCK_COLLAPSING:
|
||||||
Trace.beginSection("MODE_UNLOCK_COLLAPSING");
|
Trace.beginSection("MODE_UNLOCK_COLLAPSING");
|
||||||
if (!wasDeviceInteractive) {
|
// If the keyguard unlock controller is going to handle the unlock animation, it
|
||||||
mPendingShowBouncer = true;
|
// will fling the panel collapsed when it's ready.
|
||||||
} else {
|
if (!mKeyguardUnlockAnimationController.willHandleUnlockAnimation()) {
|
||||||
// If the keyguard unlock controller is going to handle the unlock animation, it
|
mShadeController.animateCollapsePanels(
|
||||||
// will fling the panel collapsed when it's ready.
|
CommandQueue.FLAG_EXCLUDE_NONE,
|
||||||
if (!mKeyguardUnlockAnimationController.willHandleUnlockAnimation()) {
|
true /* force */,
|
||||||
mShadeController.animateCollapsePanels(
|
false /* delayed */,
|
||||||
CommandQueue.FLAG_EXCLUDE_NONE,
|
BIOMETRIC_COLLAPSE_SPEEDUP_FACTOR);
|
||||||
true /* force */,
|
|
||||||
false /* delayed */,
|
|
||||||
BIOMETRIC_COLLAPSE_SPEEDUP_FACTOR);
|
|
||||||
}
|
|
||||||
mPendingShowBouncer = false;
|
|
||||||
mKeyguardViewController.notifyKeyguardAuthenticated(
|
|
||||||
false /* strongAuth */);
|
|
||||||
}
|
}
|
||||||
|
mKeyguardViewController.notifyKeyguardAuthenticated(
|
||||||
|
false /* strongAuth */);
|
||||||
Trace.endSection();
|
Trace.endSection();
|
||||||
break;
|
break;
|
||||||
case MODE_SHOW_BOUNCER:
|
case MODE_SHOW_BOUNCER:
|
||||||
Trace.beginSection("MODE_SHOW_BOUNCER");
|
Trace.beginSection("MODE_SHOW_BOUNCER");
|
||||||
if (!wasDeviceInteractive) {
|
mKeyguardViewController.showBouncer(true);
|
||||||
mPendingShowBouncer = true;
|
|
||||||
} else {
|
|
||||||
showBouncer();
|
|
||||||
}
|
|
||||||
Trace.endSection();
|
Trace.endSection();
|
||||||
break;
|
break;
|
||||||
case MODE_WAKE_AND_UNLOCK_FROM_DREAM:
|
case MODE_WAKE_AND_UNLOCK_FROM_DREAM:
|
||||||
@@ -536,15 +526,6 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showBouncer() {
|
|
||||||
if (mMode == MODE_SHOW_BOUNCER) {
|
|
||||||
mKeyguardViewController.showBouncer(true);
|
|
||||||
}
|
|
||||||
mShadeController.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */,
|
|
||||||
false /* delayed */, BIOMETRIC_COLLAPSE_SPEEDUP_FACTOR);
|
|
||||||
mPendingShowBouncer = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasPendingAuthentication() {
|
public boolean hasPendingAuthentication() {
|
||||||
return mPendingAuthenticated != null
|
return mPendingAuthenticated != null
|
||||||
&& mUpdateMonitor
|
&& mUpdateMonitor
|
||||||
@@ -770,13 +751,6 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
final WakefulnessLifecycle.Observer mWakefulnessObserver =
|
final WakefulnessLifecycle.Observer mWakefulnessObserver =
|
||||||
new WakefulnessLifecycle.Observer() {
|
new WakefulnessLifecycle.Observer() {
|
||||||
@Override
|
|
||||||
public void onFinishedWakingUp() {
|
|
||||||
if (mPendingShowBouncer) {
|
|
||||||
BiometricUnlockController.this.showBouncer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartedGoingToSleep() {
|
public void onStartedGoingToSleep() {
|
||||||
resetMode();
|
resetMode();
|
||||||
|
|||||||
@@ -167,8 +167,6 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
|||||||
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
|
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
|
||||||
BiometricSourceType.FINGERPRINT, false /* isStrongBiometric */);
|
BiometricSourceType.FINGERPRINT, false /* isStrongBiometric */);
|
||||||
verify(mStatusBarKeyguardViewManager).showBouncer(anyBoolean());
|
verify(mStatusBarKeyguardViewManager).showBouncer(anyBoolean());
|
||||||
verify(mShadeController).animateCollapsePanels(anyInt(), anyBoolean(), anyBoolean(),
|
|
||||||
anyFloat());
|
|
||||||
assertThat(mBiometricUnlockController.getMode())
|
assertThat(mBiometricUnlockController.getMode())
|
||||||
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
|
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
|
||||||
assertThat(mBiometricUnlockController.getBiometricType())
|
assertThat(mBiometricUnlockController.getBiometricType())
|
||||||
@@ -298,10 +296,6 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
|||||||
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
|
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
|
||||||
BiometricSourceType.FACE, true /* isStrongBiometric */);
|
BiometricSourceType.FACE, true /* isStrongBiometric */);
|
||||||
|
|
||||||
// Wake up before showing the bouncer
|
|
||||||
verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
|
|
||||||
mBiometricUnlockController.mWakefulnessObserver.onFinishedWakingUp();
|
|
||||||
|
|
||||||
verify(mStatusBarKeyguardViewManager).showBouncer(anyBoolean());
|
verify(mStatusBarKeyguardViewManager).showBouncer(anyBoolean());
|
||||||
assertThat(mBiometricUnlockController.getMode())
|
assertThat(mBiometricUnlockController.getMode())
|
||||||
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
|
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
|
||||||
|
|||||||
Reference in New Issue
Block a user