Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +6 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.systemui.shared.system.QuickStepContract import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController import com.android.systemui.shared.system.smartspace.SmartspaceState import com.android.systemui.statusbar.NotificationShadeWindowController import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.policy.KeyguardStateController Loading Loading @@ -142,7 +143,8 @@ class KeyguardUnlockAnimationController @Inject constructor( private val keyguardViewController: KeyguardViewController, private val featureFlags: FeatureFlags, private val biometricUnlockControllerLazy: Lazy<BiometricUnlockController>, private val statusBarStateController: SysuiStatusBarStateController private val statusBarStateController: SysuiStatusBarStateController, private val notificationShadeWindowController: NotificationShadeWindowController ) : KeyguardStateController.Callback, ISysuiUnlockAnimationController.Stub() { interface KeyguardUnlockAnimationListener { Loading Loading @@ -362,6 +364,9 @@ class KeyguardUnlockAnimationController @Inject constructor( */ fun canPerformInWindowLauncherAnimations(): Boolean { return isNexusLauncherUnderneath() && // If the launcher is underneath, but we're about to launch an activity, don't do // the animations since they won't be visible. !notificationShadeWindowController.isLaunchingActivity && launcherUnlockController != null && !keyguardStateController.isDismissingFromSwipe && // Temporarily disable for foldables since foldable launcher has two first pages, Loading Loading @@ -413,7 +418,6 @@ class KeyguardUnlockAnimationController @Inject constructor( (lockscreenSmartspace as BcSmartspaceDataPlugin.SmartspaceView?)?.selectedPage ?: -1 try { // Let the launcher know to prepare for this animation. launcherUnlockController?.prepareForUnlock( willUnlockWithSmartspaceTransition, /* willAnimateSmartspace */ Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt +25 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ import androidx.test.filters.SmallTest import com.android.keyguard.KeyguardViewController import com.android.systemui.SysuiTestCase import com.android.systemui.flags.FeatureFlags import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController import com.android.systemui.statusbar.NotificationShadeWindowController import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.policy.KeyguardStateController Loading Loading @@ -52,6 +54,11 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { private lateinit var surfaceTransactionApplier: SyncRtSurfaceTransactionApplier @Mock private lateinit var statusBarStateController: SysuiStatusBarStateController @Mock private lateinit var notificationShadeWindowController: NotificationShadeWindowController @Mock private lateinit var launcherUnlockAnimationController: ILauncherUnlockAnimationController.Stub private lateinit var remoteAnimationTarget: RemoteAnimationTarget Loading @@ -60,8 +67,11 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { MockitoAnnotations.initMocks(this) keyguardUnlockAnimationController = KeyguardUnlockAnimationController( context, keyguardStateController, { keyguardViewMediator }, keyguardViewController, featureFlags, { biometricUnlockController }, statusBarStateController featureFlags, { biometricUnlockController }, statusBarStateController, notificationShadeWindowController ) keyguardUnlockAnimationController.setLauncherUnlockController( launcherUnlockAnimationController) `when`(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java)) Loading Loading @@ -194,4 +204,18 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { assertTrue(keyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) assertFalse(keyguardUnlockAnimationController.surfaceBehindAlphaAnimator.isRunning) } @Test fun doNotPlayCannedUnlockAnimation_ifLaunchingApp() { `when`(notificationShadeWindowController.isLaunchingActivity).thenReturn(true) keyguardUnlockAnimationController.notifyStartSurfaceBehindRemoteAnimation( remoteAnimationTarget, 0 /* startTime */, true /* requestedShowSurfaceBehindKeyguard */ ) assertFalse(keyguardUnlockAnimationController.canPerformInWindowLauncherAnimations()) assertFalse(keyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) } } No newline at end of file Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +6 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.systemui.shared.system.QuickStepContract import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController import com.android.systemui.shared.system.smartspace.SmartspaceState import com.android.systemui.statusbar.NotificationShadeWindowController import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.policy.KeyguardStateController Loading Loading @@ -142,7 +143,8 @@ class KeyguardUnlockAnimationController @Inject constructor( private val keyguardViewController: KeyguardViewController, private val featureFlags: FeatureFlags, private val biometricUnlockControllerLazy: Lazy<BiometricUnlockController>, private val statusBarStateController: SysuiStatusBarStateController private val statusBarStateController: SysuiStatusBarStateController, private val notificationShadeWindowController: NotificationShadeWindowController ) : KeyguardStateController.Callback, ISysuiUnlockAnimationController.Stub() { interface KeyguardUnlockAnimationListener { Loading Loading @@ -362,6 +364,9 @@ class KeyguardUnlockAnimationController @Inject constructor( */ fun canPerformInWindowLauncherAnimations(): Boolean { return isNexusLauncherUnderneath() && // If the launcher is underneath, but we're about to launch an activity, don't do // the animations since they won't be visible. !notificationShadeWindowController.isLaunchingActivity && launcherUnlockController != null && !keyguardStateController.isDismissingFromSwipe && // Temporarily disable for foldables since foldable launcher has two first pages, Loading Loading @@ -413,7 +418,6 @@ class KeyguardUnlockAnimationController @Inject constructor( (lockscreenSmartspace as BcSmartspaceDataPlugin.SmartspaceView?)?.selectedPage ?: -1 try { // Let the launcher know to prepare for this animation. launcherUnlockController?.prepareForUnlock( willUnlockWithSmartspaceTransition, /* willAnimateSmartspace */ Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt +25 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ import androidx.test.filters.SmallTest import com.android.keyguard.KeyguardViewController import com.android.systemui.SysuiTestCase import com.android.systemui.flags.FeatureFlags import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController import com.android.systemui.statusbar.NotificationShadeWindowController import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.policy.KeyguardStateController Loading Loading @@ -52,6 +54,11 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { private lateinit var surfaceTransactionApplier: SyncRtSurfaceTransactionApplier @Mock private lateinit var statusBarStateController: SysuiStatusBarStateController @Mock private lateinit var notificationShadeWindowController: NotificationShadeWindowController @Mock private lateinit var launcherUnlockAnimationController: ILauncherUnlockAnimationController.Stub private lateinit var remoteAnimationTarget: RemoteAnimationTarget Loading @@ -60,8 +67,11 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { MockitoAnnotations.initMocks(this) keyguardUnlockAnimationController = KeyguardUnlockAnimationController( context, keyguardStateController, { keyguardViewMediator }, keyguardViewController, featureFlags, { biometricUnlockController }, statusBarStateController featureFlags, { biometricUnlockController }, statusBarStateController, notificationShadeWindowController ) keyguardUnlockAnimationController.setLauncherUnlockController( launcherUnlockAnimationController) `when`(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java)) Loading Loading @@ -194,4 +204,18 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { assertTrue(keyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) assertFalse(keyguardUnlockAnimationController.surfaceBehindAlphaAnimator.isRunning) } @Test fun doNotPlayCannedUnlockAnimation_ifLaunchingApp() { `when`(notificationShadeWindowController.isLaunchingActivity).thenReturn(true) keyguardUnlockAnimationController.notifyStartSurfaceBehindRemoteAnimation( remoteAnimationTarget, 0 /* startTime */, true /* requestedShowSurfaceBehindKeyguard */ ) assertFalse(keyguardUnlockAnimationController.canPerformInWindowLauncherAnimations()) assertFalse(keyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) } } No newline at end of file