Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ fun SceneContainer( if (sceneKey == currentSceneKey) { currentDestinations } else { composableScene.destinationScenes.value viewModel.resolveSceneFamilies(composableScene.destinationScenes.value) }, ) { with(composableScene) { Loading packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt +8 −1 Original line number Diff line number Diff line Loading @@ -330,9 +330,16 @@ constructor( * otherwise returns a singleton [Flow] containing [sceneKey]. */ fun resolveSceneFamily(sceneKey: SceneKey): Flow<SceneKey> = flow { emitAll(sceneFamilyResolvers.get()[sceneKey]?.resolvedScene ?: flowOf(sceneKey)) emitAll(resolveSceneFamilyOrNull(sceneKey) ?: flowOf(sceneKey)) } /** * Returns the [concrete scene][Scenes] for [sceneKey] if it is a [scene family][SceneFamilies], * otherwise returns `null`. */ fun resolveSceneFamilyOrNull(sceneKey: SceneKey): StateFlow<SceneKey>? = sceneFamilyResolvers.get()[sceneKey]?.resolvedScene private fun isVisibleInternal( raw: Boolean = repository.isVisible.value, isRemoteUserInteractionOngoing: Boolean = repository.isRemoteUserInteractionOngoing.value, Loading packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt +14 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,20 @@ constructor( } ?: true } /** * Immediately resolves any scene families present in [actionResultMap] to their current * resolution target. */ fun resolveSceneFamilies( actionResultMap: Map<UserAction, UserActionResult>, ): Map<UserAction, UserActionResult> { return actionResultMap.mapValues { (_, actionResult) -> sceneInteractor.resolveSceneFamilyOrNull(actionResult.toScene)?.value?.let { actionResult.copy(toScene = it) } ?: actionResult } } private fun replaceSceneFamilies( destinationScenes: Map<UserAction, UserActionResult>, ): Flow<Map<UserAction, UserActionResult>> { Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ fun SceneContainer( if (sceneKey == currentSceneKey) { currentDestinations } else { composableScene.destinationScenes.value viewModel.resolveSceneFamilies(composableScene.destinationScenes.value) }, ) { with(composableScene) { Loading
packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt +8 −1 Original line number Diff line number Diff line Loading @@ -330,9 +330,16 @@ constructor( * otherwise returns a singleton [Flow] containing [sceneKey]. */ fun resolveSceneFamily(sceneKey: SceneKey): Flow<SceneKey> = flow { emitAll(sceneFamilyResolvers.get()[sceneKey]?.resolvedScene ?: flowOf(sceneKey)) emitAll(resolveSceneFamilyOrNull(sceneKey) ?: flowOf(sceneKey)) } /** * Returns the [concrete scene][Scenes] for [sceneKey] if it is a [scene family][SceneFamilies], * otherwise returns `null`. */ fun resolveSceneFamilyOrNull(sceneKey: SceneKey): StateFlow<SceneKey>? = sceneFamilyResolvers.get()[sceneKey]?.resolvedScene private fun isVisibleInternal( raw: Boolean = repository.isVisible.value, isRemoteUserInteractionOngoing: Boolean = repository.isRemoteUserInteractionOngoing.value, Loading
packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt +14 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,20 @@ constructor( } ?: true } /** * Immediately resolves any scene families present in [actionResultMap] to their current * resolution target. */ fun resolveSceneFamilies( actionResultMap: Map<UserAction, UserActionResult>, ): Map<UserAction, UserActionResult> { return actionResultMap.mapValues { (_, actionResult) -> sceneInteractor.resolveSceneFamilyOrNull(actionResult.toScene)?.value?.let { actionResult.copy(toScene = it) } ?: actionResult } } private fun replaceSceneFamilies( destinationScenes: Map<UserAction, UserActionResult>, ): Flow<Map<UserAction, UserActionResult>> { Loading