From 55bf2e77d4e54b0eee00e28bbd12bba1c3ab7730 Mon Sep 17 00:00:00 2001 From: Yabin Huang Date: Fri, 25 Jun 2021 16:15:37 -0700 Subject: Specify FLAG_IMMUTABLE when creating PendingIntent Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. So this CL uses FLAG_IMMUTABLE to create the PendingIntent because the flag is recommended in most cases. Bug: 192103710 Test: manual Change-Id: I2ab79dc4a0e6279676135a34ee8230190cbdd27e --- src/com/android/car/messenger/core/util/VoiceUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/com/android/car') diff --git a/src/com/android/car/messenger/core/util/VoiceUtil.java b/src/com/android/car/messenger/core/util/VoiceUtil.java index cb02ee3..6ef246f 100644 --- a/src/com/android/car/messenger/core/util/VoiceUtil.java +++ b/src/com/android/car/messenger/core/util/VoiceUtil.java @@ -223,8 +223,8 @@ public class VoiceUtil { int requestCode = (conversationKey == null) ? action.hashCode() : conversationKey.hashCode(); - return PendingIntent.getForegroundService( - context, requestCode, intent, PendingIntent.FLAG_ONE_SHOT); + return PendingIntent.getForegroundService(context, requestCode, intent, + PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_ONE_SHOT); } /** Sends a reply, meant to be used from a caller originating from voice input. */ -- cgit v1.2.3