From 05a6164b145bde9a660ae0494c09b30cb99706bb Mon Sep 17 00:00:00 2001 From: MatHazak Date: Sat, 4 May 2024 03:06:52 +0330 Subject: [PATCH] Make card's pending intent MUTABLE Since the intent will be updated later in RemoteViewsFactory.setOnClickFillInIntent, it should be mutable. --- .../oryanmat/trellowidget/widget/TrelloWidgetProvider.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/github/oryanmat/trellowidget/widget/TrelloWidgetProvider.kt b/app/src/main/kotlin/com/github/oryanmat/trellowidget/widget/TrelloWidgetProvider.kt index f11c14e..51446f8 100644 --- a/app/src/main/kotlin/com/github/oryanmat/trellowidget/widget/TrelloWidgetProvider.kt +++ b/app/src/main/kotlin/com/github/oryanmat/trellowidget/widget/TrelloWidgetProvider.kt @@ -1,7 +1,9 @@ package com.github.oryanmat.trellowidget.widget +import android.annotation.SuppressLint import android.app.PendingIntent import android.app.PendingIntent.FLAG_IMMUTABLE +import android.app.PendingIntent.FLAG_MUTABLE import android.appwidget.AppWidgetManager import android.appwidget.AppWidgetProvider import android.content.Context @@ -105,9 +107,10 @@ class TrelloWidgetProvider : AppWidgetProvider() { return PendingIntent.getActivity(context, appWidgetId, reconfigIntent, FLAG_IMMUTABLE) } + @SuppressLint("MutableImplicitPendingIntent") private fun getCardPendingIntent(context: Context): PendingIntent { // individual card URIs are set in a RemoteViewsFactory.setOnClickFillInIntent - return PendingIntent.getActivity(context, 0, Intent(Intent.ACTION_VIEW), FLAG_IMMUTABLE) + return PendingIntent.getActivity(context, 0, Intent(Intent.ACTION_VIEW), FLAG_MUTABLE) } private fun getTitleIntent(context: Context, board: Board): PendingIntent {