[Android] Set playback service not sticky

Geoffrey Métais git at videolan.org
Fri Oct 13 16:56:16 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Oct 13 15:24:32 2017 +0200| [d5adc17bc0bf00c1a690e5db9f8fa65d44dc290f] | committer: Geoffrey Métais

Set playback service not sticky

> https://code.videolan.org/videolan/vlc-android/commit/d5adc17bc0bf00c1a690e5db9f8fa65d44dc290f
---

 vlc-android/src/org/videolan/vlc/PlaybackService.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index d793bf947..49af43b3e 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -323,15 +323,15 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
     @Override
     public int onStartCommand(Intent intent, int flags, int startId) {
         if (intent == null)
-            return START_STICKY;
+            return START_NOT_STICKY;
         final String action = intent.getAction();
         if (Intent.ACTION_MEDIA_BUTTON.equals(action)) {
             MediaButtonReceiver.handleIntent(mMediaSession, intent);
-            return START_STICKY;
+            return START_NOT_STICKY;
         }
         if (ACTION_REMOTE_PLAYPAUSE.equals(action)) {
             if (hasCurrentMedia())
-                return super.onStartCommand(intent, flags, startId);
+                return START_NOT_STICKY;
             else
                 loadLastAudioPlaylist();
         } else if (ACTION_REMOTE_PLAY.equals(action)) {
@@ -346,7 +346,7 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
             mMediaSession.getController().getTransportControls()
                     .playFromSearch(extras.getString(SearchManager.QUERY), extras);
         }
-        return super.onStartCommand(intent, flags, startId);
+        return START_NOT_STICKY;
     }
 
     @Override



More information about the Android mailing list