OSDN Git Service

Looks like something got lost during a previous commit, upload or submit.
authorMarco Nelissen <marcone@google.com>
Mon, 11 May 2009 16:56:31 +0000 (09:56 -0700)
committerMarco Nelissen <marcone@google.com>
Mon, 11 May 2009 16:56:31 +0000 (09:56 -0700)
src/com/android/music/MediaPlaybackService.java

index 560e841..6bfb9a9 100644 (file)
@@ -1056,13 +1056,15 @@ public class MediaPlaybackService extends Service {
      * Pauses playback (call play() to resume)
      */
     public void pause() {
-        if (isPlaying()) {
-            mPlayer.pause();
-            gotoIdleState();
-            setForeground(false);
-            mIsSupposedToBePlaying = false;
-            notifyChange(PLAYSTATE_CHANGED);
-            saveBookmarkIfNeeded();
+        synchronized(this) {
+            if (isPlaying()) {
+                mPlayer.pause();
+                gotoIdleState();
+                setForeground(false);
+                mIsSupposedToBePlaying = false;
+                notifyChange(PLAYSTATE_CHANGED);
+                saveBookmarkIfNeeded();
+            }
         }
     }