Mark the EntitlementManager PendingIntents as immutable.

These are read-only intents and should not be mutated by any
app receiving them.

Bug: 178324405
Bug: 178249531
Test: atest TetheringTests TetheringCoverageTests GtsTetheringTestCases
Change-Id: I5395e7c19e6453640ad790f2b9a9ba22bbcefa88
This commit is contained in:
Lorenzo Colitti
2021-01-26 13:11:25 +09:00
parent ae27ecf5ad
commit a36d65da0a

View File

@@ -418,7 +418,8 @@ public class EntitlementManager {
if (period <= 0) return; if (period <= 0) return;
Intent intent = new Intent(ACTION_PROVISIONING_ALARM); Intent intent = new Intent(ACTION_PROVISIONING_ALARM);
mProvisioningRecheckAlarm = PendingIntent.getBroadcast(mContext, 0, intent, 0); mProvisioningRecheckAlarm = PendingIntent.getBroadcast(mContext, 0, intent,
PendingIntent.FLAG_IMMUTABLE);
AlarmManager alarmManager = (AlarmManager) mContext.getSystemService( AlarmManager alarmManager = (AlarmManager) mContext.getSystemService(
Context.ALARM_SERVICE); Context.ALARM_SERVICE);
long periodMs = period * MS_PER_HOUR; long periodMs = period * MS_PER_HOUR;