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

Commit 96ceea46 authored by Ale Nijamkin's avatar Ale Nijamkin Committed by Automerger Merge Worker
Browse files

Merge "[flexiglass] Lock screen -> Lockscreen." into udc-dev am: 32becff0 am: 94fd6ffc

parents 22df8641 94fd6ffc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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()
+8 −8
Original line number Diff line number Diff line
@@ -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
@@ -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
@@ -69,7 +69,7 @@ constructor(
    override fun Content(
        modifier: Modifier,
    ) {
        LockScreenScene(
        LockscreenScene(
            viewModel = viewModel,
            modifier = modifier,
        )
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ constructor(
                            is AuthenticationMethodModel.Swipe ->
                                sceneInteractor.setCurrentScene(
                                    containerName,
                                    SceneModel(SceneKey.LockScreen),
                                    SceneModel(SceneKey.Lockscreen),
                                )
                            else -> Unit
                        }
+17 −17
Original line number Diff line number Diff line
@@ -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,
@@ -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 {
@@ -92,7 +92,7 @@ constructor(
                    if (isLocked) {
                        sceneInteractor.setCurrentScene(
                            containerName = containerName,
                            scene = SceneModel(SceneKey.LockScreen),
                            scene = SceneModel(SceneKey.Lockscreen),
                        )
                    }
                }
@@ -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),
@@ -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.
@@ -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()
@@ -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.
@@ -153,7 +153,7 @@ constructor(
                )
                .collect { (authMethod, scene) ->
                    if (
                        scene.key == SceneKey.LockScreen &&
                        scene.key == SceneKey.Lockscreen &&
                            authMethod == AuthenticationMethodModel.None
                    ) {
                        sceneInteractor.setCurrentScene(
@@ -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)
    }

@@ -181,6 +181,6 @@ constructor(
    interface Factory {
        fun create(
            containerName: String,
        ): LockScreenSceneInteractor
        ): LockscreenSceneInteractor
    }
}
+9 −9
Original line number Diff line number Diff line
@@ -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
@@ -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> =
@@ -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(
@@ -103,6 +103,6 @@ constructor(
    interface Factory {
        fun create(
            containerName: String,
        ): LockScreenSceneViewModel
        ): LockscreenSceneViewModel
    }
}
Loading