Previously, FingerprintManager could be used to handle fingerprint authentication, and did not depend on an Activity in order to go through a system dialog. It could be used from anywhere, as any of the sensor managers.
Now, Google have released the support library version in https://developer.android.com/reference/androidx/biometrics/BiometricPrompt and deprecated FingerprintManager. They wish all apps to go through the same unified system dialog.
Big problem is - the whole thing is strongly coupled to FragmentActivity.
I wish to use this fingerprint authentication in an AccessibilityService (display over other apps).
What can be done?
Some options I'm considering:
- Go back to the old FingerprintManager despite becoming deprecated.
- Implement some transparent Activity that will somehow pop up above other apps, just to satisfy the API's requirement for FragmentActivity.
UPDATE
Accepted commonsware's answer below. I am able to succesfully launch an Activity on top of apps when getting accessibility events, and start using BiometricPrompt. BiometricPrompt has other problems though, and it seems like a very half-baked API that never went through stress testing - but that's beyond the scope of this question.