AdvancedBiometricPromptCompat icon indicating copy to clipboard operation
AdvancedBiometricPromptCompat copied to clipboard

Incorrect behavior of face authentication on Honor Play device

Open sandboiii opened this issue 2 years ago • 15 comments

Device: Honor Play Android version: 9 There are problems with face authentication on Honor Play. The dialog displays text about fingerprint scanner even though biometric type is BIOMETRIC_FACE and authentication not working on this device.

Video:

https://user-images.githubusercontent.com/17468894/168077078-d8ac97fe-aa5e-4dd0-a1bb-af788b911660.mp4

Logs:

log1.txt log2.txt

sandboiii avatar May 12 '22 12:05 sandboiii

The library does not develop directly for Honor, but as I know, cause Honor is a sub-brand of Huawei, I expect that some API's can also be accessible on Honor devices. I'll try to investigate why FaceId doesn't work on Honor, I hope it's some minor changes.

Due to texts - used 'system' terma that exists in com.android.internal.R$string. Probably I need to get a dump from some Huawei/Honor device to get more realistic strings ID's, cause now used 'default' for fingerprint/biometric

sergeykomlach avatar May 16 '22 13:05 sergeykomlach

In log2.txt there are lines:

FaceCamera - Occurs error validateClientPermissionsLocked:1066: Caller "dev.skomlach.biometric.app" (PID 10176, UID 6983) cannot open camera "1" without camera permission

So, it seems like permission problem

sandboiii avatar May 16 '22 13:05 sandboiii

Okay, can you try test APK with Camera permission request? https://github.com/sergeykomlach/AdvancedBiometricPromptCompat/blob/main/app/app-debug.apk

sergeykomlach avatar May 18 '22 09:05 sergeykomlach

Nothing changed. First time there was a face dialog which didn't authenticate. And second time it was just HARDWARE_UNAVAILABLE error
log.txt

sandboiii avatar May 18 '22 14:05 sandboiii

@sandboiii sorry for late response. I start fixing device specific issues, and problem with Honor Play now in work. Can you try to test APK on your device?

sergeykomlach avatar Sep 04 '22 16:09 sergeykomlach

Hey, text about fingerprint is fixed, but face biometric still doesn't work. Some events like [CheckBiometric.onUIOpened()] are missing from logs for unknown reason.

https://user-images.githubusercontent.com/17468894/188454070-9ce43a80-3a8a-4a84-90ac-92b84cf13760.mp4

cor-l29.txt cor-l29-2.txt cor-l29-3.txt

sandboiii avatar Sep 05 '22 12:09 sandboiii

I also tested face biometric on huawei p50 pro and it also doesn't work both current main branch and apk which you provided. But at least there are more logs with all events.

https://user-images.githubusercontent.com/17468894/188453381-6cd983d3-0695-4765-9550-946612aba4fb.mp4

p50-pro-main.txt p50-pro-gdrive.txt

sandboiii avatar Sep 05 '22 12:09 sandboiii

@sandboiii Let's try step-by-step :)

  1. Honor Play - yes, the title should be fixed. Also from the video, I noticed that, at least, failed face recognition events were delivered to UI. Still not clear is possible to re-run the BiometricAuth flow -previously HARDWARE_NOT_AVAILABLE error happens. In two words: On Huawei/Honor devices we have 2 FaceManagers - "Huawei3dFaceManager" and "legacy" FaceManager. See code

From the logs from May 12, it seems like Honor Play was able to obtain both of them, but used "3dFace" in this case. But "legacy" implementation is still able to "listen" for events. In the test APK that I provide, I keep only "legacy" FaceManager to get maybe some progress or degradation in comparison with old implementation. So the next step - probably make sense to create a build only with "Huawei3dFaceManager" and check it too.

  1. Huawei P50 Pro: This is another case. From the video - I see the issue with the device model (and sensors).

But according to toast with "onSuccess Confirmed=BIOMETRIC_FACE" the FaceUnlock works pretty well and very fast.

Screenshot from video

sergeykomlach avatar Sep 05 '22 14:09 sergeykomlach

Yeah, sorry about p50 😬. I actually asked another person to test this app and they didn't know what was supposed to happen. So they said that it didn't work, but actually it does.

sandboiii avatar Sep 06 '22 07:09 sandboiii

@sandboiii I see :) Okay, let's close the issue about Huawei P50) If back to Honor Play. I prepare the build Huawei3DFaceManager.APK - plz check it, and some difference in behavior I hope we will notice. Thank you

sergeykomlach avatar Sep 06 '22 19:09 sergeykomlach

Face auth seems to be working successfully, however person who tested this said that authentication succeeds even if you close the camera with your finger or if you turn screen away from your face. Also send logs button crashes the app, so they couldn't provide the logs. I will attach logcat stacktrace soon.

https://user-images.githubusercontent.com/17468894/189064000-35cb7b77-34d3-4c9e-af07-be56afd51bf8.mp4

sandboiii avatar Sep 08 '22 07:09 sandboiii

Not very clear - user cancel dialog or "manager" do this. I don't see any fails/errors/success-related Toasts :(

sergeykomlach avatar Sep 09 '22 16:09 sergeykomlach

@sandboiii any new tests/logs from the latest build?

sergeykomlach avatar Sep 12 '22 06:09 sergeykomlach

I hope to get it this week, please wait a little bit more

sandboiii avatar Sep 14 '22 13:09 sandboiii

Here are the logs, crash doesn't happen anymore cor-l29 Huawei3dFaceManager.txt

sandboiii avatar Sep 15 '22 12:09 sandboiii