Use FLAG_IMMUTABLE for CarrierKeyDownloadManager

Require that the PendingIntent be immutable so that a malicious app is
 not able to hijack and mutate any of the details.

Test: Android builds
Bug: 155094269
Change-Id: I223047644021a647bce72f229998487bee0c007b
Merged-In: I223047644021a647bce72f229998487bee0c007b
(cherry picked from commit 57fc1fb9e63f545e05ed8c9e3dc2c31c1a591116)
diff --git a/src/java/com/android/internal/telephony/CarrierKeyDownloadManager.java b/src/java/com/android/internal/telephony/CarrierKeyDownloadManager.java
index 1513a33..9a5d522 100644
--- a/src/java/com/android/internal/telephony/CarrierKeyDownloadManager.java
+++ b/src/java/com/android/internal/telephony/CarrierKeyDownloadManager.java
@@ -193,7 +193,7 @@
         int slotId = mPhone.getPhoneId();
         Intent intent = new Intent(INTENT_KEY_RENEWAL_ALARM_PREFIX + slotId);
         PendingIntent carrierKeyDownloadIntent = PendingIntent.getBroadcast(mContext, 0, intent,
-                PendingIntent.FLAG_UPDATE_CURRENT);
+                PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
         AlarmManager alarmManager =
                 (AlarmManager) mContext.getSystemService(mContext.ALARM_SERVICE);
         alarmManager.cancel(carrierKeyDownloadIntent);
@@ -253,7 +253,7 @@
                 Context.ALARM_SERVICE);
         Intent intent = new Intent(INTENT_KEY_RENEWAL_ALARM_PREFIX + slotId);
         PendingIntent carrierKeyDownloadIntent = PendingIntent.getBroadcast(mContext, 0, intent,
-                PendingIntent.FLAG_UPDATE_CURRENT);
+                PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
         alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, minExpirationDate,
                 carrierKeyDownloadIntent);
         Log.d(LOG_TAG, "setRenewelAlarm: action=" + intent.getAction() + " time="