Allow background start from notif history
Test: Tap on entries in 'Recently Dismissed' Fixes: 304651874 Change-Id: Ifcdd881cbd17903b47f93303bf33a72f718dc181
This commit is contained in:
@@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
package com.android.settings.notification.history;
|
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.app.PendingIntent;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -110,7 +113,10 @@ public class NotificationSbnViewHolder extends RecyclerView.ViewHolder {
|
|||||||
uid, pkg, instanceId, position);
|
uid, pkg, instanceId, position);
|
||||||
if (pi != null && isPendingIntentValid) {
|
if (pi != null && isPendingIntentValid) {
|
||||||
try {
|
try {
|
||||||
pi.send();
|
ActivityOptions options = ActivityOptions.makeBasic();
|
||||||
|
options.setPendingIntentBackgroundActivityStartMode(
|
||||||
|
MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
|
||||||
|
pi.send(options.toBundle());
|
||||||
} catch (PendingIntent.CanceledException e) {
|
} catch (PendingIntent.CanceledException e) {
|
||||||
Slog.e(TAG, "Could not launch", e);
|
Slog.e(TAG, "Could not launch", e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user