Making sure that intents are not overwritten

This commit is contained in:
ByteHamster 2019-09-06 08:09:53 +02:00
parent 92e3da28bf
commit 8802535e76
2 changed files with 3 additions and 0 deletions

View File

@ -516,6 +516,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
private void displayStreamingNotAllowedNotification(Intent originalIntent) {
Intent intentAllowThisTime = new Intent(originalIntent);
intentAllowThisTime.setAction(EXTRA_ALLOW_STREAM_THIS_TIME);
intentAllowThisTime.putExtra(EXTRA_ALLOW_STREAM_THIS_TIME, true);
PendingIntent pendingIntentAllowThisTime;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
@ -525,6 +526,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
}
Intent intentAlwaysAllow = new Intent(intentAllowThisTime);
intentAlwaysAllow.setAction(EXTRA_ALLOW_STREAM_ALWAYS);
intentAlwaysAllow.putExtra(EXTRA_ALLOW_STREAM_ALWAYS, true);
PendingIntent pendingIntentAlwaysAllow;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {

View File

@ -178,6 +178,7 @@ public class PlaybackServiceNotificationBuilder extends NotificationCompat.Build
private PendingIntent getPendingIntentForMediaAction(int keycodeValue, int requestCode) {
Intent intent = new Intent(context, PlaybackService.class);
intent.setAction("MediaCode" + keycodeValue);
intent.putExtra(MediaButtonReceiver.EXTRA_KEYCODE, keycodeValue);
if (Build.VERSION.SDK_INT >= 26) {