Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Audio Focus on Lineage OS 14.1 #137

Closed
abirke opened this issue Jan 26, 2020 · 5 comments
Closed

No Audio Focus on Lineage OS 14.1 #137

abirke opened this issue Jan 26, 2020 · 5 comments

Comments

@abirke
Copy link

abirke commented Jan 26, 2020

Hi there,

on my phone it appears the app never catches audio focus as other players can play simultaneously and AVRCP commands from headphones start a different player even with Music Player GO playing and in the foreground.

I am running Lineage OS 14.1 (Android 7.1.2) and installed a self-built Music Player GO 4.1.7. Can I take any particular logs to help debugging this or can you point me to some parts of the code (even though I am a total newbie to Kotlin)? This is most probably related to #111 but the only thing I could find so far is that playerService.registerReceiver is indeed called, but I couldn't find any calls to NotificationReceiver.onReceive while playing around.

Anyway, thanks for a great app and for your support!

@enricocid
Copy link
Owner

enricocid commented Jan 26, 2020

Thanks for reporting. Yes, it is related to this issue.

I was able to reproduce the issue on my mother's redmi3 running lineage os 14.1.
The problem is I missed one line of code to set the session active.
The default music player starts because it is probably listed in Android's mediabrowser as the latest active media session so its priority is higher.

Let me know if this apk works good so I can post the changes :)

@enricocid
Copy link
Owner

enricocid commented Jan 26, 2020

(ignore this message, I'm posting it to complete a report to GitHub about links containing underscore at the end not working)

https://drive.google.com/open?id=10MOUf8womczQExFZYtHfaKj4mLGsDjY_

@abirke
Copy link
Author

abirke commented Jan 27, 2020

Wow, that was quick! Thank you, the controls work perfectly fine now. Only fast-forward and rewind are missing, but they might not have been implemented before, anyway?

@enricocid
Copy link
Owner

Wow, that was quick! Thank you, the controls work perfectly fine now. Only fast-forward and rewind are missing, but they might not have been implemented before, anyway?

Thanks :) Fast-forward is still not supported but rewind (KeyEvent.KEYCODE_MEDIA_REWIND) yes. This is the method that handles media buttons intent.
Anyway, I probably missed a keyEvent for the particular button as I implemented this feature almost blindly (don't have this kind of headsets... )

@enricocid
Copy link
Owner

Hi guys.
I have never asked for donations as I don't really need.

This time I'm asking You a little effort.

If You liked my work and You want to manifest support for my project please consider to donate to a friend of mine who is living a very difficult situation (lost his job and the home).

gofundme page

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants