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

Commit 88f146a3 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Allow background start from notif history" into main

parents 7f25a5ed 55f14ae7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.settings.notification.history;

import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED;

import android.app.ActivityOptions;
import android.app.PendingIntent;
import android.content.ActivityNotFoundException;
import android.content.Intent;
@@ -110,7 +113,10 @@ public class NotificationSbnViewHolder extends RecyclerView.ViewHolder {
                        uid, pkg, instanceId, position);
                if (pi != null && isPendingIntentValid) {
                    try {
                        pi.send();
                        ActivityOptions options = ActivityOptions.makeBasic();
                        options.setPendingIntentBackgroundActivityStartMode(
                                MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
                        pi.send(options.toBundle());
                    } catch (PendingIntent.CanceledException e) {
                        Slog.e(TAG, "Could not launch", e);
                    }