[Android] Fix mediasession state on playback stop

Geoffrey Métais git at videolan.org
Tue Nov 21 11:02:36 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov 20 18:20:15 2017 +0100| [19d97a9a5639f79754fe412cef65721d08efcbce] | committer: Geoffrey Métais

Fix mediasession state on playback stop

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

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 7a73c7328..217046d88 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -754,9 +754,10 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
             return;
         mMedialibrary.resumeBackgroundOperations();
         mStopped = true;
+        // We must publish state before resetting mCurrentIndex
+        publishState();
         mCurrentIndex = -1;
         executeUpdate();
-        publishState();
         executeUpdateProgress();
     }
 



More information about the Android mailing list