Merge "Improved the bypass animation" into qt-r1-dev

am: 9177ab6cee

Change-Id: Ia5562709ed98e3049fd18b4a979ac6a379d23c5e
This commit is contained in:
Selim Cinek
2019-07-17 03:21:31 -07:00
committed by android-build-merger
6 changed files with 41 additions and 9 deletions

View File

@@ -570,6 +570,13 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
return isWakeAndUnlock() || mMode == MODE_UNLOCK_COLLAPSING || mMode == MODE_UNLOCK_FADING; return isWakeAndUnlock() || mMode == MODE_UNLOCK_COLLAPSING || mMode == MODE_UNLOCK_FADING;
} }
/**
* Successful authentication with fingerprint, face, or iris when the lockscreen fades away
*/
public boolean isUnlockFading() {
return mMode == MODE_UNLOCK_FADING;
}
/** /**
* Translates biometric source type for logging purpose. * Translates biometric source type for logging purpose.
*/ */

View File

@@ -167,4 +167,8 @@ class KeyguardBypassController {
pw.print(" qSExpanded: "); pw.println(qSExpanded) pw.print(" qSExpanded: "); pw.println(qSExpanded)
pw.print(" bouncerShowing: "); pw.println(bouncerShowing) pw.print(" bouncerShowing: "); pw.println(bouncerShowing)
} }
companion object {
const val BYPASS_PANEL_FADE_DURATION = 67
}
} }

View File

