Feature/fga/biometric unlock (#1702)

* Biometric unlock : refactor a bit existing classes

* Biometric unlock : first implementation

* Biometric: add ui for biometric setup

* Biometric unlock : use localazy strings

* Biometric unlock setup : branch skip/allow events

* Biometric : fix tests

* Biometrics: add small test

* Biometric : clean up

* Update screenshots

* Biometric unlock : address some PR review

* Biometric : improve a bit edge cases

* Fix lint issues

---------

Co-authored-by: ganfra <francoisg@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Jorge Martín <jorgem@element.io>
This commit is contained in:
ganfra 2023-10-31 19:22:43 +01:00 committed by GitHub
parent 8535517b25
commit 6832b1f2db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 1270 additions and 107 deletions

View file

@ -20,6 +20,8 @@ import com.squareup.anvil.annotations.ContributesTo
import dagger.Module
import dagger.Provides
import io.element.android.libraries.di.AppScope
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds
/**
* Configuration for the lock screen feature.
@ -48,7 +50,16 @@ data class LockScreenConfig(
/**
* Time period before locking the app once backgrounded.
*/
val gracePeriodInMillis: Long
val gracePeriod: Duration,
/**
* Authentication with strong methods (fingerprint, some face/iris unlock implementations) is supported.
*/
val isStrongBiometricsEnabled: Boolean,
/**
* Authentication with weak methods (most face/iris unlock implementations) is supported.
*/
val isWeakBiometricsEnabled: Boolean,
)
@ContributesTo(AppScope::class)
@ -61,6 +72,8 @@ object LockScreenConfigModule {
pinBlacklist = setOf("0000", "1234"),
pinSize = 4,
maxPinCodeAttemptsBeforeLogout = 3,
gracePeriodInMillis = 90_000L
gracePeriod = 90.seconds,
isStrongBiometricsEnabled = true,
isWeakBiometricsEnabled = true,
)
}