Merge "Specify explicitly FLAG_IMMUTABLE for PendingIntent"

This commit is contained in:
TreeHugger Robot
2020-11-06 09:42:47 +00:00
committed by Android (Google) Code Review

View File

@@ -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);
}