Commit Graph

19 Commits

Author SHA1 Message Date
Kevin Chyn
dbdd06ca85 No longer need to cancel authentication from ConfirmDeviceCredentialActivity
CDCA no longer needs to cancel authentication in onPause. Since it
internally invokes BiometricPrompt, and BiometricPrompt's components e.g.
BiometricService and AuthController are aware of the "top-ness" of its
client, this code is redundant.

Fixes: 145991060

Test: Follow comment#3 in the bug above, repeat 10+ times
Test: Set up work profile, set up work profile password. Open work profile
      app, but before entering password, swipe up to go to home screen.
      Authentication is cancelled as expected.

Change-Id: I0b4d7d89cb9801ddbb6e3bd07f71191035cc75ec
2020-01-17 13:29:49 -08:00
Alex Johnston
7868acfa74 Update work profile lock in Settings to latest spec
* Updated FrameLayout of work profile lock in Settings to use GlifLayout
* Removed old background image of work profile lock
* Updated text for PIN, password and pattern
* Added enterprise logo to work profile lock

Bug: 141290838
Test: Manual testing
      atest com.android.settings.password

Change-Id: Ie09974857b6c76a182a8075b9e1964a2e0af0de9
2020-01-07 14:15:28 +00:00
joshmccloskey
53ccc448c8 Using new Biometric API
Test: Verified disabling fingerprint will not allow
the user to unlock work apps with fingerprint. (But can use fingeprint
within apps.)
Test: Verified disabling face and/or iris on a fingerprint device will
continue to
allow the user to unlock work apps with fingerprint.
Test: Verified disabling face on a face authentication device
will not allow the user to unlock work apps with face authentication.
(But can use face
authentication within apps.)
Test: Verified disabling fingerprint and/or iris on a face
authentication device will continue to allow the user to unlock work
apps with face authentication.

Change-Id: I2f72a85f39ec539e6c6bc2cf710ed2f5ebeb5f9a
2019-12-18 16:18:31 -08:00
joshmccloskey
9be0899b3c Enforce policy management.
Test: Verified disabling fingerprint will not allow
the user to unlock work apps with fingerprint. (But can use fingeprint
within apps.)
Test: Verified disabling face and/or iris on a fingerprint device will
continue to
allow the user to unlock work apps with fingerprint.
Test: Verified disabling face on a face authentication device
will not allow the user to unlock work apps with face authentication.
(But can use face
authentication within apps.)
Test: Verified disabling fingerprint and/or iris on a face
authentication device will continue to allow the user to unlock work
apps with face authentication.
Bug: 141382589

Change-Id: I74135dd9f6afb1b789302ad0af3daf8a73a4181b
2019-10-16 00:05:10 +00:00
joshmccloskey
3786016993 Removed old settings device credential logic.
Bug: 140128468
Test: Verified with biometricpromptdemo that confirm device credential
still works correctly.
Change-Id: I0f608ba1256c696317402f56549452bf6933066b
2019-09-18 15:57:22 -07:00
Kevin Chyn
0a33d62a17 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
2019-07-26 11:20:10 -07:00
Kevin Chyn
eeca918ac7 ConfirmDeviceCredential should respond to cancel when launched through BP
Fixes: 128747871

Test: BiometricPrompt launched by ConfirmDeviceCredential is canceled
Test: ConfirmLock* can also now be canceled
Test: No effect on non-biometric related paths

Change-Id: I237de136e63d523fece87fad7a93f4ecd66d800b
2019-04-04 17:22:23 +00:00
Rubin Xu
e0efe27f03 Force LSKF in ConfirmCredential UI when pending escrow token exists
Escrow tokens can only be activated by user confirming their LSKF,
while ConfirmCredential allows both LSKF and biometrics by default.
By requiring LSKF, it simplifies the DPC's flow of requesting the user
to activate a pending escrow token.

This change tweaks the ConfirmCredential UI to skip biometrics if pending
token exists.

Bug: 127377026
Bug: 76084679
Bug: 79547502
Test: manual
Change-Id: Iee9b2d57d7f4de98e225b3aeff7cc35cc8e3d36a
2019-03-18 17:20:26 +00:00
Kevin Chyn
200162b06a Use BiometricPrompt description field for CC description instead
The description field handles longer strings more gracefully

Fixes: 124001277

