OSDN Git Service

Do not request cancel authentication unless currently authenticating
authorKevin Chyn <kchyn@google.com>
Fri, 26 Jul 2019 18:20:10 +0000 (11:20 -0700)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Sun, 28 Jul 2019 22:26:26 +0000 (22:26 +0000)
commitadef4840f3ffdc97503fe1ac0943381d43efe10d
tree1d80a046aeb4a45c83f6d1faa230212e3633f285
parent81fb5e28c1c6151d8a6c9659d427dca4785ea5ec
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
(cherry picked from commit 49c7d0765090750f88f11153dfcf9ec378b0c84d)
src/com/android/settings/password/BiometricFragment.java
src/com/android/settings/password/ConfirmDeviceCredentialActivity.java