Merge "AudioManager: PendingIntent for media button is immutable"

This commit is contained in:
TreeHugger Robot
2020-10-23 01:54:42 +00:00
committed by Android (Google) Code Review

View File

@@ -4049,7 +4049,8 @@ public class AudioManager {
// the associated intent will be handled by the component being registered
mediaButtonIntent.setComponent(eventReceiver);
PendingIntent pi = PendingIntent.getBroadcast(getContext(),
0/*requestCode, ignored*/, mediaButtonIntent, 0/*flags*/);
0/*requestCode, ignored*/, mediaButtonIntent,
PendingIntent.FLAG_IMMUTABLE);
registerMediaButtonIntent(pi, eventReceiver);
}
@@ -4102,7 +4103,8 @@ public class AudioManager {
// the associated intent will be handled by the component being registered
mediaButtonIntent.setComponent(eventReceiver);
PendingIntent pi = PendingIntent.getBroadcast(getContext(),
0/*requestCode, ignored*/, mediaButtonIntent, 0/*flags*/);
0/*requestCode, ignored*/, mediaButtonIntent,
PendingIntent.FLAG_IMMUTABLE);
unregisterMediaButtonIntent(pi);
}