Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
- A bugreport immediately after the issue occurs.
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).
BUILD INFO
- Device type: Android Studio Giraffe 2022.3.1 Patch 4 - Android Emulator 32.1.15
- OS version: API-33
- Biometric library version: 1.1.0
STEPS TO REPRODUCE
[Be as specific as possible please]
1. Invoke `BiometricPrompt.authenticate(PromptInfo)` from a thread that is not the UI thread.
EXPECTED RESULTS
- The method works as expected.
OBSERVED RESULTS
- The `FragmentManager` used by the library implementation detects a threading problem and aborts the operation.
NUMBER OF TIMES YOU WERE ABLE TO REPRODUCE (e.g. 3/10): 10/10
---
The `BiometricPrompt.authenticate(PromptInfo)` implementation invokes `authenticateInternal(...)` which invokes `findOrAddBiometricFragment()` which invokes `FragmentManager.executePendingTransactions()`. Although the documentation for `FragmentManager.executePendingTransactions()` says the method must only be invoked from the UI thread, the documentation for `BiometricPrompt.authenticate(PromptInfo)` makes no mention of that (transitive) requirement.
So, either the `BiometricPrompt.authenticate(PromptInfo)` documentation should say the method must only be invoked from the UI thread or the implementation should be refactored to be invokable from any thread.
I did not check whether other library APIs are affected by similar issues.