[Android] Do not call showNotification too soon

Geoffrey Métais git at videolan.org
Wed Jun 8 14:42:42 CEST 2016


vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jun  8 14:41:02 2016 +0200| [f0ff9d4b42859ba741fb971c3ce51c52d705ee66] | committer: Geoffrey Métais

Do not call showNotification too soon

(cherry picked from commit df24c752a6960452f89edbbb10be2d850c15a5e8)

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

 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 975c579..7447f4f 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -568,7 +568,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
             if (update) {
                 for (Callback callback : mCallbacks)
                     callback.onMediaEvent(event);
-                if (mParsed)
+                if (mParsed && mMediaSession != null)
                     showNotification();
             }
         }
@@ -1083,6 +1083,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
     }
 
     private final class MediaSessionCallback extends MediaSessionCompat.Callback {
+
         @Override
         public void onPlay() {
             play();



More information about the Android mailing list