Feat: Add media output switcher support for original equipment manufacturers (OEMs)
Code sources: https://github.com/Moriafly/media-kit and https://github.com/Yos-X/FlamingoSank
The functionality works as follows across different Android versions and OEM ROMs:
- For Android 14 and higher, it uses MediaRouter2#showSystemOutputSwitcher.
- For Android 12 and higher, it uses the “com.android.systemui.action.LAUNCH_MEDIA_OUTPUT_DIALOG” action.
- For Android 11, it uses the “com.android.settings.panel.action.MEDIA_OUTPUT” action.
- For MIUI (Xiaomi), it uses “miui.systemui.miplay.MiPlayDetailActivity”.
- For One UI (Samsung), it uses “com.samsung.android.mdx.quickboard.view.MediaActivity”.
If you have any more questions, let's talk about them tomorrow. I'm going to bed now.
@ghhccghk
Can you please:
- move the output switcher button to the top right like you mentioned before
- use .xml icon for output switcher instead of .png
- remove xiaomi and samsung specific code for now, because it'll get stale and there's no way for me to know when xiaomi or samsung update their apis
- use "git rebase" to update your pr branch on top of latest gramophone
thank you!
@ghhccghk
Can you please:
- move the output switcher button to the top right like you mentioned before
- use .xml icon for output switcher instead of .png
- remove xiaomi and samsung specific code for now, because it'll get stale and there's no way for me to know when xiaomi or samsung update their apis
- use "git rebase" to update your pr branch on top of latest gramophone
thank you!
OK, I have confirmed that Xiaomi will not remove the api, because this is one of their important interfaces for interconnection.
So, the current problem is that it will show button for old device which never had output switcher. Like Android 5, 6, 7, 8, etc.
So, the current problem is that it will show button for old device which never had output switcher. Like Android 5, 6, 7, 8, etc.
Then add detection, and hide it if it is not supported
Sure, I'll do it soon.
Sure, I'll do it soon.
OK
Hi, just to clarify what's the status: I think I will merge this after next release when I have more time. Reason is that 1. this is good opportunity to move more buttons around and migrate to proper TopAppBar in that screen, 2. as fallback I want to implement in-app output switcher (for A10 and earlier), 3. I want to check if it's possible to make MediaRouter allow to change between headphones and speaker before A15 in this output switcher, 4. for the previous point it would be good if Google fixed https://issuetracker.google.com/issues/340805981
Basically I want to check how much potential MediaRouter has before merging this feature, but I promise I will get back to you. Thank you for your patience!
Hi, just to clarify what's the status: I think I will merge this after next release when I have more time. Reason is that 1. this is good opportunity to move more buttons around and migrate to proper TopAppBar in that screen, 2. as fallback I want to implement in-app output switcher (for A10 and earlier), 3. I want to check if it's possible to make MediaRouter allow to change between headphones and speaker before A15 in this output switcher, 4. for the previous point it would be good if Google fixed https://issuetracker.google.com/issues/340805981
Basically I want to check how much potential MediaRouter has before merging this feature, but I promise I will get back to you. Thank you for your patience!
no problem