Commit 22a4e01b authored by Geoffrey Métais's avatar Geoffrey Métais

Do not stop PlaybackService on audiofocus loss

parent 8bb13f13
......@@ -359,9 +359,9 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
switch (focusChange) {
case AudioManager.AUDIOFOCUS_LOSS:
Log.i(TAG, "AUDIOFOCUS_LOSS");
// Stop playback
// Pause playback
changeAudioFocus(false);
stop();
pause();
break;
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
Log.i(TAG, "AUDIOFOCUS_LOSS_TRANSIENT");
......@@ -397,7 +397,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
}
@TargetApi(Build.VERSION_CODES.FROYO)
private void changeAudioFocusFroyoOrLater(boolean acquire) {
private void changeAudioFocus(boolean acquire) {
final AudioManager am = (AudioManager)getSystemService(AUDIO_SERVICE);
if (am == null)
return;
......@@ -420,11 +420,6 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
}
}
private void changeAudioFocus(boolean acquire) {
if (AndroidUtil.isFroyoOrLater())
changeAudioFocusFroyoOrLater(acquire);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void registerV21() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment