Package org.robolectric.shadows
Class ShadowBiometricManager
java.lang.Object
org.robolectric.shadows.ShadowBiometricManager
@Implements(className="android.hardware.biometrics.BiometricManager",
minSdk=29,
isInAndroidSdk=false)
public class ShadowBiometricManager
extends Object
Provides testing APIs for
BiometricManager-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected intcanAuthenticate(int authenticators) protected intcanAuthenticate(int userId, int authenticators) voidsetAuthenticatorType(int type) Allow different resultcanAuthenticate(int), result will depend on the combination as described here For example, you can set the valueBiometricManager.Authenticators.BIOMETRIC_STRONGto allowcanAuthenticate(int)returnBiometricManager.BIOMETRIC_SUCCESSwhen you passedBiometricManager.Authenticators.BIOMETRIC_WEAKas parameter incanAuthenticate(int)voidsetCanAuthenticate(boolean flag) Sets the valuetrueto allowcanAuthenticate()returnIf sets the value toinvalid reference
BIOMETRIC_SUCCESSfalse, result will depend oninvalid reference
BiometricManager#hasBiometrics(Context context)
-
Field Details
-
biometricServiceConnected
protected boolean biometricServiceConnected
-
-
Constructor Details
-
ShadowBiometricManager
public ShadowBiometricManager()
-
-
Method Details
-
canAuthenticate
@Implementation protected int canAuthenticate() -
canAuthenticate
@Implementation(minSdk=30) protected int canAuthenticate(int authenticators) -
canAuthenticate
@Implementation(minSdk=30) protected int canAuthenticate(int userId, int authenticators) -
setCanAuthenticate
public void setCanAuthenticate(boolean flag) Sets the valuetrueto allowcanAuthenticate()returnIf sets the value toinvalid reference
BIOMETRIC_SUCCESSfalse, result will depend oninvalid reference
BiometricManager#hasBiometrics(Context context)- Parameters:
flag- to set can authenticate or not
-
setAuthenticatorType
public void setAuthenticatorType(int type) Allow different resultcanAuthenticate(int), result will depend on the combination as described here For example, you can set the valueBiometricManager.Authenticators.BIOMETRIC_STRONGto allowcanAuthenticate(int)returnBiometricManager.BIOMETRIC_SUCCESSwhen you passedBiometricManager.Authenticators.BIOMETRIC_WEAKas parameter incanAuthenticate(int)- Parameters:
type- to set the authenticatorType- See Also:
-