[Android] AudioService: fix wakelocks on stop

Edward Wang git at videolan.org
Sat Dec 29 03:23:39 CET 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Fri Dec 28 21:22:24 2012 -0500| [173e89b5f06d87645957e243e4ca5e00d02c28fc] | committer: Edward Wang

AudioService: fix wakelocks on stop

Small logic error with big consequences: removing the event callback before you fire the event :P

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=173e89b5f06d87645957e243e4ca5e00d02c28fc
---

 vlc-android/src/org/videolan/vlc/AudioService.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index 28af067..7716065 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -516,8 +516,8 @@ public class AudioService extends Service {
     }
 
     private void stop() {
-        mEventManager.removeHandler(mEventHandler);
         mLibVLC.stop();
+        mEventManager.removeHandler(mEventHandler);
         setRemoteControlClientPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);
         mCurrentMedia = null;
         mMediaList.clear();



More information about the Android mailing list