Loading packages/SystemUI/multivalentTests/src/com/android/systemui/communal/data/repository/CommunalRepositoryImplTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ class CommunalRepositoryImplTest : SysuiTestCase() { private val testScope = kosmos.testScope private val underTest by lazy { CommunalSceneRepositoryImpl( kosmos.applicationCoroutineScope, kosmos.applicationCoroutineScope, kosmos.sceneDataSource, ) Loading packages/SystemUI/src/com/android/systemui/communal/data/repository/CommunalSceneRepository.kt +13 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.compose.animation.scene.TransitionKey import com.android.systemui.communal.dagger.Communal import com.android.systemui.communal.shared.model.CommunalScenes import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.scene.shared.model.SceneDataSource import javax.inject.Inject Loading @@ -34,6 +35,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch /** Encapsulates the state of communal mode. */ interface CommunalSceneRepository { Loading Loading @@ -64,6 +66,7 @@ interface CommunalSceneRepository { class CommunalSceneRepositoryImpl @Inject constructor( @Application private val applicationScope: CoroutineScope, @Background backgroundScope: CoroutineScope, @Communal private val sceneDataSource: SceneDataSource, ) : CommunalSceneRepository { Loading @@ -82,12 +85,20 @@ constructor( ) override fun changeScene(toScene: SceneKey, transitionKey: TransitionKey?) { applicationScope.launch { // SceneTransitionLayout state updates must be triggered on the thread the STL was // created on. sceneDataSource.changeScene(toScene, transitionKey) } } override fun snapToScene(toScene: SceneKey) { applicationScope.launch { // SceneTransitionLayout state updates must be triggered on the thread the STL was // created on. sceneDataSource.snapToScene(toScene) } } /** * Updates the transition state of the hub [SceneTransitionLayout]. Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/communal/data/repository/CommunalRepositoryImplTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ class CommunalRepositoryImplTest : SysuiTestCase() { private val testScope = kosmos.testScope private val underTest by lazy { CommunalSceneRepositoryImpl( kosmos.applicationCoroutineScope, kosmos.applicationCoroutineScope, kosmos.sceneDataSource, ) Loading
packages/SystemUI/src/com/android/systemui/communal/data/repository/CommunalSceneRepository.kt +13 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.compose.animation.scene.TransitionKey import com.android.systemui.communal.dagger.Communal import com.android.systemui.communal.shared.model.CommunalScenes import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.scene.shared.model.SceneDataSource import javax.inject.Inject Loading @@ -34,6 +35,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch /** Encapsulates the state of communal mode. */ interface CommunalSceneRepository { Loading Loading @@ -64,6 +66,7 @@ interface CommunalSceneRepository { class CommunalSceneRepositoryImpl @Inject constructor( @Application private val applicationScope: CoroutineScope, @Background backgroundScope: CoroutineScope, @Communal private val sceneDataSource: SceneDataSource, ) : CommunalSceneRepository { Loading @@ -82,12 +85,20 @@ constructor( ) override fun changeScene(toScene: SceneKey, transitionKey: TransitionKey?) { applicationScope.launch { // SceneTransitionLayout state updates must be triggered on the thread the STL was // created on. sceneDataSource.changeScene(toScene, transitionKey) } } override fun snapToScene(toScene: SceneKey) { applicationScope.launch { // SceneTransitionLayout state updates must be triggered on the thread the STL was // created on. sceneDataSource.snapToScene(toScene) } } /** * Updates the transition state of the hub [SceneTransitionLayout]. Loading