Return GK_PW_HANDLE after remote LSKF verification.
Handle is returned when LSKF is set after successful verification. It is used by SUW to add biometrics without asking for LSKF. Bug: 272807192 Test: manual Change-Id: I3fe6ed7fd6401421090ccd684509dfede9106076
This commit is contained in:
@@ -132,6 +132,11 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
|||||||
if (BiometricUtils.containsGatekeeperPasswordHandle(getIntent())) {
|
if (BiometricUtils.containsGatekeeperPasswordHandle(getIntent())) {
|
||||||
mGkPwHandle = BiometricUtils.getGatekeeperPasswordHandle(getIntent());
|
mGkPwHandle = BiometricUtils.getGatekeeperPasswordHandle(getIntent());
|
||||||
}
|
}
|
||||||
|
} else if (WizardManagerHelper.isAnySetupWizard(getIntent())) {
|
||||||
|
if (BiometricUtils.containsGatekeeperPasswordHandle(getIntent())) {
|
||||||
|
mGkPwHandle = BiometricUtils.getGatekeeperPasswordHandle(getIntent());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
|
@@ -339,7 +339,7 @@ public final class ChooseLockSettingsHelper {
|
|||||||
Utils.enforceSameOwner(mActivity, mUserId);
|
Utils.enforceSameOwner(mActivity, mUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mExternal && mReturnCredentials) {
|
if (mExternal && mReturnCredentials && !mRemoteLockscreenValidation) {
|
||||||
throw new IllegalArgumentException("External and ReturnCredentials specified. "
|
throw new IllegalArgumentException("External and ReturnCredentials specified. "
|
||||||
+ " External callers should never be allowed to receive credentials in"
|
+ " External callers should never be allowed to receive credentials in"
|
||||||
+ " onActivityResult");
|
+ " onActivityResult");
|
||||||
|
@@ -250,12 +250,15 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
.setRemoteLockscreenValidationSession(remoteLockscreenValidationSession)
|
.setRemoteLockscreenValidationSession(remoteLockscreenValidationSession)
|
||||||
.setRemoteLockscreenValidationServiceComponent(
|
.setRemoteLockscreenValidationServiceComponent(
|
||||||
remoteLockscreenValidationServiceComponent)
|
remoteLockscreenValidationServiceComponent)
|
||||||
|
.setRequestGatekeeperPasswordHandle(true)
|
||||||
|
.setReturnCredentials(true) // returns only password handle.
|
||||||
.setHeader(mTitle) // Show the title in the header location
|
.setHeader(mTitle) // Show the title in the header location
|
||||||
.setDescription(mDetails)
|
.setDescription(mDetails)
|
||||||
.setCheckboxLabel(checkboxLabel)
|
.setCheckboxLabel(checkboxLabel)
|
||||||
.setAlternateButton(alternateButton)
|
.setAlternateButton(alternateButton)
|
||||||
.setExternal(true)
|
.setExternal(true)
|
||||||
.show();
|
.show();
|
||||||
|
return;
|
||||||
} else if (isEffectiveUserManagedProfile && isInternalActivity()) {
|
} else if (isEffectiveUserManagedProfile && isInternalActivity()) {
|
||||||
mCredentialMode = CREDENTIAL_MANAGED;
|
mCredentialMode = CREDENTIAL_MANAGED;
|
||||||
if (isBiometricAllowed(effectiveUserId, mUserId)) {
|
if (isBiometricAllowed(effectiveUserId, mUserId)) {
|
||||||
|
@@ -26,6 +26,10 @@ import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROF
|
|||||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PIN_REQUIRED;
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PIN_REQUIRED;
|
||||||
import static android.app.admin.DevicePolicyResources.UNDEFINED;
|
import static android.app.admin.DevicePolicyResources.UNDEFINED;
|
||||||
|
|
||||||
|
import static com.android.settings.biometrics.GatekeeperPasswordProvider.containsGatekeeperPasswordHandle;
|
||||||
|
import static com.android.settings.biometrics.GatekeeperPasswordProvider.getGatekeeperPasswordHandle;
|
||||||
|
import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_GK_PW_HANDLE;
|
||||||
|
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.app.KeyguardManager;
|
import android.app.KeyguardManager;
|
||||||
import android.app.RemoteLockscreenValidationResult;
|
import android.app.RemoteLockscreenValidationResult;
|
||||||
@@ -614,7 +618,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
|||||||
saveAndFinishWorker.setListener(this);
|
saveAndFinishWorker.setListener(this);
|
||||||
saveAndFinishWorker.start(
|
saveAndFinishWorker.start(
|
||||||
mLockPatternUtils,
|
mLockPatternUtils,
|
||||||
/* requestGatekeeperPassword= */ false,
|
/* requestGatekeeperPassword= */ true,
|
||||||
mDeviceCredentialGuess,
|
mDeviceCredentialGuess,
|
||||||
/* currentCredential= */ null,
|
/* currentCredential= */ null,
|
||||||
mEffectiveUserId);
|
mEffectiveUserId);
|
||||||
@@ -705,8 +709,14 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
|||||||
if (mDeviceCredentialGuess != null) {
|
if (mDeviceCredentialGuess != null) {
|
||||||
mDeviceCredentialGuess.zeroize();
|
mDeviceCredentialGuess.zeroize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Intent result = new Intent();
|
||||||
|
if (mRemoteValidation && containsGatekeeperPasswordHandle(resultData)) {
|
||||||
|
result.putExtra(EXTRA_KEY_GK_PW_HANDLE, getGatekeeperPasswordHandle(resultData));
|
||||||
|
}
|
||||||
|
|
||||||
mGlifLayout.setProgressBarShown(false);
|
mGlifLayout.setProgressBarShown(false);
|
||||||
mCredentialCheckResultTracker.setResult(/* matched= */ true, new Intent(),
|
mCredentialCheckResultTracker.setResult(/* matched= */ true, result,
|
||||||
/* timeoutMs= */ 0, mEffectiveUserId);
|
/* timeoutMs= */ 0, mEffectiveUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,10 @@ import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROF
|
|||||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PATTERN_REQUIRED;
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PATTERN_REQUIRED;
|
||||||
import static android.app.admin.DevicePolicyResources.UNDEFINED;
|
import static android.app.admin.DevicePolicyResources.UNDEFINED;
|
||||||
|
|
||||||
|
import static com.android.settings.biometrics.GatekeeperPasswordProvider.containsGatekeeperPasswordHandle;
|
||||||
|
import static com.android.settings.biometrics.GatekeeperPasswordProvider.getGatekeeperPasswordHandle;
|
||||||
|
import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_GK_PW_HANDLE;
|
||||||
|
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
@@ -627,7 +631,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
|||||||
saveAndFinishWorker.setListener(this);
|
saveAndFinishWorker.setListener(this);
|
||||||
saveAndFinishWorker.start(
|
saveAndFinishWorker.start(
|
||||||
mLockPatternUtils,
|
mLockPatternUtils,
|
||||||
/* requestGatekeeperPassword= */ false,
|
/* requestGatekeeperPassword= */ true,
|
||||||
mDeviceCredentialGuess,
|
mDeviceCredentialGuess,
|
||||||
/* currentCredential= */ null,
|
/* currentCredential= */ null,
|
||||||
mEffectiveUserId);
|
mEffectiveUserId);
|
||||||
@@ -732,8 +736,14 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
|||||||
if (mDeviceCredentialGuess != null) {
|
if (mDeviceCredentialGuess != null) {
|
||||||
mDeviceCredentialGuess.zeroize();
|
mDeviceCredentialGuess.zeroize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Intent result = new Intent();
|
||||||
|
if (mRemoteValidation && containsGatekeeperPasswordHandle(resultData)) {
|
||||||
|
result.putExtra(EXTRA_KEY_GK_PW_HANDLE, getGatekeeperPasswordHandle(resultData));
|
||||||
|
}
|
||||||
|
|
||||||
mGlifLayout.setProgressBarShown(false);
|
mGlifLayout.setProgressBarShown(false);
|
||||||
mCredentialCheckResultTracker.setResult(/* matched= */ true, new Intent(),
|
mCredentialCheckResultTracker.setResult(/* matched= */ true, result,
|
||||||
/* timeoutMs= */ 0, mEffectiveUserId);
|
/* timeoutMs= */ 0, mEffectiveUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user