Loading packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerScene.kt +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ constructor( override fun destinationScenes(): StateFlow<Map<UserAction, SceneModel>> = MutableStateFlow<Map<UserAction, SceneModel>>( mapOf( UserAction.Back to SceneModel(SceneKey.LockScreen), UserAction.Back to SceneModel(SceneKey.Lockscreen), ) ) .asStateFlow() Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockScreenScene.kt→packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenScene.kt +8 −8 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import com.android.systemui.common.shared.model.Icon import com.android.systemui.common.ui.compose.Icon import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.ui.viewmodel.LockScreenSceneViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenSceneViewModel import com.android.systemui.scene.shared.model.Direction import com.android.systemui.scene.shared.model.SceneKey import com.android.systemui.scene.shared.model.SceneModel Loading @@ -48,13 +48,13 @@ import kotlinx.coroutines.flow.stateIn /** The lock screen scene shows when the device is locked. */ @SysUISingleton class LockScreenScene class LockscreenScene @Inject constructor( @Application private val applicationScope: CoroutineScope, private val viewModel: LockScreenSceneViewModel, private val viewModel: LockscreenSceneViewModel, ) : ComposableScene { override val key = SceneKey.LockScreen override val key = SceneKey.Lockscreen override fun destinationScenes(): StateFlow<Map<UserAction, SceneModel>> = viewModel.upDestinationSceneKey Loading @@ -69,7 +69,7 @@ constructor( override fun Content( modifier: Modifier, ) { LockScreenScene( LockscreenScene( viewModel = viewModel, modifier = modifier, ) Loading @@ -86,8 +86,8 @@ constructor( } @Composable private fun LockScreenScene( viewModel: LockScreenSceneViewModel, private fun LockscreenScene( viewModel: LockscreenSceneViewModel, modifier: Modifier = Modifier, ) { // TODO(b/280879610): implement the real UI. Loading packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ constructor( is AuthenticationMethodModel.Swipe -> sceneInteractor.setCurrentScene( containerName, SceneModel(SceneKey.LockScreen), SceneModel(SceneKey.Lockscreen), ) else -> Unit } Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LockScreenSceneInteractor.kt→packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LockscreenSceneInteractor.kt +17 −17 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch /** Hosts business and application state accessing logic for the lockscreen scene. */ class LockScreenSceneInteractor class LockscreenSceneInteractor @AssistedInject constructor( @Application applicationScope: CoroutineScope, Loading Loading @@ -81,7 +81,7 @@ constructor( ) init { // LOCKING SHOWS LOCK SCREEN. // LOCKING SHOWS Lockscreen. // // Move to the lockscreen scene if the device becomes locked while in any scene. applicationScope.launch { Loading @@ -92,7 +92,7 @@ constructor( if (isLocked) { sceneInteractor.setCurrentScene( containerName = containerName, scene = SceneModel(SceneKey.LockScreen), scene = SceneModel(SceneKey.Lockscreen), ) } } Loading @@ -110,7 +110,7 @@ constructor( ::Triple, ) .collect { (isBypassEnabled, isUnlocked, currentScene) -> if (isBypassEnabled && isUnlocked && currentScene.key == SceneKey.LockScreen) { if (isBypassEnabled && isUnlocked && currentScene.key == SceneKey.Lockscreen) { sceneInteractor.setCurrentScene( containerName = containerName, scene = SceneModel(SceneKey.Gone), Loading @@ -119,7 +119,7 @@ constructor( } } // SWIPE TO DISMISS LOCK SCREEN. // SWIPE TO DISMISS Lockscreen. // // If switched from the lockscreen to the gone scene and the auth method was a swipe, // unlocks the device. Loading @@ -133,7 +133,7 @@ constructor( val (previousScene, currentScene) = scenes if ( authMethod is AuthenticationMethodModel.Swipe && previousScene.key == SceneKey.LockScreen && previousScene.key == SceneKey.Lockscreen && currentScene.key == SceneKey.Gone ) { authenticationInteractor.unlockDevice() Loading @@ -141,7 +141,7 @@ constructor( } } // DISMISS LOCK SCREEN IF AUTH METHOD IS REMOVED. // DISMISS Lockscreen IF AUTH METHOD IS REMOVED. // // If the auth method becomes None while on the lockscreen scene, dismisses the lock // screen. Loading @@ -153,7 +153,7 @@ constructor( ) .collect { (authMethod, scene) -> if ( scene.key == SceneKey.LockScreen && scene.key == SceneKey.Lockscreen && authMethod == AuthenticationMethodModel.None ) { sceneInteractor.setCurrentScene( Loading @@ -166,7 +166,7 @@ constructor( } /** Attempts to dismiss the lockscreen. This will cause the bouncer to show, if needed. */ fun dismissLockScreen() { fun dismissLockscreen() { bouncerInteractor.showOrUnlockDevice(containerName = containerName) } Loading @@ -181,6 +181,6 @@ constructor( interface Factory { fun create( containerName: String, ): LockScreenSceneInteractor ): LockscreenSceneInteractor } } packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockScreenSceneViewModel.kt→packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenSceneViewModel.kt +9 −9 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ import com.android.systemui.R import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.domain.interactor.LockScreenSceneInteractor import com.android.systemui.keyguard.domain.interactor.LockscreenSceneInteractor import com.android.systemui.scene.shared.model.SceneKey import dagger.assisted.Assisted import dagger.assisted.AssistedFactory Loading @@ -32,14 +32,14 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn /** Models UI state and handles user input for the lockscreen scene. */ class LockScreenSceneViewModel class LockscreenSceneViewModel @AssistedInject constructor( @Application applicationScope: CoroutineScope, interactorFactory: LockScreenSceneInteractor.Factory, interactorFactory: LockscreenSceneInteractor.Factory, @Assisted containerName: String, ) { private val interactor: LockScreenSceneInteractor = interactorFactory.create(containerName) private val interactor: LockscreenSceneInteractor = interactorFactory.create(containerName) /** The icon for the "lock" button on the lockscreen. */ val lockButtonIcon: StateFlow<Icon> = Loading @@ -63,12 +63,12 @@ constructor( /** Notifies that the lock button on the lock screen was clicked. */ fun onLockButtonClicked() { interactor.dismissLockScreen() interactor.dismissLockscreen() } /** Notifies that some content on the lock screen was clicked. */ fun onContentClicked() { interactor.dismissLockScreen() interactor.dismissLockscreen() } private fun upDestinationSceneKey( Loading Loading @@ -103,6 +103,6 @@ constructor( interface Factory { fun create( containerName: String, ): LockScreenSceneViewModel ): LockscreenSceneViewModel } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerScene.kt +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ constructor( override fun destinationScenes(): StateFlow<Map<UserAction, SceneModel>> = MutableStateFlow<Map<UserAction, SceneModel>>( mapOf( UserAction.Back to SceneModel(SceneKey.LockScreen), UserAction.Back to SceneModel(SceneKey.Lockscreen), ) ) .asStateFlow() Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockScreenScene.kt→packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenScene.kt +8 −8 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import com.android.systemui.common.shared.model.Icon import com.android.systemui.common.ui.compose.Icon import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.ui.viewmodel.LockScreenSceneViewModel import com.android.systemui.keyguard.ui.viewmodel.LockscreenSceneViewModel import com.android.systemui.scene.shared.model.Direction import com.android.systemui.scene.shared.model.SceneKey import com.android.systemui.scene.shared.model.SceneModel Loading @@ -48,13 +48,13 @@ import kotlinx.coroutines.flow.stateIn /** The lock screen scene shows when the device is locked. */ @SysUISingleton class LockScreenScene class LockscreenScene @Inject constructor( @Application private val applicationScope: CoroutineScope, private val viewModel: LockScreenSceneViewModel, private val viewModel: LockscreenSceneViewModel, ) : ComposableScene { override val key = SceneKey.LockScreen override val key = SceneKey.Lockscreen override fun destinationScenes(): StateFlow<Map<UserAction, SceneModel>> = viewModel.upDestinationSceneKey Loading @@ -69,7 +69,7 @@ constructor( override fun Content( modifier: Modifier, ) { LockScreenScene( LockscreenScene( viewModel = viewModel, modifier = modifier, ) Loading @@ -86,8 +86,8 @@ constructor( } @Composable private fun LockScreenScene( viewModel: LockScreenSceneViewModel, private fun LockscreenScene( viewModel: LockscreenSceneViewModel, modifier: Modifier = Modifier, ) { // TODO(b/280879610): implement the real UI. Loading
packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ constructor( is AuthenticationMethodModel.Swipe -> sceneInteractor.setCurrentScene( containerName, SceneModel(SceneKey.LockScreen), SceneModel(SceneKey.Lockscreen), ) else -> Unit } Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LockScreenSceneInteractor.kt→packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LockscreenSceneInteractor.kt +17 −17 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch /** Hosts business and application state accessing logic for the lockscreen scene. */ class LockScreenSceneInteractor class LockscreenSceneInteractor @AssistedInject constructor( @Application applicationScope: CoroutineScope, Loading Loading @@ -81,7 +81,7 @@ constructor( ) init { // LOCKING SHOWS LOCK SCREEN. // LOCKING SHOWS Lockscreen. // // Move to the lockscreen scene if the device becomes locked while in any scene. applicationScope.launch { Loading @@ -92,7 +92,7 @@ constructor( if (isLocked) { sceneInteractor.setCurrentScene( containerName = containerName, scene = SceneModel(SceneKey.LockScreen), scene = SceneModel(SceneKey.Lockscreen), ) } } Loading @@ -110,7 +110,7 @@ constructor( ::Triple, ) .collect { (isBypassEnabled, isUnlocked, currentScene) -> if (isBypassEnabled && isUnlocked && currentScene.key == SceneKey.LockScreen) { if (isBypassEnabled && isUnlocked && currentScene.key == SceneKey.Lockscreen) { sceneInteractor.setCurrentScene( containerName = containerName, scene = SceneModel(SceneKey.Gone), Loading @@ -119,7 +119,7 @@ constructor( } } // SWIPE TO DISMISS LOCK SCREEN. // SWIPE TO DISMISS Lockscreen. // // If switched from the lockscreen to the gone scene and the auth method was a swipe, // unlocks the device. Loading @@ -133,7 +133,7 @@ constructor( val (previousScene, currentScene) = scenes if ( authMethod is AuthenticationMethodModel.Swipe && previousScene.key == SceneKey.LockScreen && previousScene.key == SceneKey.Lockscreen && currentScene.key == SceneKey.Gone ) { authenticationInteractor.unlockDevice() Loading @@ -141,7 +141,7 @@ constructor( } } // DISMISS LOCK SCREEN IF AUTH METHOD IS REMOVED. // DISMISS Lockscreen IF AUTH METHOD IS REMOVED. // // If the auth method becomes None while on the lockscreen scene, dismisses the lock // screen. Loading @@ -153,7 +153,7 @@ constructor( ) .collect { (authMethod, scene) -> if ( scene.key == SceneKey.LockScreen && scene.key == SceneKey.Lockscreen && authMethod == AuthenticationMethodModel.None ) { sceneInteractor.setCurrentScene( Loading @@ -166,7 +166,7 @@ constructor( } /** Attempts to dismiss the lockscreen. This will cause the bouncer to show, if needed. */ fun dismissLockScreen() { fun dismissLockscreen() { bouncerInteractor.showOrUnlockDevice(containerName = containerName) } Loading @@ -181,6 +181,6 @@ constructor( interface Factory { fun create( containerName: String, ): LockScreenSceneInteractor ): LockscreenSceneInteractor } }
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockScreenSceneViewModel.kt→packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenSceneViewModel.kt +9 −9 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ import com.android.systemui.R import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.domain.interactor.LockScreenSceneInteractor import com.android.systemui.keyguard.domain.interactor.LockscreenSceneInteractor import com.android.systemui.scene.shared.model.SceneKey import dagger.assisted.Assisted import dagger.assisted.AssistedFactory Loading @@ -32,14 +32,14 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn /** Models UI state and handles user input for the lockscreen scene. */ class LockScreenSceneViewModel class LockscreenSceneViewModel @AssistedInject constructor( @Application applicationScope: CoroutineScope, interactorFactory: LockScreenSceneInteractor.Factory, interactorFactory: LockscreenSceneInteractor.Factory, @Assisted containerName: String, ) { private val interactor: LockScreenSceneInteractor = interactorFactory.create(containerName) private val interactor: LockscreenSceneInteractor = interactorFactory.create(containerName) /** The icon for the "lock" button on the lockscreen. */ val lockButtonIcon: StateFlow<Icon> = Loading @@ -63,12 +63,12 @@ constructor( /** Notifies that the lock button on the lock screen was clicked. */ fun onLockButtonClicked() { interactor.dismissLockScreen() interactor.dismissLockscreen() } /** Notifies that some content on the lock screen was clicked. */ fun onContentClicked() { interactor.dismissLockScreen() interactor.dismissLockscreen() } private fun upDestinationSceneKey( Loading Loading @@ -103,6 +103,6 @@ constructor( interface Factory { fun create( containerName: String, ): LockScreenSceneViewModel ): LockscreenSceneViewModel } }