Don't restart playback when the headset is plugged in
This matches the behavior of other music players for Android.
This commit is contained in:
parent
429aa68350
commit
229f220eef
@ -166,9 +166,10 @@ public class MusicPlayer implements Runnable, MediaPlayer.OnCompletionListener,
|
|||||||
boolean plugged = message.arg1 == 1;
|
boolean plugged = message.arg1 == 1;
|
||||||
if (plugged != mPlugged) {
|
if (plugged != mPlugged) {
|
||||||
mPlugged = plugged;
|
mPlugged = plugged;
|
||||||
if (mCurrentSong == -1 || mPlugged == mMediaPlayer.isPlaying())
|
if (mCurrentSong == -1)
|
||||||
return;
|
return;
|
||||||
setPlaying(mPlugged);
|
if (mMediaPlayer.isPlaying())
|
||||||
|
setPlaying(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HEADSET_PREF_CHANGED:
|
case HEADSET_PREF_CHANGED:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user