Delay loaded() call a little

Now called when it should be more reasonable to switch songs
This commit is contained in:
Christopher Eby 2010-03-01 21:23:56 -06:00
parent c7e01fc0fe
commit 5d38771c5d

View File

@ -363,15 +363,6 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
broadcastSongChange(getSong(0));
}
int i = mWatchers.beginBroadcast();
while (--i != -1) {
try {
mWatchers.getBroadcastItem(i).loaded();
} catch (RemoteException e) {
}
}
mWatchers.finishBroadcast();
if (stateLoaded)
retrieveSongs();
@ -417,6 +408,15 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
if (mPendingSeek != 0)
mMediaPlayer.seekTo(mPendingSeek);
int i = mWatchers.beginBroadcast();
while (--i != -1) {
try {
mWatchers.getBroadcastItem(i).loaded();
} catch (RemoteException e) {
}
}
mWatchers.finishBroadcast();
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_HEADSET_PLUG);
filter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);