@Implements(value=android.hardware.fingerprint.FingerprintManager.class)
public class ShadowFingerprintManager
extends java.lang.Object
Provides testing APIs for FingerprintManager
| Constructor and Description |
|---|
ShadowFingerprintManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
authenticate(android.hardware.fingerprint.FingerprintManager.CryptoObject crypto,
android.os.CancellationSignal cancel,
int flags,
android.hardware.fingerprint.FingerprintManager.AuthenticationCallback callback,
android.os.Handler handler)
Success or failure can be simulated with a subsequent call to
authenticationSucceeds() or authenticationFails(). |
void |
authenticationFails()
Simulates a failed fingerprint authentication.
|
void |
authenticationSucceeds()
Simulates a successful fingerprint authentication.
|
protected boolean |
hasEnrolledFingerprints() |
protected boolean |
isHardwareDetected() |
void |
setHasEnrolledFingerprints(boolean hasEnrolledFingerprints)
Sets the return value of
FingerprintManager.hasEnrolledFingerprints(). |
void |
setIsHardwareDetected(boolean isHardwareDetected)
Sets the return value of
FingerprintManager.isHardwareDetected(). |
public void authenticationSucceeds()
Simulates a successful fingerprint authentication. An authentication request must have been issued with FingerprintManager.authenticate(CryptoObject, CancellationSignal, int, AuthenticationCallback, Handler) and not cancelled.
public void authenticationFails()
Simulates a failed fingerprint authentication. An authentication request must have been issued with FingerprintManager.authenticate(CryptoObject, CancellationSignal, int, AuthenticationCallback, Handler) and not cancelled.
@Implementation
protected void authenticate(android.hardware.fingerprint.FingerprintManager.CryptoObject crypto,
android.os.CancellationSignal cancel,
int flags,
android.hardware.fingerprint.FingerprintManager.AuthenticationCallback callback,
android.os.Handler handler)
Success or failure can be simulated with a subsequent call to authenticationSucceeds() or authenticationFails().
public void setHasEnrolledFingerprints(boolean hasEnrolledFingerprints)
Sets the return value of FingerprintManager.hasEnrolledFingerprints().
@Implementation protected boolean hasEnrolledFingerprints()
false by default, or the value specified via setHasEnrolledFingerprints(boolean)public void setIsHardwareDetected(boolean isHardwareDetected)
Sets the return value of FingerprintManager.isHardwareDetected().
@Implementation protected boolean isHardwareDetected()
false by default, or the value specified via setIsHardwareDetected(boolean)