Update the biometric unlock logo to Private Space logo

All activities that use biometric login through the CDCA class show a
Settings icon in the prompt. This cl adds a capability for the client of
the CDCA to set icon and icon description as extras to the unlock
intent.

Screenshot: http://shortn/_OpKTYFtddM

Bug: 333528540
Test: Manually verified on the device

Change-Id: Id7b5a3fe575069bef1810769e4f437e717d2d3c6
This commit is contained in:
Olivier Nshimiye
2024-04-17 12:05:36 +00:00
parent 7030928506
commit 14d4b41363
3 changed files with 50 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ import static android.app.admin.DevicePolicyManager.ACTION_SET_NEW_PASSWORD;
import static com.android.internal.app.SetScreenLockDialogActivity.LAUNCH_REASON_PRIVATE_SPACE_SETTINGS_ACCESS;
import static com.android.settings.activityembedding.EmbeddedDeepLinkUtils.tryStartMultiPaneDeepLink;
import static com.android.settings.password.ConfirmDeviceCredentialActivity.CUSTOM_BIOMETRIC_PROMPT_LOGO_DESCRIPTION_KEY;
import static com.android.settings.password.ConfirmDeviceCredentialActivity.CUSTOM_BIOMETRIC_PROMPT_LOGO_RES_ID_KEY;
import android.app.ActivityOptions;
import android.app.KeyguardManager;
@@ -228,6 +230,14 @@ public class PrivateSpaceAuthenticationActivity extends FragmentActivity {
private void authenticatePrivateSpaceEntry() {
Intent credentialIntent = mPrivateSpaceMaintainer.getPrivateProfileLockCredentialIntent();
if (credentialIntent != null) {
if (android.multiuser.Flags.usePrivateSpaceIconInBiometricPrompt()) {
credentialIntent.putExtra(CUSTOM_BIOMETRIC_PROMPT_LOGO_RES_ID_KEY,
com.android.internal.R.drawable.stat_sys_private_profile_status);
credentialIntent.putExtra(CUSTOM_BIOMETRIC_PROMPT_LOGO_DESCRIPTION_KEY,
getApplicationContext().getString(
com.android.internal.R.string.private_space_biometric_prompt_title
));
}
mVerifyDeviceLock.launch(credentialIntent);
} else {
Log.e(TAG, "verifyCredentialIntent is null even though device lock is set");