Android O - fingerprint gesture not firing callback

373 views
Skip to first unread message

Andrew Moore

unread,
Jun 14, 2017, 6:34:52 PM6/14/17
to Eyes-free Programming and development
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?

Akash Kakkar

unread,
Jun 15, 2017, 5:53:36 AM6/15/17
to eyes-f...@googlegroups.com
Hi Andrew, have you requested the FingerprintGestures flag via your
serviceConfig.xml file?
> --
> You received this message because you are subscribed to the Google Groups
> "Eyes-free Programming and development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to eyes-free-de...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Andrew Moore

unread,
Jun 15, 2017, 5:22:39 PM6/15/17
to Eyes-free Programming and development
I've got these in my service config:

                       android:accessibilityFlags="flagRequestFingerprintGestures"
android:canRequestFingerprintGestures="true"

shubham david

unread,
Jan 28, 2019, 11:55:18 AM1/28/19
to Eyes-free Programming and development
Hey Andrew, I am new with fingerprint gesture detection, can you help me in coding so i want make an application that will help me to switch tabs through fingerprint gesture like if i swipe my finger left on fingerprint sensor it left tab should be open ..
thanks  
Reply all
Reply to author
Forward
0 new messages