From 0b60a8acee6439d290f7d2cda5cc72f4ee7b11d4 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 27 May 2020 11:48:19 +0200 Subject: [PATCH] Do not show service running notification on onCreate Sometimes (Bluetooth/Android Auto), the service is created and then just bound to. That means that onStartCommand is never called. This causes a persistent notification. Just in case the notification is somehow still shown to users, modified the message to tell them how to hide it. --- .../antennapod/core/service/playback/PlaybackService.java | 1 - .../service/playback/PlaybackServiceNotificationBuilder.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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 3257e2eea..585510ef8 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 @@ -269,7 +269,6 @@ public class PlaybackService extends MediaBrowserServiceCompat { stateManager = new PlaybackServiceStateManager(this); notificationBuilder = new PlaybackServiceNotificationBuilder(this); - 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)); 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 915e77f6c..4bb88200a 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 @@ -131,7 +131,7 @@ public class PlaybackServiceNotificationBuilder { } } else { notification.setContentTitle(context.getString(R.string.app_name)); - notification.setContentText("Service is running"); + notification.setContentText("Loading. If this does not go away, play any episode and contact us."); } notification.setContentIntent(getPlayerActivityPendingIntent());