mirror of
https://github.com/androidx/media.git
synced 2025-05-04 06:00:37 +08:00
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 22ccc1a1286803868970fb2b1eafe63e9c669a5c)
This commit is contained in:
parent
f3268ac8ae
commit
91c51fe94d
@ -216,8 +216,7 @@ import org.checkerframework.checker.initialization.qual.Initialized;
|
|||||||
broadcastReceiver = new MediaButtonReceiver();
|
broadcastReceiver = new MediaButtonReceiver();
|
||||||
IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
|
IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
|
||||||
filter.addDataScheme(castNonNull(sessionUri.getScheme()));
|
filter.addDataScheme(castNonNull(sessionUri.getScheme()));
|
||||||
// TODO(b/197817693): Explicitly indicate whether the receiver should be exported.
|
Util.registerReceiverNotExported(context, broadcastReceiver, filter);
|
||||||
context.registerReceiver(broadcastReceiver, filter);
|
|
||||||
} else {
|
} else {
|
||||||
// Has MediaSessionService to revive playback after it's dead.
|
// Has MediaSessionService to revive playback after it's dead.
|
||||||
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, sessionUri);
|
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, sessionUri);
|
||||||
|
@ -1164,8 +1164,7 @@ public class PlayerNotificationManager {
|
|||||||
Notification notification = builder.build();
|
Notification notification = builder.build();
|
||||||
notificationManager.notify(notificationId, notification);
|
notificationManager.notify(notificationId, notification);
|
||||||
if (!isNotificationStarted) {
|
if (!isNotificationStarted) {
|
||||||
// TODO(b/197817693): Explicitly indicate whether the receiver should be exported.
|
Util.registerReceiverNotExported(context, notificationBroadcastReceiver, intentFilter);
|
||||||
context.registerReceiver(notificationBroadcastReceiver, intentFilter);
|
|
||||||
}
|
}
|
||||||
if (notificationListener != null) {
|
if (notificationListener != null) {
|
||||||
// Always pass true for ongoing with the first notification to tell a service to go into
|
// Always pass true for ongoing with the first notification to tell a service to go into
|
||||||
|
Loading…
x
Reference in New Issue
Block a user