Allow BAL for confirm device credential activity when work profile

apps are protected by PIN prompt.

Test: manual test
Bug: 279889563
Change-Id: Ife319469cee908f54618986107b40bcc82886b06
This commit is contained in:
Nan Wu
2023-05-08 18:00:14 +00:00
parent 2f970a1a05
commit a23f9a69e0

View File

@@ -52,7 +52,12 @@ public class ConfirmDeviceCredentialUtils {
IntentSender intentSender = activity.getIntent().getParcelableExtra(Intent.EXTRA_INTENT); IntentSender intentSender = activity.getIntent().getParcelableExtra(Intent.EXTRA_INTENT);
if (intentSender != null) { if (intentSender != null) {
try { try {
activity.startIntentSenderForResult(intentSender, -1, null, 0, 0, 0); ActivityOptions activityOptions =
ActivityOptions.makeBasic()
.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
activity.startIntentSenderForResult(intentSender, -1, null, 0, 0, 0,
activityOptions.toBundle());
} catch (IntentSender.SendIntentException e) { } catch (IntentSender.SendIntentException e) {
/* ignore */ /* ignore */
} }