[BiometricsV2] Refactor AutoCredentialViewModel

Refactor AutoCredentialViewModelTest and FingerprintEnrollmentViewModel
to kotlin and change LiveData to Flow

Bug: 286197659
Test: atest -m CredentialModelTest
Test: atest -m AutoCredentialViewModelTest
Test: atest -m FingerprintEnrollmentViewModelTest
Test: atest -m FingerprintEnrollmentActivityTest
Test: atest -m biometrics-enrollment-test
Change-Id: I84bab0b46e023303c0046a6ae6886ab1cf9458b8
This commit is contained in:
Milton Wu
2023-07-24 16:29:20 +08:00
parent 78f3760d26
commit acb8be5d25
10 changed files with 1067 additions and 1164 deletions

View File

@@ -80,20 +80,6 @@ class CredentialModel(bundle: Bundle?, private val clock: Clock) {
val isValidToken: Boolean
get() = token != null
val bundle: Bundle
/**
* Get a bundle which can be used to recreate CredentialModel
*/
get() {
val bundle = Bundle()
bundle.putInt(EXTRA_USER_ID, userId)
bundle.putLong(EXTRA_KEY_CHALLENGE, challenge)
bundle.putByteArray(EXTRA_KEY_CHALLENGE_TOKEN, token)
bundle.putLong(EXTRA_KEY_GK_PW_HANDLE, gkPwHandle)
return bundle
}
/** Returns a string representation of the object */
override fun toString(): String {
val gkPwHandleLen = "$gkPwHandle".length