Making sure that intents are not overwritten
This commit is contained in:
parent
92e3da28bf
commit
8802535e76
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue