Skip to content

Most visited

Recently visited

navigation

FingerprintGestureController

public final class FingerprintGestureController
extends Object

java.lang.Object
   ↳ android.accessibilityservice.FingerprintGestureController


An AccessibilityService can capture gestures performed on a device's fingerprint sensor, as long as the device has a sensor capable of detecting gestures.

This capability must be declared by the service as ERROR(/AccessibilityServiceInfo#CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES). It also requires the permission USE_FINGERPRINT.

Because capturing fingerprint gestures may have side effects, services with the capability only capture gestures when ERROR(/AccessibilityServiceInfo#FLAG_CAPTURE_FINGERPRINT_GESTURES) is set.

Note: The fingerprint sensor is used for authentication in critical use cases, so services must carefully design their user's experience when performing gestures on the sensor. When the sensor is in use by an app, for example, when authenticating or enrolling a user, the sensor will not detect gestures. Services need to ensure that users understand when the sensor is in-use for authentication to prevent users from authenticating unintentionally when trying to interact with the service. They can use onGestureDetectionAvailabilityChanged(boolean) to learn when gesture detection becomes unavailable.

Multiple accessibility services may listen for fingerprint gestures simultaneously, so services should provide a way for the user to disable the use of this feature so multiple services don't conflict with each other.

See also:

Summary

Nested classes

class FingerprintGestureController.FingerprintGestureCallback

Class that is called back when fingerprint gestures are being used for accessibility. 

Constants

int FINGERPRINT_GESTURE_SWIPE_DOWN

Identifier for a swipe down on the fingerprint sensor

int FINGERPRINT_GESTURE_SWIPE_LEFT

Identifier for a swipe left on the fingerprint sensor

int FINGERPRINT_GESTURE_SWIPE_RIGHT

Identifier for a swipe right on the fingerprint sensor

int FINGERPRINT_GESTURE_SWIPE_UP

Identifier for a swipe up on the fingerprint sensor

Public methods

boolean isGestureDetectionAvailable()

Gets if the fingerprint sensor's gesture detection is available.

void registerFingerprintGestureCallback(FingerprintGestureController.FingerprintGestureCallback callback, Handler handler)

Register a callback to be informed of fingerprint sensor gesture events.

void unregisterFingerprintGestureCallback(FingerprintGestureController.FingerprintGestureCallback callback)

Unregister a listener added with registerFingerprintGestureCallback(FingerprintGestureController.FingerprintGestureCallback, Handler).

Inherited methods

From class java.lang.Object

Constants

FINGERPRINT_GESTURE_SWIPE_DOWN

int FINGERPRINT_GESTURE_SWIPE_DOWN

Identifier for a swipe down on the fingerprint sensor

Constant Value: 8 (0x00000008)

FINGERPRINT_GESTURE_SWIPE_LEFT

int FINGERPRINT_GESTURE_SWIPE_LEFT

Identifier for a swipe left on the fingerprint sensor

Constant Value: 2 (0x00000002)

FINGERPRINT_GESTURE_SWIPE_RIGHT

int FINGERPRINT_GESTURE_SWIPE_RIGHT

Identifier for a swipe right on the fingerprint sensor

Constant Value: 1 (0x00000001)

FINGERPRINT_GESTURE_SWIPE_UP

int FINGERPRINT_GESTURE_SWIPE_UP

Identifier for a swipe up on the fingerprint sensor

Constant Value: 4 (0x00000004)

Public methods

isGestureDetectionAvailable

boolean isGestureDetectionAvailable ()

Gets if the fingerprint sensor's gesture detection is available.

Returns
boolean true if the sensor's gesture detection is available. false if it is not currently detecting gestures (for example, if it is enrolling a finger).

registerFingerprintGestureCallback

void registerFingerprintGestureCallback (FingerprintGestureController.FingerprintGestureCallback callback, 
                Handler handler)

Register a callback to be informed of fingerprint sensor gesture events.

Parameters
callback FingerprintGestureController.FingerprintGestureCallback: The listener to be added.

This value must never be null.

handler Handler: The handler to use for the callback. If null, callbacks will happen on the service's main thread.

This value may be null.

unregisterFingerprintGestureCallback

void unregisterFingerprintGestureCallback (FingerprintGestureController.FingerprintGestureCallback callback)

Unregister a listener added with registerFingerprintGestureCallback(FingerprintGestureController.FingerprintGestureCallback, Handler).

Parameters
callback FingerprintGestureController.FingerprintGestureCallback: The callback to remove. Removing a callback that was never added has no effect.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.