Merge "Improved the unlock animation when bypassing" into qt-r1-dev

am: 16815264dd

Change-Id: Idae198e0483c7e0dd41618be0259e58a1e276e64
This commit is contained in:
Selim Cinek
2019-07-01 13:38:29 -07:00
committed by android-build-merger
7 changed files with 55 additions and 13 deletions

View File

@@ -95,6 +95,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
private boolean mPulsing;
private boolean mDozing;
private boolean mDocked;
private boolean mBlockUpdates;
private int mIconColor;
private float mDozeAmount;
private boolean mBouncerShowingScrimmed;
@@ -107,8 +108,22 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
new KeyguardMonitor.Callback() {
@Override
public void onKeyguardShowingChanged() {
boolean force = false;
boolean wasShowing = mKeyguardShowing;
mKeyguardShowing = mKeyguardMonitor.isShowing();
update();
if (!wasShowing && mKeyguardShowing && mBlockUpdates) {
mBlockUpdates = false;
force = true;
}
update(force);
}
@Override
public void onKeyguardFadingAwayChanged() {
if (!mKeyguardMonitor.isKeyguardFadingAway() && mBlockUpdates) {
mBlockUpdates = false;
update(true /* force */);
}
}
};
private final DockManager.DockEventListener mDockEventListener =
@@ -261,7 +276,11 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
mIsFaceUnlockState = state == STATE_SCANNING_FACE;
mLastState = state;
if (lastState != state || mForceUpdate) {
boolean shouldUpdate = lastState != state || mForceUpdate;
if (mBlockUpdates && canBlockUpdates()) {
shouldUpdate = false;
}
if (shouldUpdate) {
mForceUpdate = false;
@LockAnimIndex final int lockAnimIndex = getAnimationIndexForTransition(lastState,
state, mPulsing, mDozing);
@@ -330,6 +349,10 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
return true;
}
private boolean canBlockUpdates() {
return mKeyguardShowing || mKeyguardMonitor.isKeyguardFadingAway();
}
private void updateClickability() {
if (mAccessibilityController == null) {
return;
@@ -536,11 +559,17 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
/**
* We need to hide the lock whenever there's a fingerprint unlock, otherwise you'll see the
* icon on top of the black front scrim.
* @param wakeAndUnlock are we wake and unlocking
* @param isUnlock are we currently unlocking
*/
public void onBiometricAuthModeChanged(boolean wakeAndUnlock) {
public void onBiometricAuthModeChanged(boolean wakeAndUnlock, boolean isUnlock) {
if (wakeAndUnlock) {
mWakeAndUnlockRunning = true;
}
if (isUnlock && mBypassController.getBypassEnabled() && canBlockUpdates()) {
// We don't want the icon to change while we are unlocking
mBlockUpdates = true;
}
update();
}

View File

@@ -3834,7 +3834,8 @@ public class StatusBar extends SystemUI implements DemoMode,
public void notifyBiometricAuthModeChanged() {
updateDozing();
updateScrimController();
mStatusBarWindow.onBiometricAuthModeChanged(mBiometricUnlockController.isWakeAndUnlock());
mStatusBarWindow.onBiometricAuthModeChanged(mBiometricUnlockController.isWakeAndUnlock(),
mBiometricUnlockController.isBiometricUnlock());
}
@VisibleForTesting

View File

@@ -814,7 +814,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
*/
public boolean shouldSubtleWindowAnimationsForUnlock() {
return mStatusBar.mKeyguardBypassController.getBypassEnabled()
&& mStatusBar.mState == StatusBarState.KEYGUARD;
&& mStatusBar.mState == StatusBarState.KEYGUARD && !mBouncer.isAnimatingAway();
}
public boolean isGoingToNotificationShade() {

View File

@@ -272,10 +272,11 @@ public class StatusBarWindowView extends FrameLayout {
/**
* Called when the biometric authentication mode changes.
* @param wakeAndUnlock If the type is {@link BiometricUnlockController#isWakeAndUnlock()}
* @param isUnlock If the type is {@link BiometricUnlockController#isBiometricUnlock()} ()
*/
public void onBiometricAuthModeChanged(boolean wakeAndUnlock) {
public void onBiometricAuthModeChanged(boolean wakeAndUnlock, boolean isUnlock) {
if (mLockIcon != null) {
mLockIcon.onBiometricAuthModeChanged(wakeAndUnlock);
mLockIcon.onBiometricAuthModeChanged(wakeAndUnlock, isUnlock);
}
}

View File

@@ -50,5 +50,6 @@ public interface KeyguardMonitor extends CallbackController<Callback> {
interface Callback {
void onKeyguardShowingChanged();
default void onKeyguardFadingAwayChanged() {}
}
}

View File

@@ -141,14 +141,24 @@ public class KeyguardMonitorImpl extends KeyguardUpdateMonitorCallback
}
public void notifyKeyguardFadingAway(long delay, long fadeoutDuration) {
mKeyguardFadingAway = true;
setKeyguardFadingAway(true);
mKeyguardFadingAwayDelay = delay;
mKeyguardFadingAwayDuration = fadeoutDuration;
}
private void setKeyguardFadingAway(boolean keyguardFadingAway) {
if (mKeyguardFadingAway != keyguardFadingAway) {
mKeyguardFadingAway = keyguardFadingAway;
ArrayList<Callback> callbacks = new ArrayList<>(mCallbacks);
for (int i = 0; i < callbacks.size(); i++) {
callbacks.get(i).onKeyguardFadingAwayChanged();
}
}
}
public void notifyKeyguardDoneFading() {
mKeyguardFadingAway = false;
mKeyguardGoingAway = false;
setKeyguardFadingAway(false);
}
@Override

View File

@@ -2523,11 +2523,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
final int resource;
if (onWallpaper) {
resource = R.anim.lock_screen_behind_enter_wallpaper;
} else if (subtleAnimation) {
if (subtleAnimation) {
resource = R.anim.lock_screen_behind_enter_subtle;
} else {
} else if (onWallpaper) {
resource = R.anim.lock_screen_behind_enter_wallpaper;
} else {
resource = R.anim.lock_screen_behind_enter;
}