@@ -946,6 +946,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
} }
} }
public void setUnlockIsFading(boolean unlockFading) {
for (ScrimState state : ScrimState.values()) {
state.setUnlockIsFading(unlockFading);
}
}
public void setLaunchingAffordanceWithPreview(boolean launchingAffordanceWithPreview) { public void setLaunchingAffordanceWithPreview(boolean launchingAffordanceWithPreview) {
for (ScrimState state : ScrimState.values()) { for (ScrimState state : ScrimState.values()) {
state.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview); state.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview);

View File

@@ -147,7 +147,9 @@ public enum ScrimState {
public void prepare(ScrimState previousState) { public void prepare(ScrimState previousState) {
mCurrentBehindAlpha = 0; mCurrentBehindAlpha = 0;
mCurrentInFrontAlpha = 0; mCurrentInFrontAlpha = 0;
mAnimationDuration = StatusBar.FADE_KEYGUARD_DURATION; mAnimationDuration = mUnlockIsFading
? KeyguardBypassController.BYPASS_PANEL_FADE_DURATION
: StatusBar.FADE_KEYGUARD_DURATION;
mAnimateChange = !mLaunchingAffordanceWithPreview; mAnimateChange = !mLaunchingAffordanceWithPreview;
if (previousState == ScrimState.AOD) { if (previousState == ScrimState.AOD) {
@@ -198,6 +200,7 @@ public enum ScrimState {
boolean mHasBackdrop; boolean mHasBackdrop;
boolean mLaunchingAffordanceWithPreview; boolean mLaunchingAffordanceWithPreview;
boolean mWakeLockScreenSensorActive; boolean mWakeLockScreenSensorActive;
boolean mUnlockIsFading;
ScrimState(int index) { ScrimState(int index) {
mIndex = index; mIndex = index;
@@ -285,4 +288,8 @@ public enum ScrimState {
public void setWakeLockScreenSensorActive(boolean active) { public void setWakeLockScreenSensorActive(boolean active) {
mWakeLockScreenSensorActive = active; mWakeLockScreenSensorActive = active;
} }
public void setUnlockIsFading(boolean unlockIsFading) {
mUnlockIsFading = unlockIsFading;
}
} }

View File

@@ -3840,6 +3840,7 @@ public class StatusBar extends SystemUI implements DemoMode,
public void notifyBiometricAuthModeChanged() { public void notifyBiometricAuthModeChanged() {
updateDozing(); updateDozing();
mScrimController.setUnlockIsFading(mBiometricUnlockController.isUnlockFading());
updateScrimController(); updateScrimController();
mStatusBarWindow.onBiometricAuthModeChanged(mBiometricUnlockController.isWakeAndUnlock(), mStatusBarWindow.onBiometricAuthModeChanged(mBiometricUnlockController.isWakeAndUnlock(),
mBiometricUnlockController.isBiometricUnlock()); mBiometricUnlockController.isBiometricUnlock());
@@ -3851,7 +3852,8 @@ public class StatusBar extends SystemUI implements DemoMode,
// We don't want to end up in KEYGUARD state when we're unlocking with // We don't want to end up in KEYGUARD state when we're unlocking with
// fingerprint from doze. We should cross fade directly from black. // fingerprint from doze. We should cross fade directly from black.
boolean wakeAndUnlocking = mBiometricUnlockController.isWakeAndUnlock(); boolean unlocking = mBiometricUnlockController.isWakeAndUnlock()
|| mKeyguardMonitor.isKeyguardFadingAway();
// Do not animate the scrim expansion when triggered by the fingerprint sensor. // Do not animate the scrim expansion when triggered by the fingerprint sensor.
mScrimController.setExpansionAffectsAlpha( mScrimController.setExpansionAffectsAlpha(
@@ -3876,9 +3878,9 @@ public class StatusBar extends SystemUI implements DemoMode,
} else if (isPulsing()) { } else if (isPulsing()) {
mScrimController.transitionTo(ScrimState.PULSING, mScrimController.transitionTo(ScrimState.PULSING,
mDozeScrimController.getScrimCallback()); mDozeScrimController.getScrimCallback());
} else if (mDozing && !wakeAndUnlocking) { } else if (mDozing && !unlocking) {
mScrimController.transitionTo(ScrimState.AOD); mScrimController.transitionTo(ScrimState.AOD);
} else if (mIsKeyguard && !wakeAndUnlocking) { } else if (mIsKeyguard && !unlocking) {
mScrimController.transitionTo(ScrimState.KEYGUARD); mScrimController.transitionTo(ScrimState.KEYGUARD);
} else if (mBubbleController.isStackExpanded()) { } else if (mBubbleController.isStackExpanded()) {
mScrimController.transitionTo(ScrimState.BUBBLE_EXPANDED); mScrimController.transitionTo(ScrimState.BUBBLE_EXPANDED);

View File

@@ -84,7 +84,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
// make everything a bit slower to bridge a gap until the user is unlocked and home screen has // make everything a bit slower to bridge a gap until the user is unlocked and home screen has
// dranw its first frame. // dranw its first frame.
private static final long KEYGUARD_DISMISS_DURATION_LOCKED = 2000; private static final long KEYGUARD_DISMISS_DURATION_LOCKED = 2000;
private static final long BYPASS_PANEL_FADE_DURATION = 67;
private static String TAG = "StatusBarKeyguardViewManager"; private static String TAG = "StatusBarKeyguardViewManager";
@@ -269,7 +268,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
boolean keyguardWithoutQs = mStatusBarStateController.getState() == StatusBarState.KEYGUARD boolean keyguardWithoutQs = mStatusBarStateController.getState() == StatusBarState.KEYGUARD
&& !mNotificationPanelView.isQsExpanded(); && !mNotificationPanelView.isQsExpanded();
boolean lockVisible = (mBouncer.isShowing() || keyguardWithoutQs) boolean lockVisible = (mBouncer.isShowing() || keyguardWithoutQs)
&& !mBouncer.isAnimatingAway(); && !mBouncer.isAnimatingAway() && !mKeyguardMonitor.isKeyguardFadingAway();
if (mLastLockVisible != lockVisible) { if (mLastLockVisible != lockVisible) {
mLastLockVisible = lockVisible; mLastLockVisible = lockVisible;
@@ -278,8 +277,14 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
AppearAnimationUtils.DEFAULT_APPEAR_DURATION /* duration */, AppearAnimationUtils.DEFAULT_APPEAR_DURATION /* duration */,
0 /* delay */); 0 /* delay */);
} else { } else {
final long duration;
if (needsBypassFading()) {
duration = KeyguardBypassController.BYPASS_PANEL_FADE_DURATION;
} else {
duration = AppearAnimationUtils.DEFAULT_APPEAR_DURATION / 2;
}
CrossFadeHelper.fadeOut(mLockIconContainer, CrossFadeHelper.fadeOut(mLockIconContainer,
AppearAnimationUtils.DEFAULT_APPEAR_DURATION / 2 /* duration */, duration /* duration */,
0 /* delay */, null /* runnable */); 0 /* delay */, null /* runnable */);
} }
} }
@@ -566,7 +571,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
if (needsBypassFading()) { if (needsBypassFading()) {
ViewGroupFadeHelper.fadeOutAllChildrenExcept(mNotificationPanelView, ViewGroupFadeHelper.fadeOutAllChildrenExcept(mNotificationPanelView,
mNotificationContainer, mNotificationContainer,
BYPASS_PANEL_FADE_DURATION, KeyguardBypassController.BYPASS_PANEL_FADE_DURATION,
() -> { () -> {
mStatusBar.hideKeyguard(); mStatusBar.hideKeyguard();
onKeyguardFadedAway(); onKeyguardFadedAway();
@@ -582,7 +587,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
if (needsBypassFading()) { if (needsBypassFading()) {
ViewGroupFadeHelper.fadeOutAllChildrenExcept(mNotificationPanelView, ViewGroupFadeHelper.fadeOutAllChildrenExcept(mNotificationPanelView,
mNotificationContainer, mNotificationContainer,
BYPASS_PANEL_FADE_DURATION, KeyguardBypassController.BYPASS_PANEL_FADE_DURATION,
() -> { () -> {
mStatusBar.hideKeyguard(); mStatusBar.hideKeyguard();
}); });
@@ -601,6 +606,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
mBiometricUnlockController.finishKeyguardFadingAway(); mBiometricUnlockController.finishKeyguardFadingAway();
} }
} }
updateLockIcon();
updateStates(); updateStates();
mStatusBarWindowController.setKeyguardShowing(false); mStatusBarWindowController.setKeyguardShowing(false);
mViewMediatorCallback.keyguardGone(); mViewMediatorCallback.keyguardGone();