在fingerprint accessibility service的Android Api指南中,写下如下句子:
- 声明USE_FINGERPRINT权限和CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES功能。
但是,我似乎无法找到实际声明该功能的位置。它在AccessibilityServiceInfo.eventTypes字段中吗?是以编程方式还是在xml accessibilityService文件中声明的?
提前致谢。
USE_FINGERPRINT
只是一个明确的权限,并像任何其他权限一样声明。 CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES是一个辅助功能服务功能,并在您的service config xml文件中声明:
<accessibility-service
xmlns:android="http://schemas.android.com/apk/res/android"
...
android:accessibilityFlags="otherFlags|flagRequestFingerprintGestures"
android:canRequestFingerprintGestures="true"
...
/>
发现所有这些东西的最佳参考页面:https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo.html#CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES