[Android] Do not try to publish playback state on destroy

Geoffrey Métais git at videolan.org
Mon Feb 19 14:47:34 CET 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 19 09:39:58 2018 +0100| [b782d5408ad29ab8a71d5d900e82799480dfdaaa] | committer: Geoffrey Métais

Do not try to publish playback state on destroy

(cherry picked from commit e3f19870e29dbb738df49b1591eb31972c017245)

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

 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 bde6cc665..9313d78c1 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -273,11 +273,12 @@ public class PlaybackService extends MediaBrowserServiceCompat{
     public void onDestroy() {
         super.onDestroy();
         mHandler.removeCallbacksAndMessages(null);
-        stop(true);
         if (mMediaSession != null) {
             mMediaSession.release();
             mMediaSession = null;
         }
+        //Call it once mMediaSession is null, to not publish playback state
+        stop(true);
 
         if (!AndroidDevices.hasTsp && !AndroidDevices.hasPlayServices)
             AndroidDevices.setRemoteControlReceiverEnabled(false);



More information about the Android mailing list