I'm trying to use the new fingerprint gesture callback from android O.
I've declared these in the manifest
<uses-feature android:name="android.hardware.fingerprint"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
My accessibility service xml looks like this:
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/accessibility_service_description"
android:accessibilityEventTypes="typeAllMask"
android:accessibilityFlags="flagRequestFingerprintGestures"
android:accessibilityFeedbackType="feedbackAllMask"
android:notificationTimeout="100"
android:canRetrieveWindowContent="false"
android:canRequestEnhancedWebAccessibility="false"
android:settingsActivity="com.example.finger.MainActivity"/>
..and then in the accessibility service onServiceConnected method I'm trying to register a callback with the following
FingerprintGestureController.FingerprintGestureCallback callback = new
FingerprintGestureController.FingerprintGestureCallback(){
@Override
public void onGestureDetectionAvailabilityChanged(boolean available) {
LogUtil.d("available: " + available);
super.onGestureDetectionAvailabilityChanged(available);
}
@Override
public void onGestureDetected(int gesture) {
LogUtil.d("gesture: " + gesture);
super.onGestureDetected(gesture);
}
};
FingerprintGestureController controller =
this.getFingerprintGestureController();
controller.registerFingerprintGestureCallback(callback, null);
The accessibility service registers fine and the code above to register the callback gets called ok, but I never get a call to the onGestureDetectionAvailabilityChanged and onGestureDetected
The documentation around it is somewhat lacking so I'm not sure what else I need to be able to get the callback working.