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

Commit 7ae2152d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] Don't rely on currentScene/Overlays StateFlow when snapping" into main

parents 0210fa0a 5142ad39
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -98,7 +98,10 @@ class SceneTransitionLayoutDataSource(
        state.currentTransition?.freezeAndAnimateToCurrentState()
    }

    override fun instantlyTransitionTo(scene: SceneKey, overlays: Set<OverlayKey>) {
        state.snapTo(scene = scene, overlays = overlays)
    override fun instantlyTransitionTo(scene: SceneKey?, overlays: Set<OverlayKey>?) {
        state.snapTo(
            scene = scene ?: state.transitionState.currentScene,
            overlays = overlays ?: state.transitionState.currentOverlays,
        )
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -165,8 +165,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT

            // If dreaming is possible and communal is available, then we should transition to
            // GLANCEABLE_HUB when waking up due to power button press.
            verify(fakeCommunalSceneRepository)
                .instantlyTransitionTo(CommunalScenes.Communal, emptySet())
            verify(fakeCommunalSceneRepository).instantlyTransitionTo(CommunalScenes.Communal, null)
        }

    @Test
+1 −2
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@ import org.mockito.Mockito.clearInvocations
import org.mockito.Mockito.reset
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
import org.mockito.kotlin.any
import org.mockito.kotlin.anyOrNull
import org.mockito.kotlin.eq
import platform.test.runner.parameterized.ParameterizedAndroidJunit4
@@ -1476,7 +1475,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest
                )
            if (Flags.communalPowerTransitionFix()) {
                verify(communalSceneRepository)
                    .instantlyTransitionTo(eq(CommunalScenes.Blank), any())
                    .instantlyTransitionTo(eq(CommunalScenes.Blank), anyOrNull())
            } else {
                verify(communalSceneRepository).changeScene(eq(CommunalScenes.Blank), anyOrNull())
            }
+1 −1
Original line number Diff line number Diff line
@@ -137,6 +137,6 @@ constructor(

        override fun freezeAndAnimateToCurrentState() = Unit

        override fun instantlyTransitionTo(scene: SceneKey, overlays: Set<OverlayKey>) = Unit
        override fun instantlyTransitionTo(scene: SceneKey?, overlays: Set<OverlayKey>?) = Unit
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -84,9 +84,9 @@ interface SceneDataSource {
     *
     * The change is instantaneous and not animated; it will be observable in the next frame and
     * there will be no transition animation.
     *
     * When either one of [scene] or [overlays] is `null`, their current value in the scene
     * transition layout state is used.
     */
    fun instantlyTransitionTo(
        scene: SceneKey = currentScene.value,
        overlays: Set<OverlayKey> = currentOverlays.value,
    )
    fun instantlyTransitionTo(scene: SceneKey? = null, overlays: Set<OverlayKey>? = null)
}
Loading