Commit 91c51fe9 by tonihei Committed by christosts

Mark broadcast receivers as not exported

They are called from the system only and don't need to be exported
to be visible to other apps.

PiperOrigin-RevId: 489210264
(cherry picked from commit 22ccc1a1)
parent f3268ac8
......@@ -216,8 +216,7 @@ import org.checkerframework.checker.initialization.qual.Initialized;
broadcastReceiver = new MediaButtonReceiver();
IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
filter.addDataScheme(castNonNull(sessionUri.getScheme()));
// TODO(b/197817693): Explicitly indicate whether the receiver should be exported.
context.registerReceiver(broadcastReceiver, filter);
Util.registerReceiverNotExported(context, broadcastReceiver, filter);
} else {
// Has MediaSessionService to revive playback after it's dead.
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, sessionUri);
......
......@@ -1164,8 +1164,7 @@ public class PlayerNotificationManager {
Notification notification = builder.build();
notificationManager.notify(notificationId, notification);
if (!isNotificationStarted) {
// TODO(b/197817693): Explicitly indicate whether the receiver should be exported.
context.registerReceiver(notificationBroadcastReceiver, intentFilter);
Util.registerReceiverNotExported(context, notificationBroadcastReceiver, intentFilter);
}
if (notificationListener != null) {
// Always pass true for ongoing with the first notification to tell a service to go into
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment