[Android] Exit ML service if no action is required

Geoffrey Métais git at videolan.org
Thu Dec 7 17:15:32 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Dec  7 16:40:34 2017 +0100| [a448320e4d3cb24a449f5569c28e07fb0c187d8f] | committer: Geoffrey Métais

Exit ML service if no action is required

(cherry picked from commit e913a3e5d9117731ff7294a2aaa4142a331d7348)

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

 vlc-android/src/org/videolan/vlc/MediaParsingService.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.java b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
index 93657c129..a6a8c28ff 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.java
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
@@ -121,8 +121,10 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
 
     @Override
     public int onStartCommand(Intent intent, int flags, int startId) {
-        if (intent == null)
+        if (intent == null) {
+            exitCommand();
             return START_NOT_STICKY;
+        }
         synchronized (MediaParsingService.this) {
             // Set 1s delay before displaying scan icon
             // Except for Android 8+ which expects startForeground immediately



More information about the Android mailing list