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

Geoffrey Métais git at videolan.org
Mon Feb 19 09:40:32 CET 2018


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

Do not try to publish playback state on destroy

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

 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