From 90edc614a423ee38121dd9b96e3b649eb4011bdd Mon Sep 17 00:00:00 2001 From: Skeletrobro <67814129+baronhsieh2005@users.noreply.github.com> Date: Sat, 31 Aug 2024 03:57:56 -0400 Subject: [PATCH] Specified PendingIntent Mutability --- .../com/pennapps/labs/pennmobile/LaundryBroadcastReceiver.kt | 2 +- .../java/com/pennapps/labs/pennmobile/adapters/HomeAdapter.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/LaundryBroadcastReceiver.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/LaundryBroadcastReceiver.kt index d7d0a21a..7df446cb 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/LaundryBroadcastReceiver.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/LaundryBroadcastReceiver.kt @@ -64,7 +64,7 @@ class LaundryBroadcastReceiver : BroadcastReceiver() { notificationManager.notify(notificationID, mBuilder.build()) // cancel intent after notification/alarm goes off - val fromIntent = PendingIntent.getBroadcast(context, id, intent, PendingIntent.FLAG_NO_CREATE) + val fromIntent = PendingIntent.getBroadcast(context, id, intent, PendingIntent.FLAG_NO_CREATE or PendingIntent.FLAG_IMMUTABLE) fromIntent?.cancel() } } diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/HomeAdapter.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/HomeAdapter.kt index d3bf766f..1ed8bbe6 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/HomeAdapter.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/HomeAdapter.kt @@ -386,7 +386,7 @@ class HomeAdapter( mContext, 0, share, - PendingIntent.FLAG_CANCEL_CURRENT, + PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE, ), ) customTabsIntent = builder?.build() @@ -567,7 +567,7 @@ class HomeAdapter( mContext, 0, share, - PendingIntent.FLAG_CANCEL_CURRENT, + PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE, ), ) customTabsIntent = builder?.build()