From 018a91d66ce42e31e493117467dfa8be76301f26 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 27 May 2020 11:02:41 +0200 Subject: [PATCH 1/3] Made PendingIntent request codes unique --- .../config/DownloadServiceCallbacksImpl.java | 15 ++++++++------ .../core/service/PlayerWidgetJobService.java | 14 +++++-------- .../service/playback/PlaybackService.java | 20 +++++++++++-------- .../PlaybackServiceNotificationBuilder.java | 4 ++-- .../antennapod/core/sync/SyncService.java | 4 ++-- core/src/main/res/values/ids.xml | 10 ++++++++++ 6 files changed, 40 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java index b810b390a..71442f50b 100644 --- a/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java +++ b/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java @@ -5,11 +5,10 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; +import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.DownloadAuthenticationActivity; import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.adapter.NavListAdapter; import de.danoeh.antennapod.core.DownloadServiceCallbacks; -import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.service.download.DownloadRequest; import de.danoeh.antennapod.fragment.DownloadsFragment; import de.danoeh.antennapod.fragment.QueueFragment; @@ -24,7 +23,8 @@ public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks { Bundle args = new Bundle(); args.putInt(DownloadsFragment.ARG_SELECTED_TAB, DownloadsFragment.POS_RUNNING); intent.putExtra(MainActivity.EXTRA_FRAGMENT_ARGS, args); - return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); + return PendingIntent.getActivity(context, + R.id.pending_intent_download_service_notification, intent, PendingIntent.FLAG_UPDATE_CURRENT); } @Override @@ -32,7 +32,8 @@ public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks { final Intent activityIntent = new Intent(context.getApplicationContext(), DownloadAuthenticationActivity.class); activityIntent.putExtra(DownloadAuthenticationActivity.ARG_DOWNLOAD_REQUEST, request); activityIntent.putExtra(DownloadAuthenticationActivity.ARG_SEND_TO_DOWNLOAD_REQUESTER_BOOL, true); - return PendingIntent.getActivity(context.getApplicationContext(), 0, activityIntent, PendingIntent.FLAG_ONE_SHOT); + return PendingIntent.getActivity(context.getApplicationContext(), + R.id.pending_intent_download_service_auth, activityIntent, PendingIntent.FLAG_ONE_SHOT); } @Override @@ -42,14 +43,16 @@ public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks { Bundle args = new Bundle(); args.putInt(DownloadsFragment.ARG_SELECTED_TAB, DownloadsFragment.POS_LOG); intent.putExtra(MainActivity.EXTRA_FRAGMENT_ARGS, args); - return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); + return PendingIntent.getActivity(context, R.id.pending_intent_download_service_report, + intent, PendingIntent.FLAG_UPDATE_CURRENT); } @Override public PendingIntent getAutoDownloadReportNotificationContentIntent(Context context) { Intent intent = new Intent(context, MainActivity.class); intent.putExtra(MainActivity.EXTRA_FRAGMENT_TAG, QueueFragment.TAG); - return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); + return PendingIntent.getActivity(context, R.id.pending_intent_download_service_autodownload_report, + intent, PendingIntent.FLAG_UPDATE_CURRENT); } @Override diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java index 4562f1393..f39ac0df8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java @@ -103,12 +103,8 @@ public class PlayerWidgetJobService extends SafeJobIntentService { AppWidgetManager manager = AppWidgetManager.getInstance(this); int[] widgetIds = manager.getAppWidgetIds(playerWidget); RemoteViews views = new RemoteViews(getPackageName(), R.layout.player_widget); - PendingIntent startMediaplayer = PendingIntent.getActivity(this, 0, - PlaybackService.getPlayerActivityIntent(this), 0); - - final PendingIntent startAppPending = PendingIntent.getActivity(this, 0, - PlaybackService.getPlayerActivityIntent(this), - PendingIntent.FLAG_UPDATE_CURRENT); + final PendingIntent startMediaPlayer = PendingIntent.getActivity(this, R.id.pending_intent_player_activity, + PlaybackService.getPlayerActivityIntent(this), PendingIntent.FLAG_UPDATE_CURRENT); boolean nothingPlaying = false; Playable media; @@ -122,7 +118,7 @@ public class PlayerWidgetJobService extends SafeJobIntentService { } if (media != null) { - views.setOnClickPendingIntent(R.id.layout_left, startMediaplayer); + views.setOnClickPendingIntent(R.id.layout_left, startMediaPlayer); try { Bitmap icon = null; @@ -170,8 +166,8 @@ public class PlayerWidgetJobService extends SafeJobIntentService { if (nothingPlaying) { // start the app if they click anything - views.setOnClickPendingIntent(R.id.layout_left, startAppPending); - views.setOnClickPendingIntent(R.id.butPlay, startAppPending); + views.setOnClickPendingIntent(R.id.layout_left, startMediaPlayer); + views.setOnClickPendingIntent(R.id.butPlay, startMediaPlayer); views.setViewVisibility(R.id.txtvProgress, View.GONE); views.setViewVisibility(R.id.txtvTitle, View.GONE); views.setViewVisibility(R.id.txtNoPlaying, View.VISIBLE); diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 33a2a72ff..f25b0a5a8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -542,9 +542,11 @@ public class PlaybackService extends MediaBrowserServiceCompat { intentAllowThisTime.putExtra(EXTRA_ALLOW_STREAM_THIS_TIME, true); PendingIntent pendingIntentAllowThisTime; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { - pendingIntentAllowThisTime = PendingIntent.getForegroundService(this, 0, intentAllowThisTime, PendingIntent.FLAG_UPDATE_CURRENT); + pendingIntentAllowThisTime = PendingIntent.getForegroundService(this, + R.id.pending_intent_allow_stream_this_time, intentAllowThisTime, PendingIntent.FLAG_UPDATE_CURRENT); } else { - pendingIntentAllowThisTime = PendingIntent.getService(this, 0, intentAllowThisTime, PendingIntent.FLAG_UPDATE_CURRENT); + pendingIntentAllowThisTime = PendingIntent.getService(this, + R.id.pending_intent_allow_stream_this_time, intentAllowThisTime, PendingIntent.FLAG_UPDATE_CURRENT); } Intent intentAlwaysAllow = new Intent(intentAllowThisTime); @@ -552,12 +554,15 @@ public class PlaybackService extends MediaBrowserServiceCompat { intentAlwaysAllow.putExtra(EXTRA_ALLOW_STREAM_ALWAYS, true); PendingIntent pendingIntentAlwaysAllow; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { - pendingIntentAlwaysAllow = PendingIntent.getForegroundService(this, 0, intentAlwaysAllow, PendingIntent.FLAG_UPDATE_CURRENT); + pendingIntentAlwaysAllow = PendingIntent.getForegroundService(this, + R.id.pending_intent_allow_stream_always, intentAlwaysAllow, PendingIntent.FLAG_UPDATE_CURRENT); } else { - pendingIntentAlwaysAllow = PendingIntent.getService(this, 0, intentAlwaysAllow, PendingIntent.FLAG_UPDATE_CURRENT); + pendingIntentAlwaysAllow = PendingIntent.getService(this, + R.id.pending_intent_allow_stream_always, intentAlwaysAllow, PendingIntent.FLAG_UPDATE_CURRENT); } - NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NotificationUtils.CHANNEL_ID_USER_ACTION) + NotificationCompat.Builder builder = new NotificationCompat.Builder(this, + NotificationUtils.CHANNEL_ID_USER_ACTION) .setSmallIcon(R.drawable.ic_stream_white) .setContentTitle(getString(R.string.confirm_mobile_streaming_notification_title)) .setContentText(getString(R.string.confirm_mobile_streaming_notification_message)) @@ -1238,9 +1243,8 @@ public class PlaybackService extends MediaBrowserServiceCompat { } } if (!Thread.currentThread().isInterrupted() && stateManager.hasReceivedValidStartCommand()) { - mediaSession.setSessionActivity(PendingIntent.getActivity(this, 0, - PlaybackService.getPlayerActivityIntent(this), - PendingIntent.FLAG_UPDATE_CURRENT)); + mediaSession.setSessionActivity(PendingIntent.getActivity(this, R.id.pending_intent_player_activity, + PlaybackService.getPlayerActivityIntent(this), PendingIntent.FLAG_UPDATE_CURRENT)); try { mediaSession.setMetadata(builder.build()); } catch (OutOfMemoryError e) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java index 174b43846..915e77f6c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java @@ -146,8 +146,8 @@ public class PlaybackServiceNotificationBuilder { } private PendingIntent getPlayerActivityPendingIntent() { - return PendingIntent.getActivity(context, 0, PlaybackService.getPlayerActivityIntent(context), - PendingIntent.FLAG_UPDATE_CURRENT); + return PendingIntent.getActivity(context, R.id.pending_intent_player_activity, + PlaybackService.getPlayerActivityIntent(context), PendingIntent.FLAG_UPDATE_CURRENT); } private void addActions(NotificationCompat.Builder notification, MediaSessionCompat.Token mediaSessionToken, diff --git a/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java b/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java index 6985e4421..4c89ebc19 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java @@ -488,8 +488,8 @@ public class SyncService extends Worker { Intent intent = getApplicationContext().getPackageManager().getLaunchIntentForPackage( getApplicationContext().getPackageName()); - PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, - PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), + R.id.pending_intent_sync_error, intent, PendingIntent.FLAG_UPDATE_CURRENT); Notification notification = new NotificationCompat.Builder(getApplicationContext(), NotificationUtils.CHANNEL_ID_ERROR) .setContentTitle(getApplicationContext().getString(R.string.gpodnetsync_error_title)) diff --git a/core/src/main/res/values/ids.xml b/core/src/main/res/values/ids.xml index 1d1777ef1..8443759b4 100644 --- a/core/src/main/res/values/ids.xml +++ b/core/src/main/res/values/ids.xml @@ -25,4 +25,14 @@ + + + + + + + + + + \ No newline at end of file From 84b9cf9dbb050d078f836c357cf9cd79aa947065 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 27 May 2020 11:06:30 +0200 Subject: [PATCH 2/3] Cleaned up unused IDs --- .../antennapod/activity/MainActivity.java | 2 +- .../adapter/EpisodeItemListAdapter.java | 2 +- core/src/main/res/values/ids.xml | 19 ++++++------------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 655049b2c..e05538b63 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -91,7 +91,7 @@ public class MainActivity extends CastEnabledActivity { super.onCreate(savedInstanceState); StorageUtils.checkStorageAvailability(this); setContentView(R.layout.main); - recycledViewPool.setMaxRecycledViews(R.id.episode_item_view_holder, 25); + recycledViewPool.setMaxRecycledViews(R.id.view_type_episode_item, 25); drawerLayout = findViewById(R.id.drawer_layout); navDrawer = findViewById(R.id.navDrawerFragment); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java index d391f1c54..7099d6f3a 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java @@ -44,7 +44,7 @@ public class EpisodeItemListAdapter extends RecyclerView.Adapter - - - - + - - - - - - + + + + + - - - From 31404f72cf972c303c4ea7e0c8ca5aa58dc87d49 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 27 May 2020 11:11:31 +0200 Subject: [PATCH 3/3] Made notification IDs unique --- .../service/download/DownloadService.java | 13 +++++------ .../download/DownloadServiceNotification.java | 6 ++--- .../service/playback/PlaybackService.java | 23 ++++++++----------- core/src/main/res/values/ids.xml | 5 ++++ 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 28523ef0a..ba7019fd9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -17,6 +17,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.sync.SyncService; import org.apache.commons.io.FileUtils; import org.greenrobot.eventbus.EventBus; @@ -87,8 +88,6 @@ public class DownloadService extends Service { public static final String EXTRA_CLEANUP_MEDIA = "cleanupMedia"; - public static final int NOTIFICATION_ID = 2; - /** * Contains all completed downloads that have not been included in the report yet. */ @@ -165,7 +164,7 @@ public class DownloadService extends Service { if (intent != null && intent.getParcelableArrayListExtra(EXTRA_REQUESTS) != null) { Notification notification = notificationManager.updateNotifications( requester.getNumberOfDownloads(), downloads); - startForeground(NOTIFICATION_ID, notification); + startForeground(R.id.notification_downloading, notification); syncExecutor.execute(() -> onDownloadQueued(intent)); } else if (numberOfDownloads.get() == 0) { stopSelf(); @@ -191,7 +190,7 @@ public class DownloadService extends Service { Notification notification = notificationManager.updateNotifications( requester.getNumberOfDownloads(), downloads); - startForeground(NOTIFICATION_ID, notification); + startForeground(R.id.notification_downloading, notification); } @Override @@ -229,7 +228,7 @@ public class DownloadService extends Service { stopForeground(true); NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); - nm.cancel(NOTIFICATION_ID); + nm.cancel(R.id.notification_downloading); // if this was the initial gpodder sync, i.e. we just synced the feeds successfully, // it is now time to sync the episode actions @@ -566,7 +565,7 @@ public class DownloadService extends Service { setupNotificationUpdater(); Notification notification = notificationManager.updateNotifications( requester.getNumberOfDownloads(), downloads); - startForeground(NOTIFICATION_ID, notification); + startForeground(R.id.notification_downloading, notification); } } @@ -642,7 +641,7 @@ public class DownloadService extends Service { Notification n = notificationManager.updateNotifications(requester.getNumberOfDownloads(), downloads); if (n != null) { NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - nm.notify(NOTIFICATION_ID, n); + nm.notify(R.id.notification_downloading, n); } } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java index f487193f3..64666d25d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java @@ -17,8 +17,6 @@ import java.util.List; public class DownloadServiceNotification { private static final String TAG = "DownloadSvcNotification"; - private static final int REPORT_ID = 3; - private static final int AUTO_REPORT_ID = 4; private final Context context; private NotificationCompat.Builder notificationCompatBuilder; @@ -147,14 +145,14 @@ public class DownloadServiceNotification { titleId = R.string.auto_download_report_title; iconId = R.drawable.ic_notification_auto_download_complete; intent = ClientConfig.downloadServiceCallbacks.getAutoDownloadReportNotificationContentIntent(context); - id = AUTO_REPORT_ID; + id = R.id.notification_auto_download_report; content = createAutoDownloadNotificationContent(reportQueue); } else { channelId = NotificationUtils.CHANNEL_ID_ERROR; titleId = R.string.download_report_title; iconId = R.drawable.ic_notification_sync_error; intent = ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(context); - id = REPORT_ID; + id = R.id.notification_download_report; content = String.format(context.getString(R.string.download_report_content), successfulDownloads, failedDownloads); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index f25b0a5a8..bd17ff383 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -204,9 +204,6 @@ public class PlaybackService extends MediaBrowserServiceCompat { */ private static volatile boolean isCasting = false; - private static final int NOTIFICATION_ID = 1; - private static final int NOTIFICATION_ID_STREAMING = 2; - private PlaybackServiceMediaPlayer mediaPlayer; private PlaybackServiceTaskManager taskManager; private PlaybackServiceFlavorHelper flavorHelper; @@ -271,7 +268,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { stateManager = new PlaybackServiceStateManager(this); notificationBuilder = new PlaybackServiceNotificationBuilder(this); - stateManager.startForeground(NOTIFICATION_ID, notificationBuilder.build()); + stateManager.startForeground(R.id.notification_playing, notificationBuilder.build()); registerReceiver(autoStateUpdated, new IntentFilter("com.google.android.gms.car.media.STATUS")); registerReceiver(headsetDisconnected, new IntentFilter(Intent.ACTION_HEADSET_PLUG)); @@ -334,7 +331,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { if (notificationBuilder.getPlayerStatus() == PlayerStatus.PLAYING) { notificationBuilder.setPlayerStatus(PlayerStatus.STOPPED); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); - notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); + notificationManager.notify(R.id.notification_playing, notificationBuilder.build()); } stateManager.stopForeground(!UserPreferences.isPersistNotify()); isRunning = false; @@ -450,9 +447,9 @@ public class PlaybackService extends MediaBrowserServiceCompat { super.onStartCommand(intent, flags, startId); Log.d(TAG, "OnStartCommand called"); - stateManager.startForeground(NOTIFICATION_ID, notificationBuilder.build()); + stateManager.startForeground(R.id.notification_playing, notificationBuilder.build()); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); - notificationManager.cancel(NOTIFICATION_ID_STREAMING); + notificationManager.cancel(R.id.notification_streaming_confirmation); final int keycode = intent.getIntExtra(MediaButtonReceiver.EXTRA_KEYCODE, -1); final boolean castDisconnect = intent.getBooleanExtra(EXTRA_CAST_DISCONNECT, false); @@ -578,7 +575,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { pendingIntentAlwaysAllow) .setAutoCancel(true); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); - notificationManager.notify(NOTIFICATION_ID_STREAMING, builder.build()); + notificationManager.notify(R.id.notification_streaming_confirmation, builder.build()); } /** @@ -1293,7 +1290,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { notificationBuilder.updatePosition(getCurrentPosition(), getCurrentPlaybackSpeed()); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); - notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); + notificationManager.notify(R.id.notification_playing, notificationBuilder.build()); startForegroundIfPlaying(playerStatus); if (!notificationBuilder.isIconCached()) { @@ -1301,7 +1298,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { Log.d(TAG, "Loading notification icon"); notificationBuilder.loadIcon(); if (!Thread.currentThread().isInterrupted()) { - notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); + notificationManager.notify(R.id.notification_playing, notificationBuilder.build()); } }); notificationSetupThread.start(); @@ -1313,12 +1310,12 @@ public class PlaybackService extends MediaBrowserServiceCompat { if (stateManager.hasReceivedValidStartCommand()) { if (isCasting || status == PlayerStatus.PLAYING || status == PlayerStatus.PREPARING || status == PlayerStatus.SEEKING) { - stateManager.startForeground(NOTIFICATION_ID, notificationBuilder.build()); + stateManager.startForeground(R.id.notification_playing, notificationBuilder.build()); Log.d(TAG, "foreground"); } else { stateManager.stopForeground(false); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); - notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); + notificationManager.notify(R.id.notification_playing, notificationBuilder.build()); } } } @@ -1721,7 +1718,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { notificationBuilder.updatePosition(getCurrentPosition(), getCurrentPlaybackSpeed()); NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); - notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); + notificationManager.notify(R.id.notification_playing, notificationBuilder.build()); } skipEndingIfNecessary(); }); diff --git a/core/src/main/res/values/ids.xml b/core/src/main/res/values/ids.xml index bfb6fc9be..3c173b72d 100644 --- a/core/src/main/res/values/ids.xml +++ b/core/src/main/res/values/ids.xml @@ -18,6 +18,11 @@ + + + + +