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

Commit 0c53bc1b authored by Matt Pietal's avatar Matt Pietal
Browse files

Fix clock flicker after unlock

This can occur when tapping a notification from the
lockscreen. Ensure alpha goes to 0f immediately when
GONE.

Fixes: 325597677
Test: PrimaryBouncerToGoneViewModelTest
Flag: ACONFIG com.android.systemui.migrate_clocks_to_blueprint
DEVELOPMENT

Change-Id: I7320f818df93694be22b30653714ab927b8a556b
parent d4e3361a
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -197,7 +197,16 @@ class KeyguardTransitionInteractorTest : SysuiTestCase() {
            runCurrent()
        }

        assertThat(startedSteps).isEqualTo(listOf(steps[0], steps[3], steps[6]))
        assertThat(startedSteps)
            .isEqualTo(
                listOf(
                    // The initial transition will also get sent when collect started
                    TransitionStep(OFF, LOCKSCREEN, 0f, STARTED),
                    steps[0],
                    steps[3],
                    steps[6]
                )
            )
    }

    @Test
+10 −6
Original line number Diff line number Diff line
@@ -119,15 +119,19 @@ class PrimaryBouncerToGoneTransitionViewModelTest : SysuiTestCase() {
    fun lockscreenAlpha_runDimissFromKeyguard() =
        testScope.runTest {
            val values by collectValues(underTest.lockscreenAlpha)
            runCurrent()

            sysuiStatusBarStateController.setLeaveOpenOnKeyguardHide(true)
            runCurrent()

            keyguardTransitionRepository.sendTransitionStep(step(0f, TransitionState.STARTED))
            keyguardTransitionRepository.sendTransitionStep(step(1f))
            keyguardTransitionRepository.sendTransitionSteps(
                from = KeyguardState.PRIMARY_BOUNCER,
                to = KeyguardState.GONE,
                testScope,
            )

            assertThat(values.size).isEqualTo(2)
            values.forEach { assertThat(it).isEqualTo(1f) }
            assertThat(values[0]).isEqualTo(1f)
            assertThat(values[1]).isEqualTo(1f)
            // Ensure FINISHED sets alpha to 0
            assertThat(values[2]).isEqualTo(0f)
        }

    @Test
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ constructor(
                    0f
                }
            },
            onFinish = { 0f },
        )
    }

+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import kotlinx.coroutines.test.runCurrent
class FakeKeyguardTransitionRepository @Inject constructor() : KeyguardTransitionRepository {

    private val _transitions =
        MutableSharedFlow<TransitionStep>(replay = 2, onBufferOverflow = BufferOverflow.DROP_OLDEST)
        MutableSharedFlow<TransitionStep>(replay = 3, onBufferOverflow = BufferOverflow.DROP_OLDEST)
    override val transitions: SharedFlow<TransitionStep> = _transitions

    init {