Allow BAL for HarmfulAppWarningActivity

Required so it can bring the suspended activity back into the
foreground.

Bug: 280493733
Test: atest HarmfulAppWarningTest
Change-Id: I45dfae64ff337232486e590ce5382b9180a91e93
This commit is contained in:
Hani Kazmi
2023-05-12 16:50:24 +00:00
parent 55a94bec24
commit 5956bcccf7

View File

@@ -18,6 +18,7 @@ package com.android.internal.app;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -108,9 +109,14 @@ public class HarmfulAppWarningActivity extends AlertActivity implements
getPackageManager().setHarmfulAppWarning(mPackageName, null /*warning*/);
final IntentSender target = getIntent().getParcelableExtra(Intent.EXTRA_INTENT, android.content.IntentSender.class);
Bundle activityOptions =
ActivityOptions.makeBasic()
.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED)
.toBundle();
try {
startIntentSenderForResult(target, -1 /*requestCode*/, null /*fillInIntent*/,
0 /*flagsMask*/, 0 /*flagsValue*/, 0 /*extraFlags*/);
0 /*flagsMask*/, 0 /*flagsValue*/, 0 /*extraFlags*/, activityOptions);
} catch (IntentSender.SendIntentException e) {
Log.e(TAG, "Error while starting intent sender", e);
}