Merge "Remove MODE_UNLOCK_FADING since it's no longer needed" into tm-d1-dev
This commit is contained in:
@@ -736,12 +736,10 @@ public class NotificationMediaManager implements Dumpable {
|
||||
}
|
||||
boolean cannotAnimateDoze = mStatusBarStateController.isDozing()
|
||||
&& !ScrimState.AOD.getAnimateChange();
|
||||
boolean needsBypassFading = mKeyguardStateController.isBypassFadingAnimation();
|
||||
if (((mBiometricUnlockController != null && mBiometricUnlockController.getMode()
|
||||
== BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING
|
||||
|| cannotAnimateDoze) && !needsBypassFading)
|
||||
|| cannotAnimateDoze))
|
||||
|| hideBecauseOccluded) {
|
||||
|
||||
// We are unlocking directly - no animation!
|
||||
mBackdrop.setVisibility(View.GONE);
|
||||
mBackdropBack.setImageDrawable(null);
|
||||
|
||||
@@ -91,7 +91,6 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
MODE_SHOW_BOUNCER,
|
||||
MODE_ONLY_WAKE,
|
||||
MODE_UNLOCK_COLLAPSING,
|
||||
MODE_UNLOCK_FADING,
|
||||
MODE_DISMISS_BOUNCER,
|
||||
MODE_WAKE_AND_UNLOCK_FROM_DREAM
|
||||
})
|
||||
@@ -137,16 +136,10 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
*/
|
||||
public static final int MODE_WAKE_AND_UNLOCK_FROM_DREAM = 6;
|
||||
|
||||
/**
|
||||
* Faster mode of dismissing the lock screen when we cross fade to an app
|
||||
* (used for keyguard bypass.)
|
||||
*/
|
||||
public static final int MODE_UNLOCK_FADING = 7;
|
||||
|
||||
/**
|
||||
* When bouncer is visible and will be dismissed.
|
||||
*/
|
||||
public static final int MODE_DISMISS_BOUNCER = 8;
|
||||
public static final int MODE_DISMISS_BOUNCER = 7;
|
||||
|
||||
/**
|
||||
* How much faster we collapse the lockscreen when authenticating with biometric.
|
||||
@@ -451,8 +444,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
}
|
||||
switch (mMode) {
|
||||
case MODE_DISMISS_BOUNCER:
|
||||
case MODE_UNLOCK_FADING:
|
||||
Trace.beginSection("MODE_DISMISS_BOUNCER or MODE_UNLOCK_FADING");
|
||||
Trace.beginSection("MODE_DISMISS_BOUNCER");
|
||||
mKeyguardViewController.notifyKeyguardAuthenticated(
|
||||
false /* strongAuth */);
|
||||
Trace.endSection();
|
||||
@@ -616,14 +608,9 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
if (mKeyguardViewController.isShowing()) {
|
||||
if ((mKeyguardViewController.bouncerIsOrWillBeShowing()
|
||||
|| mKeyguardBypassController.getAltBouncerShowing()) && unlockingAllowed) {
|
||||
if (bypass && mKeyguardBypassController.canPlaySubtleWindowAnimations()) {
|
||||
return MODE_UNLOCK_FADING;
|
||||
} else {
|
||||
return MODE_DISMISS_BOUNCER;
|
||||
}
|
||||
} else if (unlockingAllowed) {
|
||||
return bypass || mAuthController.isUdfpsFingerDown()
|
||||
? MODE_UNLOCK_FADING : MODE_NONE;
|
||||
return MODE_DISMISS_BOUNCER;
|
||||
} else if (unlockingAllowed && (bypass || mAuthController.isUdfpsFingerDown())) {
|
||||
return MODE_UNLOCK_COLLAPSING;
|
||||
} else {
|
||||
return bypass ? MODE_SHOW_BOUNCER : MODE_NONE;
|
||||
}
|
||||
@@ -799,7 +786,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
* on or off.
|
||||
*/
|
||||
public boolean isBiometricUnlock() {
|
||||
return isWakeAndUnlock() || mMode == MODE_UNLOCK_COLLAPSING || mMode == MODE_UNLOCK_FADING;
|
||||
return isWakeAndUnlock() || mMode == MODE_UNLOCK_COLLAPSING;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -396,8 +396,7 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn
|
||||
|
||||
void keyguardGoingAway();
|
||||
|
||||
void setKeyguardFadingAway(long startTime, long delay, long fadeoutDuration,
|
||||
boolean isBypassFading);
|
||||
void setKeyguardFadingAway(long startTime, long delay, long fadeoutDuration);
|
||||
|
||||
void finishKeyguardFadingAway();
|
||||
|
||||
|
||||
@@ -107,7 +107,6 @@ import android.view.WindowManager;
|
||||
import android.view.WindowManagerGlobal;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.widget.DateTimeView;
|
||||
import android.window.SplashScreen;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
@@ -3185,14 +3184,12 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
|
||||
/**
|
||||
* Notifies the status bar the Keyguard is fading away with the specified timings.
|
||||
* @param startTime the start time of the animations in uptime millis
|
||||
* @param startTime the start time of the animations in uptime millis
|
||||
* @param delay the precalculated animation delay in milliseconds
|
||||
* @param fadeoutDuration the duration of the exit animation, in milliseconds
|
||||
* @param isBypassFading is this a fading away animation while bypassing
|
||||
*/
|
||||
@Override
|
||||
public void setKeyguardFadingAway(long startTime, long delay, long fadeoutDuration,
|
||||
boolean isBypassFading) {
|
||||
public void setKeyguardFadingAway(long startTime, long delay, long fadeoutDuration) {
|
||||
mCommandQueue.appTransitionStarting(mDisplayId, startTime + fadeoutDuration
|
||||
- LightBarTransitionsController.DEFAULT_TINT_ANIMATION_DURATION,
|
||||
LightBarTransitionsController.DEFAULT_TINT_ANIMATION_DURATION, true);
|
||||
@@ -3200,7 +3197,7 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
mCommandQueue.appTransitionStarting(mDisplayId,
|
||||
startTime - LightBarTransitionsController.DEFAULT_TINT_ANIMATION_DURATION,
|
||||
LightBarTransitionsController.DEFAULT_TINT_ANIMATION_DURATION, true);
|
||||
mKeyguardStateController.notifyKeyguardFadingAway(delay, fadeoutDuration, isBypassFading);
|
||||
mKeyguardStateController.notifyKeyguardFadingAway(delay, fadeoutDuration);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -197,20 +197,6 @@ open class KeyguardBypassController : Dumpable, StackScrollAlgorithm.BypassContr
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* If shorter animations should be played when unlocking.
|
||||
*/
|
||||
fun canPlaySubtleWindowAnimations(): Boolean {
|
||||
if (bypassEnabled) {
|
||||
return when {
|
||||
statusBarStateController.state != StatusBarState.KEYGUARD -> false
|
||||
qSExpanded -> false
|
||||
else -> true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
fun onStartedGoingToSleep() {
|
||||
pendingUnlock = null
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import static android.view.WindowInsets.Type.navigationBars;
|
||||
|
||||
import static com.android.systemui.plugins.ActivityStarter.OnDismissAction;
|
||||
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_UNLOCK_COLLAPSING;
|
||||
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_UNLOCK_FADING;
|
||||
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK;
|
||||
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING;
|
||||
|
||||
@@ -832,46 +831,17 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
executeAfterKeyguardGoneAction();
|
||||
boolean wakeUnlockPulsing =
|
||||
mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK_PULSING;
|
||||
boolean needsFading = needsBypassFading();
|
||||
if (needsFading) {
|
||||
delay = 0;
|
||||
fadeoutDuration = KeyguardBypassController.BYPASS_FADE_DURATION;
|
||||
} else if (wakeUnlockPulsing) {
|
||||
delay = 0;
|
||||
fadeoutDuration = 240;
|
||||
}
|
||||
mCentralSurfaces.setKeyguardFadingAway(startTime, delay, fadeoutDuration, needsFading);
|
||||
mCentralSurfaces.setKeyguardFadingAway(startTime, delay, 0);
|
||||
mBiometricUnlockController.startKeyguardFadingAway();
|
||||
hideBouncer(true /* destroyView */);
|
||||
if (wakeUnlockPulsing) {
|
||||
if (needsFading) {
|
||||
ViewGroupFadeHelper.fadeOutAllChildrenExcept(
|
||||
mNotificationPanelViewController.getView(),
|
||||
mNotificationContainer,
|
||||
fadeoutDuration,
|
||||
() -> {
|
||||
mCentralSurfaces.hideKeyguard();
|
||||
onKeyguardFadedAway();
|
||||
});
|
||||
} else {
|
||||
mCentralSurfaces.fadeKeyguardWhilePulsing();
|
||||
}
|
||||
mCentralSurfaces.fadeKeyguardWhilePulsing();
|
||||
wakeAndUnlockDejank();
|
||||
} else {
|
||||
boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide();
|
||||
if (!staying) {
|
||||
mNotificationShadeWindowController.setKeyguardFadingAway(true);
|
||||
if (needsFading) {
|
||||
ViewGroupFadeHelper.fadeOutAllChildrenExcept(
|
||||
mNotificationPanelViewController.getView(),
|
||||
mNotificationContainer,
|
||||
fadeoutDuration,
|
||||
() -> {
|
||||
mCentralSurfaces.hideKeyguard();
|
||||
});
|
||||
} else {
|
||||
mCentralSurfaces.hideKeyguard();
|
||||
}
|
||||
mCentralSurfaces.hideKeyguard();
|
||||
// hide() will happen asynchronously and might arrive after the scrims
|
||||
// were already hidden, this means that the transition callback won't
|
||||
// be triggered anymore and StatusBarWindowController will be forever in
|
||||
@@ -884,6 +854,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
mBiometricUnlockController.finishKeyguardFadingAway();
|
||||
}
|
||||
}
|
||||
|
||||
updateStates();
|
||||
mNotificationShadeWindowController.setKeyguardShowing(false);
|
||||
mViewMediatorCallback.keyguardGone();
|
||||
@@ -893,13 +864,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
private boolean needsBypassFading() {
|
||||
return (mBiometricUnlockController.getMode() == MODE_UNLOCK_FADING
|
||||
|| mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK_PULSING
|
||||
|| mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK)
|
||||
&& mBypassController.getBypassEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNavigationModeChanged(int mode) {
|
||||
boolean gesturalNav = QuickStepContract.isGesturalMode(mode);
|
||||
@@ -1186,7 +1150,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
|
||||
@Override
|
||||
public boolean shouldSubtleWindowAnimationsForUnlock() {
|
||||
return needsBypassFading();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -109,28 +109,15 @@ public interface KeyguardStateController extends CallbackController<Callback> {
|
||||
* we're bypassing
|
||||
*/
|
||||
default long getShortenedFadingAwayDuration() {
|
||||
if (isBypassFadingAnimation()) {
|
||||
return getKeyguardFadingAwayDuration();
|
||||
} else {
|
||||
return getKeyguardFadingAwayDuration() / 2;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if the current fading away animation is the fast bypass fading.
|
||||
*/
|
||||
default boolean isBypassFadingAnimation() {
|
||||
return false;
|
||||
return getKeyguardFadingAwayDuration() / 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies that the Keyguard is fading away with the specified timings.
|
||||
* @param delay the precalculated animation delay in milliseconds
|
||||
* @param fadeoutDuration the duration of the exit animation, in milliseconds
|
||||
* @param isBypassFading is this a fading away animation while bypassing
|
||||
*/
|
||||
default void notifyKeyguardFadingAway(long delay, long fadeoutDuration,
|
||||
boolean isBypassFading) {
|
||||
default void notifyKeyguardFadingAway(long delay, long fadeoutDuratio) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,6 @@ public class KeyguardStateControllerImpl implements KeyguardStateController, Dum
|
||||
private long mKeyguardFadingAwayDuration;
|
||||
private boolean mKeyguardGoingAway;
|
||||
private boolean mLaunchTransitionFadingAway;
|
||||
private boolean mBypassFadingAnimation;
|
||||
private boolean mTrustManaged;
|
||||
private boolean mTrusted;
|
||||
private boolean mDebugUnlocked = false;
|
||||
@@ -203,10 +202,9 @@ public class KeyguardStateControllerImpl implements KeyguardStateController, Dum
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyKeyguardFadingAway(long delay, long fadeoutDuration, boolean isBypassFading) {
|
||||
public void notifyKeyguardFadingAway(long delay, long fadeoutDuration) {
|
||||
mKeyguardFadingAwayDelay = delay;
|
||||
mKeyguardFadingAwayDuration = fadeoutDuration;
|
||||
mBypassFadingAnimation = isBypassFading;
|
||||
setKeyguardFadingAway(true);
|
||||
}
|
||||
|
||||
@@ -283,11 +281,6 @@ public class KeyguardStateControllerImpl implements KeyguardStateController, Dum
|
||||
return mUnlockAnimationControllerLazy.get().isAnimatingBetweenKeyguardAndSurfaceBehind();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBypassFadingAnimation() {
|
||||
return mBypassFadingAnimation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeyguardFadingAwayDelay() {
|
||||
return mKeyguardFadingAwayDelay;
|
||||
|
||||
@@ -127,7 +127,6 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
||||
when(mKeyguardBypassController.onBiometricAuthenticated(any(), anyBoolean()))
|
||||
.thenReturn(true);
|
||||
when(mAuthController.isUdfpsFingerDown()).thenReturn(false);
|
||||
when(mKeyguardBypassController.canPlaySubtleWindowAnimations()).thenReturn(true);
|
||||
mDependency.injectTestDependency(NotificationMediaManager.class, mMediaManager);
|
||||
mBiometricUnlockController = new BiometricUnlockController(mDozeScrimController,
|
||||
mKeyguardViewMediator, mScrimController, mShadeController,
|
||||
@@ -239,11 +238,9 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
||||
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
|
||||
BiometricSourceType.FACE, true /* isStrongBiometric */);
|
||||
|
||||
verify(mShadeController, never()).animateCollapsePanels(anyInt(), anyBoolean(),
|
||||
anyBoolean(), anyFloat());
|
||||
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
|
||||
assertThat(mBiometricUnlockController.getMode())
|
||||
.isEqualTo(BiometricUnlockController.MODE_UNLOCK_FADING);
|
||||
.isEqualTo(BiometricUnlockController.MODE_UNLOCK_COLLAPSING);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -258,11 +255,9 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
||||
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
|
||||
BiometricSourceType.FACE, true /* isStrongBiometric */);
|
||||
|
||||
verify(mShadeController, never()).animateCollapsePanels(anyInt(), anyBoolean(),
|
||||
anyBoolean(), anyFloat());
|
||||
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
|
||||
assertThat(mBiometricUnlockController.getMode())
|
||||
.isEqualTo(BiometricUnlockController.MODE_UNLOCK_FADING);
|
||||
.isEqualTo(BiometricUnlockController.MODE_UNLOCK_COLLAPSING);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -358,21 +353,6 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
||||
.isEqualTo(BiometricUnlockController.MODE_DISMISS_BOUNCER);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onBiometricAuthenticated_whenBypassOnBouncer_respectsCanPlaySubtleAnim() {
|
||||
when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
|
||||
when(mKeyguardBypassController.getBypassEnabled()).thenReturn(true);
|
||||
when(mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()).thenReturn(true);
|
||||
// the value of isStrongBiometric doesn't matter here since we only care about the returned
|
||||
// value of isUnlockingWithBiometricAllowed()
|
||||
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
|
||||
BiometricSourceType.FACE, true /* isStrongBiometric */);
|
||||
|
||||
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
|
||||
assertThat(mBiometricUnlockController.getMode())
|
||||
.isEqualTo(BiometricUnlockController.MODE_UNLOCK_FADING);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onBiometricAuthenticated_whenFaceAndPulsing_dontDismissKeyguard() {
|
||||
reset(mUpdateMonitor);
|
||||
|
||||
Reference in New Issue
Block a user