Status Update
Comments
kc...@google.com <kc...@google.com> #2
We'll need API sign-off to un-finalize FingerprintManagerCompat.
Since this requires API updates, this is probably in the scope of androidx.biometric-1.1.0
ap...@google.com <ap...@google.com> #3
Branch: androidx-master-dev
commit b3d71cea81fe04deb8a7578985bf6207679cdd26
Author: Curtis Belmonte <curtislb@google.com>
Date: Mon Jan 06 13:58:47 2020
Un-finalize FingerprintManagerCompat class
The FingerprintManagerCompat class is currently final, which developers
have called out as making it difficult to test dependent classes such as
BiometricPrompt. This class was made final in 2015, and the justification
at the time seems to have been a bit vague (see
unclear benefits and definite drawbacks, this commit updates the class
to be non-final.
Test: ./gradlew buildOnServer
Bug: 142545354
Change-Id: I6f9b4b530afbf3dacf06854553bb28fdbd1bd041
M core/core/api/1.3.0-alpha01.txt
M core/core/api/current.txt
M core/core/api/public_plus_experimental_1.3.0-alpha01.txt
M core/core/api/public_plus_experimental_current.txt
M core/core/api/restricted_1.3.0-alpha01.txt
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/hardware/fingerprint/FingerprintManagerCompat.java
[Deleted User] <[Deleted User]> #4
Which are the next steps on support biometric library testing?
I have a business logic with a KeyStore RSA key created with the setUserAuthenticated(true)
and setUserAuthenticationValidityDurationSeconds(-1)
and the use of the resulting authenticated CryptoObject
How can I bypass the BiometricPrompt.authenticate
checks for a lock screen and fingerprint enrolled?
In the emulator this is returning BiometricPrompt.ERROR_CANCELED
even with fingerprint and lock screen added because probably it doesn't find the fingerprint hardware.
In a CI environment with emulators I can't setup lock screen from command line.
I can do this: adb emu finger touch 1
to simulate a finger press but I don't have nothing to set a lock screen with PIN to reach the enrollment step.
Manually I can do this from test application:
val fingerprintEnrollIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
Intent(Settings.ACTION_FINGERPRINT_ENROLL)
} else {
//we don't have a specific action before P, we need to guide the user with dialogs
//and call canAuthenticate again to check if he really completed the procedure
Intent(Settings.ACTION_SECURITY_SETTINGS)
}
startActivityForResult(fingerprintEnrollIntent, REQUESTCODE_FINGERPRINT_ENROLLMENT)
but I don't have nothing to do this with command line and prepare an emulator for biometric instrumentation testing and even if there is a way I probably can't call adb emu finger touch 1
from an instrumentation test to authenticate in an emulator.
So there should be a "software" way to test biometric and not relaying on emulator configuration for this.
Are there solutions to this problem?
Thank you
Description
Here a few fundamentals that would make this easier.
#1 Allow instances of android.hardware.biometrics.BiometricPrompt, androidx.biometric.BiometricManager and FingerprintManagerCompat to be passed into androidx.biometric.BiometricPrompt
#2 Make FingerprintManagerCompat not final
Just that would go along way to enable testing.
To take it a step further, would be great to have implementations of
- FakeBiometricPrompt that extends android.hardware.biometrics.BiometricPrompt
- FakeFingerprintManagerCompat that extends FingerprintManagerCompat.
- FakeBiometricManager that extends androidx.biometric.BiometricManager
These "Fake" implementations with would have methods to simulate various biometric scenarios and various biometric user actions.
e.g. FakeFingerprintManagerCompat.touchSensorWithEnrolledFinger(), FakeFingerprintManagerCompat.touchSensorWithNonEnrolledFinger(), etc.