infinum / Android-Goldfinger

Android library to simplify Biometric authentication implementation.
Apache License 2.0
653 stars 73 forks source link

Xiaomi Pocophone F1 OnAuthenticationHelp return 1021 helpMessageId #46

Closed eugeneroz closed 5 years ago

eugeneroz commented 5 years ago

Issue occur on Xiaomi Pocophone F1 device. CancelableAuthenticationCallback has the following code: @Override public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) { Error error = Error.fromFingerprintHelp(helpMsgId); if (!cancellationSignal.isCanceled()) { onError(error); } } helpMsgId returns value 1021 and it's mapped to FAILURE error.

domagojkorman commented 5 years ago

Hi @eugeneroz ,

Thanks for the report, this is an issue that should not happen. Will fix it for next release.

domagojkorman commented 5 years ago

Hi @eugeneroz ,

I just looked into this and what happens is that helpMsgId is 1021 which is not recognized by FingerprintManagerCompat. The fallback for that behavior is FAILURE error which is non-critical.

What behavior would you expect?

eugeneroz commented 5 years ago

FingerprintManager#onAuthenticationHelp called with helpMsgId=1021. This is not error, but some information. Therefore, I expect that SDK will deliver to app level the information from the system. What shouldn't be is that such information will be mapped to error.

domagojkorman commented 5 years ago

Fixed in version 1.2.0.

I suggest to take a look at Result.

This specific case will return

Result {
  type=Type.INFO,
  reason=Reason.UNKNOWN,
  value=[null],
  message=??? (I am not sure what the system returns for this specific helpId, if the message exists it will be inside this field)
}

Closing issue.