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

Commit af053aa3 authored by Jason Chiu's avatar Jason Chiu Committed by Automerger Merge Worker
Browse files

Merge "Allow the background activity start from legacy suggestion cards" into...

Merge "Allow the background activity start from legacy suggestion cards" into main am: d78409d4 am: 6234e5a2

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/3148096



Change-Id: I8606fde889c1378d23fd87a23522d558d1cf639b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5d5392d4 6234e5a2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.settings.homepage.contextualcards.legacysuggestion;

import android.app.ActivityOptions;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
@@ -79,7 +80,10 @@ public class LegacySuggestionContextualCardController implements ContextualCardC
    @Override
    public void onPrimaryClick(ContextualCard card) {
        try {
            ((LegacySuggestionContextualCard) card).getPendingIntent().send();
            ActivityOptions options = ActivityOptions.makeBasic()
                    .setPendingIntentBackgroundActivityStartMode(
                            ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
            ((LegacySuggestionContextualCard) card).getPendingIntent().send(options.toBundle());
        } catch (PendingIntent.CanceledException e) {
            Log.w(TAG, "Failed to start suggestion " + card.getTitleText());
        }