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

Commit 095ee329 authored by Beverly's avatar Beverly
Browse files

Update KeyguardInteractor#primaryBouncerShowing to include showingSoon

When primaryBouncerShowingSoon is true, this means the bouncer
background is showing but the bouncer contents themselves (ie:
pin/password/pattern views) haven't shown yet. For the rest of
keyguard, this essentially is equivalent to the bouncer showing.

When the showing state doesn't include the showingSoon state,
there are race conditions where the KeyguardTransitionFramework
can get stuck in a stale PrimaryBouncer transition state
when the PrimaryBouncerInteractor/Repo state reflects the
primary bouncer isn't showing.

Test: atest KeygaurdInteractorTest
Fixes: 432471590
Flag: EXEMPT bugfix
Change-Id: I249a5ca1bd8d808ab05ed09323db2168f463010f
parent 2397c213
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -19,12 +19,10 @@ package com.android.systemui.keyguard.domain.interactor

import android.app.StatusBarManager
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.systemui.Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR
import com.android.systemui.Flags.FLAG_NEW_DOZING_KEYGUARD_STATES
import com.android.systemui.SysuiTestCase
import com.android.systemui.bouncer.data.repository.keyguardBouncerRepository
import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository
@@ -682,7 +680,6 @@ class KeyguardInteractorTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(FLAG_NEW_DOZING_KEYGUARD_STATES)
    fun primaryBouncerShowing_bouncerShowingSoon() =
        testScope.runTest {
            val primaryBouncerShowing by collectLastValue(underTest.primaryBouncerShowing)
+11 −15
Original line number Diff line number Diff line
@@ -278,7 +278,6 @@ constructor(
    /** Whether the primary bouncer is showing or about to show soon. */
    @JvmField
    val primaryBouncerShowing: StateFlow<Boolean> =
        if (com.android.systemui.Flags.newDozingKeyguardStates()) {
        combine(
                bouncerRepository.primaryBouncerShow,
                bouncerRepository.primaryBouncerShowingSoon,
@@ -290,9 +289,6 @@ constructor(
                started = SharingStarted.WhileSubscribed(),
                initialValue = false,
            )
        } else {
            bouncerRepository.primaryBouncerShow
        }

    /** Whether the alternate bouncer is showing or not. */
    val alternateBouncerShowing: StateFlow<Boolean> = bouncerRepository.alternateBouncerVisible