From: Thomas Tuttle Date: Thu, 29 Jan 2009 02:06:46 +0000 (-0500) Subject: Make play() call next() if we are at end of track (and not REPEAT_CURRENT). X-Git-Tag: android-x86-1.6~4^2~13 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=272eb78d8836f969f7480454167bdffc6a6f6dd7;p=android-x86%2Fpackages-apps-Music.git Make play() call next() if we are at end of track (and not REPEAT_CURRENT). Signed-off-by: Mike Lockwood --- diff --git a/src/com/android/music/MediaPlaybackService.java b/src/com/android/music/MediaPlaybackService.java index 053e611..6edb4dc 100644 --- a/src/com/android/music/MediaPlaybackService.java +++ b/src/com/android/music/MediaPlaybackService.java @@ -984,6 +984,12 @@ public class MediaPlaybackService extends Service { */ public void play() { if (mPlayer.isInitialized()) { + // if we are at the end of the song, go to the next song first + if (mRepeatMode != REPEAT_CURRENT && + mPlayer.position() >= mPlayer.duration() - 2000) { + next(true); + } + mPlayer.start(); setForeground(true);