From 81284e05cce68edec9941e59c7f52c48ca67adb9 Mon Sep 17 00:00:00 2001 From: Patrik Date: Sat, 31 Aug 2019 23:33:44 +0200 Subject: When loosing focus with TRANSIENT_MAY_DUCK the app would no longer run onAudioFocusChange This fixes that --- app/src/main/java/github/daneren2005/dsub/util/Util.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java index 791fea91..c1581a26 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/Util.java +++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java @@ -1340,6 +1340,7 @@ public final class Util { audioFocusRequest = new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN) .setAudioAttributes(playbackAttributes) .setOnAudioFocusChangeListener(getAudioFocusChangeListener(context, audioManager)) + .setWillPauseWhenDucked(true) .build(); audioManager.requestAudioFocus(audioFocusRequest); } -- cgit v1.2.3