From 9cbb4fa4e7fb8935990d2077d70049c1bedf5c51 Mon Sep 17 00:00:00 2001 From: Mill Chen Date: Mon, 2 Nov 2020 21:41:23 +0800 Subject: [PATCH] Specify explicitly FLAG_IMMUTABLE for PendingIntent The existing pending intent in the BatteryTipUtils has been specified FLAG_UPDATE_CURRENT. This change is to add explicitly FLAG_IMMUTABLE to the pending intent. Fixes: 171506726 Test: build pass, robotest Change-Id: Ib82ddb45e05b492eef300f2ec064803d768419d0 --- .../android/settings/fuelgauge/batterytip/BatteryTipUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/fuelgauge/batterytip/BatteryTipUtils.java b/src/com/android/settings/fuelgauge/batterytip/BatteryTipUtils.java index ed06cce59d1..309811d0ab9 100644 --- a/src/com/android/settings/fuelgauge/batterytip/BatteryTipUtils.java +++ b/src/com/android/settings/fuelgauge/batterytip/BatteryTipUtils.java @@ -124,7 +124,7 @@ public class BatteryTipUtils { throws StatsManager.StatsUnavailableException { final Intent extraIntent = new Intent(context, AnomalyDetectionReceiver.class); final PendingIntent pendingIntent = PendingIntent.getBroadcast(context, REQUEST_CODE, - extraIntent, PendingIntent.FLAG_UPDATE_CURRENT); + extraIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); statsManager.setBroadcastSubscriber(pendingIntent, StatsManagerConfig.ANOMALY_CONFIG_KEY, StatsManagerConfig.SUBSCRIBER_ID); }