Explicitly define mutability for PendingIntents

This commit is contained in:
Moez Bhatti
2022-12-12 18:25:46 -05:00
parent 2c332c06b6
commit 634f04b7aa
8 changed files with 22 additions and 22 deletions
@@ -73,7 +73,7 @@ public class DownloadManager {
download.putExtra(MmsReceivedReceiver.EXTRA_TRIGGER_PUSH, byPush);
download.putExtra(MmsReceivedReceiver.EXTRA_URI, uri);
final PendingIntent pendingIntent = PendingIntent.getBroadcast(
context, 0, download, PendingIntent.FLAG_CANCEL_CURRENT);
context, 0, download, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
final SmsManager smsManager = SmsManagerFactory.INSTANCE.createSmsManager(subscriptionId);
Bundle configOverrides = new Bundle();
@@ -309,7 +309,7 @@ public class RetryScheduler implements Observer {
Intent service = new Intent(TransactionService.ACTION_ONALARM,
null, context, TransactionService.class);
PendingIntent operation = PendingIntent.getService(
context, 0, service, PendingIntent.FLAG_ONE_SHOT);
context, 0, service, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
AlarmManager am = (AlarmManager) context.getSystemService(
Context.ALARM_SERVICE);
am.set(AlarmManager.RTC, retryAt, operation);
@@ -101,7 +101,7 @@ class Transaction @JvmOverloads constructor(private val context: Context, settin
sentIntent.putExtra(EXTRA_CONTENT_URI, messageUri.toString())
sentIntent.putExtra(EXTRA_FILE_PATH, sendFile.path)
val sentPI = PendingIntent.getBroadcast(context, 0, sentIntent, PendingIntent.FLAG_CANCEL_CURRENT)
val sentPI = PendingIntent.getBroadcast(context, 0, sentIntent, PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE)
val updatedIntent = Intent(MMS_UPDATED).putExtra("uri", messageUri.toString())
BroadcastUtils.addClassName(context, updatedIntent, MMS_UPDATED)