@ -57,25 +57,24 @@ class DefaultLockScreenService @Inject constructor(
@@ -57,25 +57,24 @@ class DefaultLockScreenService @Inject constructor(
private val appForegroundStateService : AppForegroundStateService ,
private val biometricUnlockManager : BiometricUnlockManager ,
) : LockScreenService {
private val _lockScreenState = MutableStateFlow < LockScreenLockState > ( LockScreenLockState . Unlocked )
override val lockState : StateFlow < LockScreenLockState > = _lockScreenState
private val _lockState = MutableStateFlow < LockScreenLockState > ( LockScreenLockState . Unlocked )
override val lockState : StateFlow < LockScreenLockState > = _lockState
private var lockJob : Job ? = null
init {
pinCodeManager . addCallback ( object : DefaultPinCodeManagerCallback ( ) {
override fun onPinCodeVerified ( ) {
_lockScreenS tate . value = LockScreenLockState . Unlocked
_lockState . value = LockScreenLockState . Unlocked
}
override fun onPinCodeRemoved ( ) {
_lockScreenS tate . value = LockScreenLockState . Unlocked
_lockState . value = LockScreenLockState . Unlocked
}
} )
biometricUnlockManager . addCallback ( object : DefaultBiometricUnlockCallback ( ) {
override fun onBiometricUnlockSuccess ( ) {
_lockScreenS tate . value = LockScreenLockState . Unlocked
_lockState . value = LockScreenLockState . Unlocked
coroutineScope . launch {
lockScreenStore . resetCounter ( )
}
@ -91,7 +90,6 @@ class DefaultLockScreenService @Inject constructor(
@@ -91,7 +90,6 @@ class DefaultLockScreenService @Inject constructor(
* /
private fun observeSessionsState ( ) {
sessionObserver . addListener ( object : SessionListener {
override suspend fun onSessionCreated ( userId : String ) = Unit
override suspend fun onSessionDeleted ( userId : String ) {
@ -135,7 +133,7 @@ class DefaultLockScreenService @Inject constructor(
@@ -135,7 +133,7 @@ class DefaultLockScreenService @Inject constructor(
private fun CoroutineScope . lockIfNeeded ( gracePeriod : Duration = Duration . ZERO ) = launch {
if ( isPinSetup ( ) . first ( ) ) {
delay ( gracePeriod )
_lockScreenS tate . value = LockScreenLockState . Locked
_lockState . value = LockScreenLockState . Locked
}
}
}