From 78621e42566b860e55b0c64fa8017bead8b11fb8 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 17 Oct 2023 18:38:30 +0200 Subject: [PATCH] Pin: rename feature pin to lockscreen --- .../android/appnav/LoggedInFlowNode.kt | 24 +++++++++---------- .../{pin => lockscreen}/api/build.gradle.kts | 2 +- .../lockscreen/api/LockScreenEntryPoint.kt} | 4 ++-- .../lockscreen/api/LockScreenState.kt} | 8 +++---- .../lockscreen/api/LockScreenStateService.kt} | 6 ++--- .../{pin => lockscreen}/impl/build.gradle.kts | 4 ++-- .../impl/DefaultLockScreenEntryPoint.kt} | 8 +++---- .../lockscreen/impl/LockScreenFlowNode.kt} | 10 ++++---- .../impl}/auth/PinAuthenticationEvents.kt | 2 +- .../impl}/auth/PinAuthenticationNode.kt | 2 +- .../impl}/auth/PinAuthenticationPresenter.kt | 6 ++--- .../impl}/auth/PinAuthenticationState.kt | 2 +- .../auth/PinAuthenticationStateProvider.kt | 2 +- .../impl}/auth/PinAuthenticationView.kt | 2 +- .../impl}/create/CreatePinEvents.kt | 2 +- .../lockscreen/impl}/create/CreatePinNode.kt | 2 +- .../impl}/create/CreatePinPresenter.kt | 2 +- .../lockscreen/impl}/create/CreatePinState.kt | 2 +- .../impl}/create/CreatePinStateProvider.kt | 2 +- .../lockscreen/impl}/create/CreatePinView.kt | 2 +- .../impl/pin/DefaultPinCodeManager.kt | 4 ++-- .../lockscreen}/impl/pin/PinCodeManager.kt | 2 +- .../pin/storage/EncryptedPinCodeStorage.kt | 2 +- .../impl/pin/storage/PinCodeStore.kt | 2 +- .../storage/SharedPreferencesPinCodeStore.kt | 2 +- .../state/DefaultLockScreenStateService.kt} | 18 +++++++------- 26 files changed, 62 insertions(+), 62 deletions(-) rename features/{pin => lockscreen}/api/build.gradle.kts (92%) rename features/{pin/api/src/main/kotlin/io/element/android/features/pin/api/PinEntryPoint.kt => lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenEntryPoint.kt} (86%) rename features/{pin/api/src/main/kotlin/io/element/android/features/pin/api/PinState.kt => lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenState.kt} (78%) rename features/{pin/api/src/main/kotlin/io/element/android/features/pin/api/PinStateService.kt => lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenStateService.kt} (85%) rename features/{pin => lockscreen}/impl/build.gradle.kts (93%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/DefaultPinEntryPoint.kt => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/DefaultLockScreenEntryPoint.kt} (78%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/PinFlowNode.kt => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/LockScreenFlowNode.kt} (88%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/auth/PinAuthenticationEvents.kt (91%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/auth/PinAuthenticationNode.kt (95%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/auth/PinAuthenticationPresenter.kt (87%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/auth/PinAuthenticationState.kt (91%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/auth/PinAuthenticationStateProvider.kt (93%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/auth/PinAuthenticationView.kt (97%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/create/CreatePinEvents.kt (91%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/create/CreatePinNode.kt (95%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/create/CreatePinPresenter.kt (94%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/create/CreatePinState.kt (91%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/create/CreatePinStateProvider.kt (93%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl}/create/CreatePinView.kt (96%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen}/impl/pin/DefaultPinCodeManager.kt (94%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen}/impl/pin/PinCodeManager.kt (96%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen}/impl/pin/storage/EncryptedPinCodeStorage.kt (95%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen}/impl/pin/storage/PinCodeStore.kt (95%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen}/impl/pin/storage/SharedPreferencesPinCodeStore.kt (98%) rename features/{pin/impl/src/main/kotlin/io/element/android/features/pin/impl/state/DefaultPinStateService.kt => lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/state/DefaultLockScreenStateService.kt} (75%) diff --git a/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt b/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt index 82786b1a0c..2f7eabb582 100644 --- a/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt +++ b/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt @@ -50,9 +50,9 @@ import io.element.android.features.ftue.api.state.FtueState import io.element.android.features.invitelist.api.InviteListEntryPoint import io.element.android.features.networkmonitor.api.NetworkMonitor import io.element.android.features.networkmonitor.api.NetworkStatus -import io.element.android.features.pin.api.PinEntryPoint -import io.element.android.features.pin.api.PinState -import io.element.android.features.pin.api.PinStateService +import io.element.android.features.lockscreen.api.LockScreenEntryPoint +import io.element.android.features.lockscreen.api.LockScreenState +import io.element.android.features.lockscreen.api.LockScreenStateService import io.element.android.features.preferences.api.PreferencesEntryPoint import io.element.android.features.roomlist.api.RoomListEntryPoint import io.element.android.features.verifysession.api.VerifySessionEntryPoint @@ -93,8 +93,8 @@ class LoggedInFlowNode @AssistedInject constructor( private val networkMonitor: NetworkMonitor, private val notificationDrawerManager: NotificationDrawerManager, private val ftueState: FtueState, - private val pinEntryPoint: PinEntryPoint, - private val pinStateService: PinStateService, + private val lockScreenEntryPoint: LockScreenEntryPoint, + private val lockScreenStateService: LockScreenStateService, private val matrixClient: MatrixClient, snackbarDispatcher: SnackbarDispatcher, ) : BackstackNode( @@ -136,12 +136,12 @@ class LoggedInFlowNode @AssistedInject constructor( }, onResume = { coroutineScope.launch { - pinStateService.entersForeground() + lockScreenStateService.entersForeground() } }, onPause = { coroutineScope.launch { - pinStateService.entersBackground() + lockScreenStateService.entersBackground() } }, onStop = { @@ -218,7 +218,7 @@ class LoggedInFlowNode @AssistedInject constructor( createNode(buildContext) } NavTarget.LockPermanent -> { - pinEntryPoint.createNode(this, buildContext) + lockScreenEntryPoint.createNode(this, buildContext) } NavTarget.RoomList -> { val callback = object : RoomListEntryPoint.Callback { @@ -345,9 +345,9 @@ class LoggedInFlowNode @AssistedInject constructor( @Composable override fun View(modifier: Modifier) { Box(modifier = modifier) { - val pinState by pinStateService.pinState.collectAsState() - when (pinState) { - PinState.Unlocked -> { + val lockScreenState by lockScreenStateService.state.collectAsState() + when (lockScreenState) { + LockScreenState.Unlocked -> { Children( navModel = backstack, modifier = Modifier, @@ -359,7 +359,7 @@ class LoggedInFlowNode @AssistedInject constructor( PermanentChild(permanentNavModel = permanentNavModel, navTarget = NavTarget.LoggedInPermanent) } } - PinState.Locked -> { + LockScreenState.Locked -> { MoveActivityToBackgroundBackHandler() PermanentChild(permanentNavModel = permanentNavModel, navTarget = NavTarget.LockPermanent) } diff --git a/features/pin/api/build.gradle.kts b/features/lockscreen/api/build.gradle.kts similarity index 92% rename from features/pin/api/build.gradle.kts rename to features/lockscreen/api/build.gradle.kts index 95b062b0c8..97f472517c 100644 --- a/features/pin/api/build.gradle.kts +++ b/features/lockscreen/api/build.gradle.kts @@ -19,7 +19,7 @@ plugins { } android { - namespace = "io.element.android.features.pin.api" + namespace = "io.element.android.features.lockscreen.api" } dependencies { diff --git a/features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinEntryPoint.kt b/features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenEntryPoint.kt similarity index 86% rename from features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinEntryPoint.kt rename to features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenEntryPoint.kt index 1fe3caf574..3c9aceb2c8 100644 --- a/features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinEntryPoint.kt +++ b/features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenEntryPoint.kt @@ -14,8 +14,8 @@ * limitations under the License. */ -package io.element.android.features.pin.api +package io.element.android.features.lockscreen.api import io.element.android.libraries.architecture.SimpleFeatureEntryPoint -interface PinEntryPoint : SimpleFeatureEntryPoint +interface LockScreenEntryPoint : SimpleFeatureEntryPoint diff --git a/features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinState.kt b/features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenState.kt similarity index 78% rename from features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinState.kt rename to features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenState.kt index 0ff1b0b3d5..d1e53cfdcc 100644 --- a/features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinState.kt +++ b/features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenState.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.element.android.features.pin.api +package io.element.android.features.lockscreen.api -sealed interface PinState { - data object Unlocked : PinState - data object Locked : PinState +sealed interface LockScreenState { + data object Unlocked : LockScreenState + data object Locked : LockScreenState } diff --git a/features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinStateService.kt b/features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenStateService.kt similarity index 85% rename from features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinStateService.kt rename to features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenStateService.kt index 4ecb473c18..2f2e6b2376 100644 --- a/features/pin/api/src/main/kotlin/io/element/android/features/pin/api/PinStateService.kt +++ b/features/lockscreen/api/src/main/kotlin/io/element/android/features/lockscreen/api/LockScreenStateService.kt @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.element.android.features.pin.api +package io.element.android.features.lockscreen.api import kotlinx.coroutines.flow.StateFlow -interface PinStateService { - val pinState: StateFlow +interface LockScreenStateService { + val state: StateFlow suspend fun entersForeground() suspend fun entersBackground() diff --git a/features/pin/impl/build.gradle.kts b/features/lockscreen/impl/build.gradle.kts similarity index 93% rename from features/pin/impl/build.gradle.kts rename to features/lockscreen/impl/build.gradle.kts index e734035ab3..51e766bd36 100644 --- a/features/pin/impl/build.gradle.kts +++ b/features/lockscreen/impl/build.gradle.kts @@ -22,7 +22,7 @@ plugins { } android { - namespace = "io.element.android.features.pin.impl" + namespace = "io.element.android.features.lockscreen.impl" } anvil { @@ -32,7 +32,7 @@ anvil { dependencies { implementation(projects.anvilannotations) anvil(projects.anvilcodegen) - api(projects.features.pin.api) + api(projects.features.lockscreen.api) implementation(projects.libraries.core) implementation(projects.libraries.architecture) implementation(projects.libraries.matrix.api) diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/DefaultPinEntryPoint.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/DefaultLockScreenEntryPoint.kt similarity index 78% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/DefaultPinEntryPoint.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/DefaultLockScreenEntryPoint.kt index 17b7f6d612..736be374cd 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/DefaultPinEntryPoint.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/DefaultLockScreenEntryPoint.kt @@ -14,20 +14,20 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation +package io.element.android.features.lockscreen.impl import com.bumble.appyx.core.modality.BuildContext import com.bumble.appyx.core.node.Node import com.squareup.anvil.annotations.ContributesBinding -import io.element.android.features.pin.api.PinEntryPoint +import io.element.android.features.lockscreen.api.LockScreenEntryPoint import io.element.android.libraries.architecture.createNode import io.element.android.libraries.di.AppScope import javax.inject.Inject @ContributesBinding(AppScope::class) -class DefaultPinEntryPoint @Inject constructor() : PinEntryPoint { +class DefaultLockScreenEntryPoint @Inject constructor() : LockScreenEntryPoint { override fun createNode(parentNode: Node, buildContext: BuildContext): Node { - return parentNode.createNode(buildContext) + return parentNode.createNode(buildContext) } } diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/PinFlowNode.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/LockScreenFlowNode.kt similarity index 88% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/PinFlowNode.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/LockScreenFlowNode.kt index acf10ffcce..d2989d53cc 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/PinFlowNode.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/LockScreenFlowNode.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation +package io.element.android.features.lockscreen.impl import android.os.Parcelable import androidx.compose.runtime.Composable @@ -27,8 +27,8 @@ import com.bumble.appyx.navmodel.backstack.BackStack import dagger.assisted.Assisted import dagger.assisted.AssistedInject import io.element.android.anvilannotations.ContributesNode -import io.element.android.features.pin.impl.presentation.auth.PinAuthenticationNode -import io.element.android.features.pin.impl.presentation.create.CreatePinNode +import io.element.android.features.lockscreen.impl.auth.PinAuthenticationNode +import io.element.android.features.lockscreen.impl.create.CreatePinNode import io.element.android.libraries.architecture.BackstackNode import io.element.android.libraries.architecture.animation.rememberDefaultTransitionHandler import io.element.android.libraries.architecture.createNode @@ -36,10 +36,10 @@ import io.element.android.libraries.di.AppScope import kotlinx.parcelize.Parcelize @ContributesNode(AppScope::class) -class PinFlowNode @AssistedInject constructor( +class LockScreenFlowNode @AssistedInject constructor( @Assisted buildContext: BuildContext, @Assisted plugins: List, -) : BackstackNode( +) : BackstackNode( backstack = BackStack( initialElement = NavTarget.Auth, savedStateMap = buildContext.savedStateMap, diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationEvents.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationEvents.kt similarity index 91% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationEvents.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationEvents.kt index 01835df18c..f9f46c430a 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationEvents.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationEvents.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.auth +package io.element.android.features.lockscreen.impl.auth sealed interface PinAuthenticationEvents { data object Unlock : PinAuthenticationEvents diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationNode.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationNode.kt similarity index 95% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationNode.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationNode.kt index ec4b78dc15..d236d40cf1 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationNode.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationNode.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.auth +package io.element.android.features.lockscreen.impl.auth import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationPresenter.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationPresenter.kt similarity index 87% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationPresenter.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationPresenter.kt index bb1e5d04ad..ecc82f421c 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationPresenter.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationPresenter.kt @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.auth +package io.element.android.features.lockscreen.impl.auth import androidx.compose.runtime.Composable -import io.element.android.features.pin.api.PinStateService +import io.element.android.features.lockscreen.api.LockScreenStateService import io.element.android.libraries.architecture.Presenter import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import javax.inject.Inject class PinAuthenticationPresenter @Inject constructor( - private val pinStateService: PinStateService, + private val pinStateService: LockScreenStateService, private val coroutineScope: CoroutineScope, ) : Presenter { diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationState.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationState.kt similarity index 91% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationState.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationState.kt index 3d319356ec..387467534f 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationState.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationState.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.auth +package io.element.android.features.lockscreen.impl.auth data class PinAuthenticationState( val eventSink: (PinAuthenticationEvents) -> Unit diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationStateProvider.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationStateProvider.kt similarity index 93% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationStateProvider.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationStateProvider.kt index 3cfbe5cb84..a2612ed858 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationStateProvider.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationStateProvider.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.auth +package io.element.android.features.lockscreen.impl.auth import androidx.compose.ui.tooling.preview.PreviewParameterProvider diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationView.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationView.kt similarity index 97% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationView.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationView.kt index 9efab19813..2b62e46800 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/auth/PinAuthenticationView.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/auth/PinAuthenticationView.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.auth +package io.element.android.features.lockscreen.impl.auth import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinEvents.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinEvents.kt similarity index 91% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinEvents.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinEvents.kt index 87aee27557..deb3095e69 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinEvents.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinEvents.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.create +package io.element.android.features.lockscreen.impl.create sealed interface CreatePinEvents { object MyEvent : CreatePinEvents diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinNode.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinNode.kt similarity index 95% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinNode.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinNode.kt index 6b71510d5a..3689c0cc76 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinNode.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinNode.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.create +package io.element.android.features.lockscreen.impl.create import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinPresenter.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinPresenter.kt similarity index 94% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinPresenter.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinPresenter.kt index 8cfdc22e46..08ba24e074 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinPresenter.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinPresenter.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.create +package io.element.android.features.lockscreen.impl.create import androidx.compose.runtime.Composable import io.element.android.libraries.architecture.Presenter diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinState.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinState.kt similarity index 91% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinState.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinState.kt index 64c0ae0a5a..67311639ad 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinState.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinState.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.create +package io.element.android.features.lockscreen.impl.create data class CreatePinState( val eventSink: (CreatePinEvents) -> Unit diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinStateProvider.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinStateProvider.kt similarity index 93% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinStateProvider.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinStateProvider.kt index 0afe3442a2..a918b5193e 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinStateProvider.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinStateProvider.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.create +package io.element.android.features.lockscreen.impl.create import androidx.compose.ui.tooling.preview.PreviewParameterProvider diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinView.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinView.kt similarity index 96% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinView.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinView.kt index 643f487d1b..120c0b6079 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/presentation/create/CreatePinView.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinView.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.presentation.create +package io.element.android.features.lockscreen.impl.create import androidx.compose.foundation.layout.Box import androidx.compose.material3.MaterialTheme diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/DefaultPinCodeManager.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/DefaultPinCodeManager.kt similarity index 94% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/DefaultPinCodeManager.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/DefaultPinCodeManager.kt index 4ee1a530a2..e7e27bf5f3 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/DefaultPinCodeManager.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/DefaultPinCodeManager.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.pin +package io.element.android.features.lockscreen.impl.pin import com.squareup.anvil.annotations.ContributesBinding -import io.element.android.features.pin.impl.pin.storage.PinCodeStore +import io.element.android.features.lockscreen.impl.pin.storage.PinCodeStore import io.element.android.libraries.cryptography.api.CryptoService import io.element.android.libraries.cryptography.api.EncryptionResult import io.element.android.libraries.di.AppScope diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/PinCodeManager.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/PinCodeManager.kt similarity index 96% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/PinCodeManager.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/PinCodeManager.kt index df4262d9eb..960b6ecba1 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/PinCodeManager.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/PinCodeManager.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.pin +package io.element.android.features.lockscreen.impl.pin /** * This interface is the main interface to manage the pin code. diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/EncryptedPinCodeStorage.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/EncryptedPinCodeStorage.kt similarity index 95% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/EncryptedPinCodeStorage.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/EncryptedPinCodeStorage.kt index bf1dec8d0d..2345eaf481 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/EncryptedPinCodeStorage.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/EncryptedPinCodeStorage.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.pin.storage +package io.element.android.features.lockscreen.impl.pin.storage /** * Should be implemented by any class that provides access to the encrypted PIN code. diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/PinCodeStore.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/PinCodeStore.kt similarity index 95% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/PinCodeStore.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/PinCodeStore.kt index 3476890275..e72cbca2db 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/PinCodeStore.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/PinCodeStore.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.pin.storage +package io.element.android.features.lockscreen.impl.pin.storage interface PinCodeStore : EncryptedPinCodeStorage { diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/SharedPreferencesPinCodeStore.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/SharedPreferencesPinCodeStore.kt similarity index 98% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/SharedPreferencesPinCodeStore.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/SharedPreferencesPinCodeStore.kt index 892336f01d..dbeabb53ed 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/pin/storage/SharedPreferencesPinCodeStore.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/pin/storage/SharedPreferencesPinCodeStore.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.pin.storage +package io.element.android.features.lockscreen.impl.pin.storage import android.content.SharedPreferences import androidx.core.content.edit diff --git a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/state/DefaultPinStateService.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/state/DefaultLockScreenStateService.kt similarity index 75% rename from features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/state/DefaultPinStateService.kt rename to features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/state/DefaultLockScreenStateService.kt index 9accef2b80..dbfeca2c6a 100644 --- a/features/pin/impl/src/main/kotlin/io/element/android/features/pin/impl/state/DefaultPinStateService.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/state/DefaultLockScreenStateService.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.element.android.features.pin.impl.state +package io.element.android.features.lockscreen.impl.state import com.squareup.anvil.annotations.ContributesBinding -import io.element.android.features.pin.api.PinState -import io.element.android.features.pin.api.PinStateService +import io.element.android.features.lockscreen.api.LockScreenState +import io.element.android.features.lockscreen.api.LockScreenStateService import io.element.android.libraries.di.AppScope import io.element.android.libraries.di.SingleIn import io.element.android.libraries.featureflag.api.FeatureFlagService @@ -35,18 +35,18 @@ private const val GRACE_PERIOD_IN_MILLIS = 90 * 1000L @SingleIn(AppScope::class) @ContributesBinding(AppScope::class) -class DefaultPinStateService @Inject constructor( +class DefaultLockScreenStateService @Inject constructor( private val featureFlagService: FeatureFlagService, -) : PinStateService { +) : LockScreenStateService { - private val _pinState = MutableStateFlow(PinState.Unlocked) - override val pinState: StateFlow = _pinState + private val _lockScreenState = MutableStateFlow(LockScreenState.Unlocked) + override val state: StateFlow = _lockScreenState private var lockJob: Job? = null override suspend fun unlock() { if (featureFlagService.isFeatureEnabled(FeatureFlags.PinUnlock)) { - _pinState.value = PinState.Unlocked + _lockScreenState.value = LockScreenState.Unlocked } } @@ -58,7 +58,7 @@ class DefaultPinStateService @Inject constructor( lockJob = launch { if (featureFlagService.isFeatureEnabled(FeatureFlags.PinUnlock)) { delay(GRACE_PERIOD_IN_MILLIS) - _pinState.value = PinState.Locked + _lockScreenState.value = LockScreenState.Locked } } }