Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce25b645 authored by Hani Kazmi's avatar Hani Kazmi
Browse files

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
parent 55a94bec
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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);
                            }