Update PlaybackHandler.java
This commit is contained in:
parent
37aa73879c
commit
f86c30c608
1 changed files with 6 additions and 1 deletions
|
@ -36,6 +36,8 @@ class PlaybackHandler extends Handler {
|
|||
|
||||
@NonNull private final WeakReference<MusicService> mService;
|
||||
private float currentDuckVolume = 1.0f;
|
||||
private boolean sFocusEnabled = PreferenceUtil.INSTANCE.isAudioFocusEnabled();
|
||||
|
||||
|
||||
PlaybackHandler(final MusicService service, @NonNull final Looper looper) {
|
||||
super(looper);
|
||||
|
@ -146,7 +148,10 @@ class PlaybackHandler extends Handler {
|
|||
|
||||
case AudioManager.AUDIOFOCUS_LOSS:
|
||||
// Lost focus for an unbounded amount of time: stop playback and release media playback
|
||||
boolean isAudioFocusEnabled = PreferenceUtil.INSTANCE.isAudioFocusEnabled();
|
||||
if (!isAudioFocusEnabled) {
|
||||
service.forcePause();
|
||||
}
|
||||
break;
|
||||
|
||||
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue