Do not request cancel authentication unless currently authenticating
Currently we always send cancel() if ConfirmDeviceCredentialActivity goes into the background. However, if the biometric state is no longer authenticating, requesting cancel() in this state will result in an inconsistent state between BiometricService/client and ConfirmDeviceCredentials. BiometricService/client will receive the ERROR_CANCELED message incorrectly, while ConfirmDeviceCredential is showing / pending user password. When the password is entered, its result is ignored. The correct behavior is for ConfirmDeviceCredentialActivity to invoke cancel() only if it's still authenticating. Otherwise BiometricService and its client will receive ERROR_CANCELED, instead of the actual password auth result. Bug: 138279856 Test: BiometricPromptDemo, enable device credential fallback, get into lockout state, successfully enter password. API result is success instead of "canceled" now. Change-Id: I6521e896d0402fe856dc85476f51149c9b3084a8 Merged-In: I6521e896d0402fe856dc85476f51149c9b3084a8
Loading