@Implements(android.hardware.fingerprint.FingerprintManager.class) public class ShadowFingerprintManager extends Object
FingerprintManager
Modifier and Type | Field | Description |
---|---|---|
protected FingerprintManager.CryptoObject |
pendingCryptoObject |
Constructor | Description |
---|---|
ShadowFingerprintManager() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
authenticate(FingerprintManager.CryptoObject crypto,
CancellationSignal cancel,
int flags,
FingerprintManager.AuthenticationCallback callback,
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 FingerprintManager.AuthenticationResult |
createAuthenticationResult() |
|
protected List<Fingerprint> |
getEnrolledFingerprints() |
|
int |
getFingerprintId(int index) |
|
protected boolean |
hasEnrolledFingerprints() |
Returns
false by default, or the value specified via
setHasEnrolledFingerprints(boolean) . |
protected boolean |
isHardwareDetected() |
|
void |
setDefaultFingerprints(int num) |
Enrolls the given number of fingerprints, which will be returned in
getEnrolledFingerprints() . |
void |
setHasEnrolledFingerprints(boolean hasEnrolledFingerprints) |
Deprecated.
use
setDefaultFingerprints(int) instead. |
void |
setIsHardwareDetected(boolean isHardwareDetected) |
Sets the return value of
FingerprintManager.isHardwareDetected() . |
protected FingerprintManager.CryptoObject pendingCryptoObject
public void authenticationSucceeds()
FingerprintManager.authenticate(CryptoObject, CancellationSignal, int, AuthenticationCallback, Handler)
and not cancelled.protected FingerprintManager.AuthenticationResult createAuthenticationResult()
public void authenticationFails()
FingerprintManager.authenticate(CryptoObject, CancellationSignal, int, AuthenticationCallback, Handler)
and not cancelled.@Implementation(minSdk=23) protected void authenticate(FingerprintManager.CryptoObject crypto, CancellationSignal cancel, int flags, FingerprintManager.AuthenticationCallback callback, Handler handler)
authenticationSucceeds()
or authenticationFails()
.@Deprecated public void setHasEnrolledFingerprints(boolean hasEnrolledFingerprints)
setDefaultFingerprints(int)
instead.FingerprintManager.hasEnrolledFingerprints()
.@Implementation(minSdk=23) protected boolean hasEnrolledFingerprints()
false
by default, or the value specified via
setHasEnrolledFingerprints(boolean)
.@HiddenApi @Implementation(minSdk=23) protected List<Fingerprint> getEnrolledFingerprints()
setDefaultFingerprints(int)
public int getFingerprintId(int index)
public void setDefaultFingerprints(int num)
getEnrolledFingerprints()
.num
- the quantity of fingerprint item.public void setIsHardwareDetected(boolean isHardwareDetected)
FingerprintManager.isHardwareDetected()
.@Implementation(minSdk=23) protected boolean isHardwareDetected()
setIsHardwareDetected(boolean)