[Android] Ensure wakelock and audiofocus are released

Geoffrey Métais git at videolan.org
Thu Nov 9 16:04:34 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Nov  9 15:56:28 2017 +0100| [99e5eb86f3cc055a20bd240fc8b3fd1e4913a312] | committer: Geoffrey Métais

Ensure wakelock and audiofocus are released

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

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 89a035af6..0a9c4a028 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -731,6 +731,9 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
     };
 
     private void onPlaybackStopped() {
+        if (mWakeLock.isHeld())
+            mWakeLock.release();
+        changeAudioFocus(false);
         if (mStopped)
             return;
         mMedialibrary.resumeBackgroundOperations();
@@ -739,9 +742,6 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
         executeUpdate();
         publishState();
         executeUpdateProgress();
-        if (mWakeLock.isHeld())
-            mWakeLock.release();
-        changeAudioFocus(false);
     }
 
     private void showPlayer() {



More information about the Android mailing list