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: I4c9076e10ee6a6227ae9daea1e2f2ad3363671b8
diff --git a/src/com/android/car/systemupdater/UpdateLayoutFragment.java b/src/com/android/car/systemupdater/UpdateLayoutFragment.java
index ff56371..0ba5b90 100644
--- a/src/com/android/car/systemupdater/UpdateLayoutFragment.java
+++ b/src/com/android/car/systemupdater/UpdateLayoutFragment.java
@@ -279,7 +279,7 @@
context,
/* requestCode= */ 0,
intent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
return new Notification.Builder(context, NOTIFICATION_CHANNEL_ID)
.setVisibility(Notification.VISIBILITY_PUBLIC)