OSDN Git Service

Respect per-user fingerprints on profiles with unified challenge.
authorPavel Grafov <pgrafov@google.com>
Thu, 9 Aug 2018 15:51:55 +0000 (16:51 +0100)
committerPavel Grafov <pgrafov@google.com>
Thu, 9 Aug 2018 16:20:26 +0000 (17:20 +0100)
commitf20e34167e4d5b07772067f50486cb6fc6acf7c6
tree604cfacec8b39bec7af1d4603d2072189fba3540
parent0d9f3abc55eb606e31229b3a189d534cd4f56e74
Respect per-user fingerprints on profiles with unified challenge.

When an app uses KeyguardManager.createConfirmDeviceCredentialIntent to ask
the user to confirm credentials, it first goes into ConfirmDeviceCredentialActivity
and then goes into ConfirmLockPattern/ConfirmLockPassword, that incorporates
a derivative of ConfirmDeviceCredentialBaseFragment to deal with the actual credential
and fingerprint checking.

There are two bits of logic that are changed:

1) ConfirmDeviceCredentialBaseFragment gets target user id from the intent,
then uses UserManager.getCredentialOwnerProfile to find the credential owner
user id. If the target user is a work profile with unified challenge,
profile owner will be primary user, otherwise it will be the same user.
When credential confirmation dialog is invoked via
KeyguardManager.createConfirmDeviceCredentialIntent, mUserId will already
correspond to credential owner because ConfirmDeviceCredentialActivity already
calls getCredentialOwnerUserId(), so real target user is not available.
With this CL ConfirmDeviceCredentialActivity doesn't query credential owner because
it will be handled later anyway.

2) Currently when confirming credentials for work profile with unified challenge
we use mEffectiveUserId (credential owner) for fingerprints, which is incorrect,
since fingerprints are per-user and primary profile fingerprints cannot unlock
work profile apps' auth-bound keys. With this CL work profile user is used for
fingerprints.

Bug: 111821299
Test: manual, tried ConfirmCredential sample app in both profiles
Test: manual, tried CA certificate installation in both profiles
Test: manual, tried separate work challenge
Change-Id: I074f773de1bd6207b01664f259bdd04766f32d41
src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java