As I got pointed to the dev group I'll try ask the question specifically here.
I'm trying to use the new android O fingerprint gestures but can't get them to trigger.
My accessibility service is registering fine and I get onAccessibilityEvent triggering fine, so my basics seem set up ok.
I've then added the following to try and get the fingerprint gestures
AndroidManifest.xml
<uses-feature android:name="android.hardware.fingerprint"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
accesibility_service_config.xml
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/accessibility_service_description"
android:accessibilityEventTypes="typeAllMask"
android:accessibilityFlags="flagRequestFingerprintGestures"
android:canRequestFingerprintGestures="true"
android:accessibilityFeedbackType="feedbackAllMask"
android:notificationTimeout="100"
android:canRetrieveWindowContent="false"
android:canRequestEnhancedWebAccessibility="false"
android:settingsActivity="com.example.finger.MainActivity"
/>
Regarding actual code I've currently got this in the accessibility service
onServiceConnected method (I'm sure some of it won't be required due to being in the xml file, but I've kept trying to change things around to get it to trigger.
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
info.feedbackType = AccessibilityServiceInfo.FEEDBACK_ALL_MASK;
info.flags = AccessibilityServiceInfo.FLAG_REQUEST_FINGERPRINT_GESTURES;
info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
info.notificationTimeout = 100;
this.setServiceInfo(info);
FingerprintManager fingerprintManager = getSystemService(FingerprintManager.class);
if (fingerprintManager.isHardwareDetected() && fingerprintManager.hasEnrolledFingerprints()){
FingerprintGestureController.FingerprintGestureCallback callback = new FingerprintGestureController.FingerprintGestureCallback(){
@Override
public void onGestureDetectionAvailabilityChanged(boolean available) {
LogUtil.d("available-change: " + 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);
LogUtil.d("available: " + controller.isGestureDetectionAvailable());
}
The register calls go through without complaining, but the callbacks are never triggered. Can anyone spot what I might be doing wrong?