BiometricResult

sealed interface BiometricResult(source)

Outcome of one BiometricAuthenticator.authenticate call.

Four cases, because callers branch four ways: let them in, let them retry, offer another factor, or never offer biometrics again this session.

Inheritors

Types

Link copied to clipboard

The user dismissed the prompt, or chose the fallback/cancel button, or the system took the prompt away (an incoming call). Not a failure — do not show an error, just stay where you are.

Link copied to clipboard
data class Failed(val reason: String) : BiometricResult

The prompt ran and did not authenticate the user. Retrying is reasonable.

Link copied to clipboard
data object Success : BiometricResult

The user authenticated.

Link copied to clipboard
data class Unavailable(val availability: BiometricAvailability) : BiometricResult

No prompt was ever shown, because BiometricAuthenticator.canAuthenticate would have said so. Carries the same BiometricAvailability a pre-flight check returns, so a caller that skipped the check still gets the actionable reason rather than a bare failure.