Merge "Fix lockscreen anim not running on unlock with FPS" into udc-dev
This commit is contained in:
@@ -51,6 +51,7 @@ import com.android.systemui.shared.system.smartspace.SmartspaceState
|
|||||||
import com.android.systemui.statusbar.NotificationShadeWindowController
|
import com.android.systemui.statusbar.NotificationShadeWindowController
|
||||||
import com.android.systemui.statusbar.SysuiStatusBarStateController
|
import com.android.systemui.statusbar.SysuiStatusBarStateController
|
||||||
import com.android.systemui.statusbar.phone.BiometricUnlockController
|
import com.android.systemui.statusbar.phone.BiometricUnlockController
|
||||||
|
import com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK_FROM_DREAM
|
||||||
import com.android.systemui.statusbar.policy.KeyguardStateController
|
import com.android.systemui.statusbar.policy.KeyguardStateController
|
||||||
import dagger.Lazy
|
import dagger.Lazy
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -173,7 +174,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
|
|||||||
@JvmDefault
|
@JvmDefault
|
||||||
fun onUnlockAnimationStarted(
|
fun onUnlockAnimationStarted(
|
||||||
playingCannedAnimation: Boolean,
|
playingCannedAnimation: Boolean,
|
||||||
fromWakeAndUnlock: Boolean,
|
isWakeAndUnlockNotFromDream: Boolean,
|
||||||
unlockAnimationStartDelay: Long,
|
unlockAnimationStartDelay: Long,
|
||||||
unlockAnimationDuration: Long
|
unlockAnimationDuration: Long
|
||||||
) {}
|
) {}
|
||||||
@@ -590,10 +591,13 @@ class KeyguardUnlockAnimationController @Inject constructor(
|
|||||||
playCannedUnlockAnimation()
|
playCannedUnlockAnimation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notify if waking from AOD only
|
||||||
|
val isWakeAndUnlockNotFromDream = biometricUnlockControllerLazy.get().isWakeAndUnlock &&
|
||||||
|
biometricUnlockControllerLazy.get().mode != MODE_WAKE_AND_UNLOCK_FROM_DREAM
|
||||||
listeners.forEach {
|
listeners.forEach {
|
||||||
it.onUnlockAnimationStarted(
|
it.onUnlockAnimationStarted(
|
||||||
playingCannedUnlockAnimation /* playingCannedAnimation */,
|
playingCannedUnlockAnimation /* playingCannedAnimation */,
|
||||||
biometricUnlockControllerLazy.get().isWakeAndUnlock /* isWakeAndUnlock */,
|
isWakeAndUnlockNotFromDream /* isWakeAndUnlockNotFromDream */,
|
||||||
CANNED_UNLOCK_START_DELAY /* unlockStartDelay */,
|
CANNED_UNLOCK_START_DELAY /* unlockStartDelay */,
|
||||||
LAUNCHER_ICONS_ANIMATION_DURATION_MS /* unlockAnimationDuration */) }
|
LAUNCHER_ICONS_ANIMATION_DURATION_MS /* unlockAnimationDuration */) }
|
||||||
|
|
||||||
|
|||||||
@@ -935,10 +935,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
|||||||
@Override
|
@Override
|
||||||
public void onUnlockAnimationStarted(
|
public void onUnlockAnimationStarted(
|
||||||
boolean playingCannedAnimation,
|
boolean playingCannedAnimation,
|
||||||
boolean isWakeAndUnlock,
|
boolean isWakeAndUnlockNotFromDream,
|
||||||
long startDelay,
|
long startDelay,
|
||||||
long unlockAnimationDuration) {
|
long unlockAnimationDuration) {
|
||||||
unlockAnimationStarted(playingCannedAnimation, isWakeAndUnlock, startDelay);
|
unlockAnimationStarted(playingCannedAnimation, isWakeAndUnlockNotFromDream,
|
||||||
|
startDelay);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mAlternateBouncerInteractor = alternateBouncerInteractor;
|
mAlternateBouncerInteractor = alternateBouncerInteractor;
|
||||||
@@ -953,7 +954,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
|||||||
|
|
||||||
private void unlockAnimationStarted(
|
private void unlockAnimationStarted(
|
||||||
boolean playingCannedAnimation,
|
boolean playingCannedAnimation,
|
||||||
boolean isWakeAndUnlock,
|
boolean isWakeAndUnlockNotFromDream,
|
||||||
long unlockAnimationStartDelay) {
|
long unlockAnimationStartDelay) {
|
||||||
// Disable blurs while we're unlocking so that panel expansion does not
|
// Disable blurs while we're unlocking so that panel expansion does not
|
||||||
// cause blurring. This will eventually be re-enabled by the panel view on
|
// cause blurring. This will eventually be re-enabled by the panel view on
|
||||||
@@ -961,7 +962,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
|||||||
// unlock gesture, and we don't want that to cause blurring either.
|
// unlock gesture, and we don't want that to cause blurring either.
|
||||||
mDepthController.setBlursDisabledForUnlock(mTracking);
|
mDepthController.setBlursDisabledForUnlock(mTracking);
|
||||||
|
|
||||||
if (playingCannedAnimation && !isWakeAndUnlock) {
|
if (playingCannedAnimation && !isWakeAndUnlockNotFromDream) {
|
||||||
// Hide the panel so it's not in the way or the surface behind the
|
// Hide the panel so it's not in the way or the surface behind the
|
||||||
// keyguard, which will be appearing. If we're wake and unlocking, the
|
// keyguard, which will be appearing. If we're wake and unlocking, the
|
||||||
// lock screen is hidden instantly so should not be flung away.
|
// lock screen is hidden instantly so should not be flung away.
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.android.systemui.statusbar.NotificationShadeWindowController
|
|||||||
import com.android.systemui.statusbar.SysuiStatusBarStateController
|
import com.android.systemui.statusbar.SysuiStatusBarStateController
|
||||||
import com.android.systemui.statusbar.phone.BiometricUnlockController
|
import com.android.systemui.statusbar.phone.BiometricUnlockController
|
||||||
import com.android.systemui.statusbar.policy.KeyguardStateController
|
import com.android.systemui.statusbar.policy.KeyguardStateController
|
||||||
|
import com.android.systemui.util.mockito.any
|
||||||
import com.android.systemui.util.mockito.argThat
|
import com.android.systemui.util.mockito.argThat
|
||||||
import com.android.systemui.util.mockito.whenever
|
import com.android.systemui.util.mockito.whenever
|
||||||
import junit.framework.Assert.assertEquals
|
import junit.framework.Assert.assertEquals
|
||||||
@@ -33,6 +34,7 @@ import org.junit.Test
|
|||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
import org.mockito.Mockito.atLeastOnce
|
import org.mockito.Mockito.atLeastOnce
|
||||||
|
import org.mockito.Mockito.eq
|
||||||
import org.mockito.Mockito.mock
|
import org.mockito.Mockito.mock
|
||||||
import org.mockito.Mockito.never
|
import org.mockito.Mockito.never
|
||||||
import org.mockito.Mockito.times
|
import org.mockito.Mockito.times
|
||||||
@@ -177,6 +179,46 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
|
|||||||
false /* cancelled */)
|
false /* cancelled */)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun onWakeAndUnlock_notifiesListenerWithTrue() {
|
||||||
|
whenever(biometricUnlockController.isWakeAndUnlock).thenReturn(true)
|
||||||
|
whenever(biometricUnlockController.mode).thenReturn(
|
||||||
|
BiometricUnlockController.MODE_WAKE_AND_UNLOCK)
|
||||||
|
|
||||||
|
val listener = mock(
|
||||||
|
KeyguardUnlockAnimationController.KeyguardUnlockAnimationListener::class.java)
|
||||||
|
keyguardUnlockAnimationController.addKeyguardUnlockAnimationListener(listener)
|
||||||
|
|
||||||
|
keyguardUnlockAnimationController.notifyStartSurfaceBehindRemoteAnimation(
|
||||||
|
remoteAnimationTargets,
|
||||||
|
wallpaperTargets,
|
||||||
|
0 /* startTime */,
|
||||||
|
false /* requestedShowSurfaceBehindKeyguard */
|
||||||
|
)
|
||||||
|
|
||||||
|
verify(listener).onUnlockAnimationStarted(any(), eq(true), any(), any())
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun onWakeAndUnlockFromDream_notifiesListenerWithFalse() {
|
||||||
|
whenever(biometricUnlockController.isWakeAndUnlock).thenReturn(true)
|
||||||
|
whenever(biometricUnlockController.mode).thenReturn(
|
||||||
|
BiometricUnlockController.MODE_WAKE_AND_UNLOCK_FROM_DREAM)
|
||||||
|
|
||||||
|
val listener = mock(
|
||||||
|
KeyguardUnlockAnimationController.KeyguardUnlockAnimationListener::class.java)
|
||||||
|
keyguardUnlockAnimationController.addKeyguardUnlockAnimationListener(listener)
|
||||||
|
|
||||||
|
keyguardUnlockAnimationController.notifyStartSurfaceBehindRemoteAnimation(
|
||||||
|
remoteAnimationTargets,
|
||||||
|
wallpaperTargets,
|
||||||
|
0 /* startTime */,
|
||||||
|
false /* requestedShowSurfaceBehindKeyguard */
|
||||||
|
)
|
||||||
|
|
||||||
|
verify(listener).onUnlockAnimationStarted(any(), eq(false), any(), any())
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If we requested that the surface behind be made visible, and we're not flinging away the
|
* If we requested that the surface behind be made visible, and we're not flinging away the
|
||||||
* keyguard, it means that we're swiping to unlock and want the surface visible so it can follow
|
* keyguard, it means that we're swiping to unlock and want the surface visible so it can follow
|
||||||
|
|||||||
Reference in New Issue
Block a user