summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ashwini Oruganti <ashfall@google.com> 2020-10-30 10:49:45 -0700
committer Ashwini Oruganti <ashfall@google.com> 2020-10-30 10:49:45 -0700
commit4a51385fd9825b33ce345a2beaa0534f39f7e8ce (patch)
tree16b89bd2dc83631f932a42dd5c024c69591790ea
parent56804f05607e5babe4ffd13262a937f54f24d7ee (diff)
Apply FLAG_IMMUTABLE to the PendingIntent in NetworkStatService.java
Broadcast intents sent by AlarmManager are immutable; the system dispatches them without customization. Fixes: 171815343 Test: TH Change-Id: I35ccfc0f69fd98b5803da74d9eb12902b351acc7 Merged-In: I35ccfc0f69fd98b5803da74d9eb12902b351acc7
-rw-r--r--services/core/java/com/android/server/net/NetworkStatsService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java
index 71e7c8adc5db..12c24d418611 100644
--- a/services/core/java/com/android/server/net/NetworkStatsService.java
+++ b/services/core/java/com/android/server/net/NetworkStatsService.java
@@ -552,7 +552,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
// schedule periodic pall alarm based on {@link NetworkStatsSettings#getPollInterval()}.
final PendingIntent pollIntent =
- PendingIntent.getBroadcast(mContext, 0, new Intent(ACTION_NETWORK_STATS_POLL), 0);
+ PendingIntent.getBroadcast(mContext, 0, new Intent(ACTION_NETWORK_STATS_POLL),
+ PendingIntent.FLAG_IMMUTABLE);
final long currentRealtime = SystemClock.elapsedRealtime();
mAlarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, currentRealtime,