New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support all authentication results for BiometricManager #7427
Support all authentication results for BiometricManager #7427
Conversation
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
@charlesng Could you help to squash two commits to one and follow https://github.com/robolectric/robolectric/wiki/Running-google-java-format to apply google java format to your commit? |
robolectric/src/test/java/org/robolectric/shadows/ShadowBiometricManagerTest.java
Show resolved
Hide resolved
robolectric/src/test/java/org/robolectric/shadows/ShadowBiometricManagerTest.java
Outdated
Show resolved
Hide resolved
robolectric/src/test/java/org/robolectric/shadows/ShadowBiometricManagerTest.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
969f50b
to
8fdd360
Compare
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
@utzcoz I have resolved the comments and feel free to check when you are free 馃檹 |
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBiometricManager.java
Outdated
Show resolved
Hide resolved
@charlesng Could you squash commits to one? Thanks. |
0be52be
to
613e3ac
Compare
@utzcoz I have squashed the commits to one, feel free to check when you are free 馃檱 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Hi @hoisie , could you help to take look at this PR? Thanks. |
} | ||
} | ||
} | ||
|
||
@RequiresPermission(USE_BIOMETRIC) | ||
@Implementation | ||
protected int canAuthenticate(int authenticators) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am seeing the error:
error: No such method in android.hardware.biometrics.BiometricManager for SDK 29
protected int canAuthenticate(int authenticators) {
Is this minSdk = R as well?
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing. @charlesng Could you rebase and check this problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this method required minSdk = 30 as well, https://developer.android.com/reference/android/hardware/biometrics/BiometricManager#canAuthenticate(int)
I have updated it. Thanks for the review.
Btw, @hoisie could I ask how did you see the error? As I cannot see error before in both Android Studio and CI 馃檹
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done with the sdkCheckMode
param:
https://github.com/robolectric/robolectric/blob/master/shadows/framework/build.gradle#L11
For some reason it's either not working in gradle or it's not causing a compile-time error.
I am also running tests internally at Google to check for compatibility issues |
613e3ac
to
2047986
Compare
Thanks! |
Overview
For #7214
Hello, this is my first PR to robolectric, and would like to contribute it 馃檱 Appreciate any comment or advices if you have.
Proposed Changes
int canAuthenticate
in BiometricManager andint canAuthenticate(int userId, int authenticators)
setEnrolledBiometrics
,hasHardware
,setAuthenticatorType
,requireSecurityUpdate
to control different biometric result