From 197af604d653ba91dea44649ea5bf858d77ddd88 Mon Sep 17 00:00:00 2001 From: Stefan Bullones Date: Tue, 18 Aug 2026 04:51:51 +0200 Subject: [PATCH] Pause music playback when another app takes audio focus (#1842) ## Description The audio player passed handleAudioFocus = false when setting its audio attributes, so ExoPlayer never requested audio focus. Music kept playing and mixed with other audio when a call arrived, another app started playback, or voice search took focus. ### Related issues Fixes https://github.com/damontecres/Wholphin/issues/1841 ### Testing 1. Play a music track 2. Open YouTube and play a video ## AI or LLM usage Cursor and Claude Code --- .../com/github/damontecres/wholphin/services/PlayerFactory.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/services/PlayerFactory.kt b/app/src/main/java/com/github/damontecres/wholphin/services/PlayerFactory.kt index cec0a205..cf4128fb 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/services/PlayerFactory.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/services/PlayerFactory.kt @@ -202,9 +202,10 @@ class PlayerFactory it.setAudioAttributes( AudioAttributes .Builder() + .setUsage(C.USAGE_MEDIA) .setContentType(C.AUDIO_CONTENT_TYPE_MUSIC) .build(), - false, + true, ) } }