Test: 1) Open Wi-Fi picker
      2) Select gear on the connected network
      3) Select share button
      4) On BiometricPrompt, text is not cropped

Change-Id: I945830a137a0dc203bba04728b507ceff020dfdc
2019-02-14 17:43:45 -08:00
Kevin Chyn
e264bf3f66 Retrieve effectiveUserId after userId is set/re-set
Fixes: 123502937

Test: Followed steps in comment #1 of the first bug above
      Note that the test should be done with unified lock disabled, e.g.
      have separate pin/pattern/pass for owner and work profile

Change-Id: I01d66a8a1d3ed1811497c2acb7db6158d99727a0
2019-02-06 11:23:27 -08:00
Fan Zhang
c3fd289969 Remove dead code.
Bug: n/a
Test: rebuild
Change-Id: I71f8d9d99bbff1186e8df518ec8d27db3447ffbe
2019-01-29 16:27:31 -08:00
Kevin Chyn
e56df8877a CDCA is plumbed through BP
CDCA can be invoked with a bundle extra originating from BiometricService.
This allows us to add/forward new BP builder options to CDCA without having
duplicate API each time.

Bug: 111461540
Test: test app, receives correct callbacks
Test: CDC still works

Change-Id: Ia2080d161abba87949338176b34cdf440ed4ed53
2019-01-25 18:13:38 -08:00
Kevin Chyn
29aaf60ace Revert "Plumb setRequireConfirmation to CC"
This reverts commit 56c745c38e.

Reason for revert: Adding functionality differently

Change-Id: Iadc276ff32b9bef4ea3d7dc6dc051dcfc943e134
2019-01-25 17:49:31 -08:00
Kevin Chyn
56c745c38e Plumb setRequireConfirmation to CC
Bug: 111461540

Test: Tested with modified demo app with
      original and new KeyguardManager APIs

Change-Id: I56585fbfd704195586f2f516b35e9338e91b0346
2019-01-23 18:42:47 -08:00
Kevin Chyn
127da9c73c Fix ConfirmDeviceCredentials for work profiles
1) Fixed the theme for CDCA$InternalActivity to be transparent
2) CDCA only cares about biometrics, which are tied to userId
3) Moved shared methods to a util class

Fixes: 119296586

Test: Followed the steps in comment#1 of the bug linked above


Change-Id: Ie47fc7c3a53dfb7780087937e1ca83287cc52d71
2018-11-14 11:03:57 -08:00
Kevin Chyn
b3ee23154d 3/n: Make CDCA transparent and add BiometricPrompt
ConfirmDeviceCredentials now uses BiometricPrompt instead of
FingerprintManager

Bug: 111461540

Test: FRP does not display BiometricPrompt (as expected)
      adb shell settings put global device_provisioned 0 && adb shell am start -a android.app.action.CONFIRM_FRP_CREDENTIAL
Test: Using KeyguardManager API to launch, all corner cases seem OK
Test: Tested with work profile + one lock enabled/disabled, seems OK
Test: Enroll normal FP but not work FP, BiometricPromptDemo for both works
      OK
Test: Test CC on work version of BPD, then BP on normal version of BPD,
      both accept correct FP's (no regression from P)

Change-Id: Iacdaf76ab76971850212dc79513bfa3f4b89eb9a
2018-11-01 15:14:04 -07:00
Pavel Grafov
f20e34167e 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
2018-08-09 17:20:26 +01:00
Adrian Roos
5a9a3cde62 Credential FRP: Add ACTION_CONFIRM_FRP_CREDENTIAL to ConfirmCredential
Bug: 36814845
Test: adb shell settings put global device_provisioned 0 && adb shell am start -a android.app.action.CONFIRM_FRP_CREDENTIAL
Change-Id: Id6ce6bc5ebd9c9e2a88790cc800678aff50e580f
2017-05-30 18:25:18 -07:00
Maurice Lam
2eb170cd6f Clean up choose lock intent creation
Consolidated the many variants of ChooseLock*.createIntent, so that
it will take the same set of arguments.

Also modified SetupChooseLock*.createIntent to modifyIntentForSetup,
which will take the intent created by ChooseLock* and modify it for
use with setup.

Test: cd tests/robotests && mma
Change-Id: I5ff033f459c33ec9980872a536b3996d89f2bbbb
2017-05-12 15:35:20 -07:00