From ee1dd50e7489d6098712c87f7437bb1a14093783 Mon Sep 17 00:00:00 2001 From: Kevin Chyn Date: Wed, 16 Dec 2020 12:33:00 -0800 Subject: [PATCH] Forward gatekeeper password handle to enrollment Fixes: 169629017 Test: Wipe device, go through setup flow with a managed account. Successfully set up credential and fingerprint During the conversion to GkPwHandle (instead of HAT), the code in Choose/ConfirmLock* and most of the biometric paths were updated, with the exception of 2a below. 1) Only multi-biometric devices request Choose/ConfirmLock in BiometricEnrollActivity. 2) Single-biometric devices (in almost all paths) request credentials in their intro activities (FingerprintEnrollIntro, etc). 2a) However, there is a special path used by work profiles where credentials are first set up, and the GkPwHandle is passed into BiometricEnrollActivity, with the request to skip the fingerprint enroll introduction page. In this case, we must remember to forward the GkPwHandle to the relavent enrollment page (FingerprintEnrollFindSensor). At some point in the future we should have all credential stuff done in BiometricEnrollActivity. However, due to legacy APIs, etc, it may be more work than it's worth right now. Change-Id: I3f95876de6969fee7130d7a19c8db363da69c4c2 --- .../android/settings/biometrics/BiometricEnrollActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/biometrics/BiometricEnrollActivity.java b/src/com/android/settings/biometrics/BiometricEnrollActivity.java index 4822607f238..2985a9d2101 100644 --- a/src/com/android/settings/biometrics/BiometricEnrollActivity.java +++ b/src/com/android/settings/biometrics/BiometricEnrollActivity.java @@ -89,6 +89,9 @@ public class BiometricEnrollActivity extends InstrumentedActivity { if (this instanceof InternalActivity) { mUserId = getIntent().getIntExtra(Intent.EXTRA_USER_ID, UserHandle.myUserId()); + if (BiometricUtils.containsGatekeeperPasswordHandle(getIntent())) { + mGkPwHandle = BiometricUtils.getGatekeeperPasswordHandle(getIntent()); + } } if (savedInstanceState != null) { @@ -366,7 +369,7 @@ public class BiometricEnrollActivity extends InstrumentedActivity { ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN); } BiometricUtils.launchEnrollForResult(this, intent, 0 /* requestCode */, hardwareAuthToken, - null /* gkPwHandle */, mUserId); + mGkPwHandle, mUserId); } private void launchCredentialOnlyEnroll() {