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

Commit 52b08f42 authored by Andreas Miko's avatar Andreas Miko
Browse files

Fix OriginalUnseenKeyguardCoordinator e2e test

in ag/28176151 the seen behavior was slightly changed which caused a e2e
test to fail: b/351913295. The intention was to use standardized
flexi-aware APIs and the change seemed to be ok, but the test shows that
there is a timing issue somewhere downstream. This CL reverts the logic
and replaces it with a custom flagged logic that mimics the same
behavior in Flexiglass. There is no flexi-aware API for this because
usually we check being on a state or leaving the state (isFinished) but
not going to a state or being on a state.

Bug: b/351913295
Flag: NONE revert unflagged behavior
Flag: com.android.systemui.scene_container
Test: Revert to old behavior
Change-Id: I840d18b5979cc28a88af88b604f605bbda1698e3
parent 1d39426b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.systemui.log.logcatLogBuffer
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.scene.data.repository.Idle
import com.android.systemui.scene.data.repository.setTransition
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.statusbar.notification.collection.GroupEntryBuilder
import com.android.systemui.statusbar.notification.collection.NotifPipeline
@@ -627,6 +628,7 @@ class OriginalUnseenKeyguardCoordinatorTest(flags: FlagsParameterization) : Sysu
                fakeSettings,
                seenNotificationsInteractor,
                statusBarStateController,
                sceneInteractor = kosmos.sceneInteractor,
            )
        keyguardCoordinator.attach(notifPipeline)
        testScope.runTest {
+12 −6
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ import com.android.systemui.keyguard.data.repository.KeyguardRepository
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.statusbar.expansionChanges
import com.android.systemui.statusbar.notification.collection.NotifPipeline
@@ -87,6 +89,7 @@ constructor(
    private val secureSettings: SecureSettings,
    private val seenNotificationsInteractor: SeenNotificationsInteractor,
    private val statusBarStateController: StatusBarStateController,
    private val sceneInteractor: SceneInteractor,
) : Coordinator, Dumpable {

    private val unseenNotifications = mutableSetOf<NotificationEntry>()
@@ -106,12 +109,15 @@ constructor(
        // Whether or not keyguard is visible (or occluded).
        @Suppress("DEPRECATION")
        val isKeyguardPresentFlow: Flow<Boolean> =
            keyguardTransitionInteractor
                .transitionValue(
                    scene = Scenes.Gone,
                    stateWithoutSceneContainer = KeyguardState.GONE,
                )
                .map { it == 0f }
            if (SceneContainerFlag.isEnabled) {
                    sceneInteractor.transitionState.map {
                        !it.isTransitioning(to = Scenes.Gone) && !it.isIdle(Scenes.Gone)
                    }
                } else {
                    keyguardTransitionInteractor.transitions.map { step ->
                        step.to != KeyguardState.GONE
                    }
                }
                .distinctUntilChanged()
                .onEach { trackingUnseen -> logger.logTrackingUnseen(trackingUnseen) }