Allow BAL for SuspendedAppActivity

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

Bug: 270672466
Test: atest DialogTests#testInterceptorActivity_unsuspend
Change-Id: Ic0f0f209ec03598228a72e6a0350c58e60c118bb
This commit is contained in:
Hani Kazmi
2023-05-12 15:33:12 +00:00
parent 55a94bec24
commit ce25b6450f

View File

@@ -24,6 +24,7 @@ import static android.content.res.Resources.ID_NULL;
import android.Manifest;
import android.annotation.Nullable;
import android.app.ActivityOptions;
import android.app.AlertDialog;
import android.app.AppGlobals;
import android.app.KeyguardManager;
@@ -314,8 +315,15 @@ public class SuspendedAppActivity extends AlertActivity
sendBroadcastAsUser(reportUnsuspend, UserHandle.of(mUserId));
if (mOnUnsuspend != null) {
Bundle activityOptions =
ActivityOptions.makeBasic()
.setPendingIntentBackgroundActivityStartMode(
ActivityOptions
.MODE_BACKGROUND_ACTIVITY_START_ALLOWED)
.toBundle();
try {
mOnUnsuspend.sendIntent(this, 0, null, null, null);
mOnUnsuspend.sendIntent(this, 0, null, null, null, null,
activityOptions);
} catch (IntentSender.SendIntentException e) {
Slog.e(TAG, "Error while starting intent " + mOnUnsuspend, e);
}