Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91fcd639 authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Restore timing of hideKeyguardViewAfterRemoteAnimation with the fast unlock flag.

Hiding the keyguard view earlier changes timings that cause test failures on cuttlefish (and could potentially cause the lockscreen to not go away on devices under extreme performance stress).

Local testing shows that this is no longer necessary.

Bug: 298186160
Test: manual
Test: atest SystemUITests
Test: atest android.server.wm.keyguard.KeyguardLockedTests
Flag: com.android.systemui.fast_unlock_transition
Change-Id: Ie62129baf2e95770400df77487e0e0bdf880edbd
parent afbb8ba8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -712,7 +712,6 @@ class KeyguardUnlockAnimationController @Inject constructor(
        // As soon as the shade starts animating out of the way, start the canned unlock animation,
        // which will finish keyguard exit when it completes. The in-window animations in the
        // Launcher window will end on their own.
        if (fastUnlockTransition()) hideKeyguardViewAfterRemoteAnimation()
        handler.postDelayed({
            if (keyguardViewMediator.get().isShowingAndNotOccluded &&
                !keyguardStateController.isKeyguardGoingAway) {
@@ -723,7 +722,7 @@ class KeyguardUnlockAnimationController @Inject constructor(

            if ((wallpaperTargets?.isNotEmpty() == true)) {
                fadeInWallpaper()
                if (!fastUnlockTransition()) hideKeyguardViewAfterRemoteAnimation()
                hideKeyguardViewAfterRemoteAnimation()
            } else {
                keyguardViewMediator.get().exitKeyguardAndFinishSurfaceBehindRemoteAnimation(
                    false /* cancelled */)
+13 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import org.mockito.Mockito.times
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.MockitoAnnotations
import org.mockito.kotlin.clearInvocations
import java.util.function.Predicate

@RunWith(AndroidJUnit4::class)
@@ -336,6 +337,10 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
                false /* requestedShowSurfaceBehindKeyguard */
        )

        // Cancel the animator so we can verify only the setSurfaceBehind call below.
        keyguardUnlockAnimationController.surfaceBehindAlphaAnimator.end()
        clearInvocations(surfaceTransactionApplier)

        // Set appear to 50%, we'll just verify that we're not applying the identity matrix which
        // means an animation is in progress.
        keyguardUnlockAnimationController.setSurfaceBehindAppearAmount(0.5f)
@@ -377,6 +382,10 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
                false /* requestedShowSurfaceBehindKeyguard */
        )

        // Cancel the animator so we can verify only the setSurfaceBehind call below.
        keyguardUnlockAnimationController.surfaceBehindAlphaAnimator.end()
        clearInvocations(surfaceTransactionApplier)

        keyguardUnlockAnimationController.setSurfaceBehindAppearAmount(1f)
        keyguardUnlockAnimationController.setWallpaperAppearAmount(1f)

@@ -409,6 +418,10 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
                false /* requestedShowSurfaceBehindKeyguard */
        )

        // Stop the animator - we just want to test whether the override is not applied.
        keyguardUnlockAnimationController.surfaceBehindAlphaAnimator.end()
        clearInvocations(surfaceTransactionApplier)

        keyguardUnlockAnimationController.setSurfaceBehindAppearAmount(1f)
        keyguardUnlockAnimationController.setWallpaperAppearAmount(1f)