maxrave-dev / SimpMusic

A simple music app using YouTube Music for backend

Home Page:https://simpmusic.tech/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Music not playing after TAKE_AUDIO_FOCUS is revoked

rabaimorp opened this issue · comments

Describe the bug
App can't play music after TAKE_AUDIO_FOCUS is revoked

To Reproduce
Steps to reproduce the behavior:
# appops set com.maxrave.simpmusic TAKE_AUDIO_FOCUS ignore
Restart the app
Try to play music (and it doesn't work!)

Expected behavior
After taking audio focus and restarting the app music still plays but doesn't take audio focus anymore.

What is TAKE AUDIO FOCUS? I never heard before

Its an app operation that is allowed for all apps by default, however the user can disable it manually. It allows apps to play audio that takes over (stops) other audio playing at that time. All apps do this by default, but I usually disable this in the apps I use because it prevents multiple apps playing audio at the same time. The bug is that SimpMusic simply stops playing audio entirely if I disable TAKE_AUDIO_FOCUS for SimpMusic by running the command as root or adb shown above.