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
This commit is contained in:
Stefan Bullones 2026-08-18 04:51:51 +02:00 • committed by GitHub
parent f89d752d2c
commit 197af604d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -202,9 +202,10 @@ class PlayerFactory
it.setAudioAttributes(
AudioAttributes
.Builder()
.setUsage(C.USAGE_MEDIA)
.setContentType(C.AUDIO_CONTENT_TYPE_MUSIC)
.build(),
false,
true,
)
}
}