[MOD][Xposed][EUI 5.8] Control 3rd party music players from ControlCenter

Search This thread

androcheck

Senior Member
Dec 7, 2009
235
413
john.zweng.at
Hi!

[EDIT January 10, 2017]
THIS MODULE IS NO LONGER NEEDED SINCE EUI 5.9.020S! (and probably also for newer versions).
As since a few days (finally!) the 5.9.020S version was also released for the LEX720 model (before it was only released for the US model), I updated my phone and can confirm, that with 5.9.20S this module is no longer necessary. Now the buttons also work with 3rd party apps (even when the music app "com.android.music" is disabled or removed).
[/EDIT]

I am using the LeEco LEX720 running the original 5.8.018S EUI firmware. I have disabled or removed some of the pre-installed system apps including the pre-installed audio and video player.
I was hoping that the "Previous" / "Play" / "Next" buttons, which are visible all the time in the EUI control center (see attached screenshot) will also work with 3rd party apps, but unfortunately they do not. :(

[edit]
For clarification:
Normally these buttons do in fact work with 3rd party apps (without any mod), but they need the LeEco Music player installed to do so. The buttons broadcast special LeEco-specific intents to the LeEco Music player, which then performs the desired actions (start stop the own player or forward the event to a currently running 3rd party player). If you disable or remove the Le Eco Music player (package "com.android.music") then this buttons will stop working. This is what this Xposed module is made for: to make these buttons working even without the LeEco Music player installed.
[/edit]

When tapping these buttons EUI broadcasts one of these 3 intents (which will not be recognized by 3rd party apps):
Code:
new Intent("com.letv.music.musicservicecommand.previous");
new Intent("com.letv.music.musicservicecommand.next");
new Intent("com.letv.music.musicservicecommand.togglepause");

Therefore I created an Xposed module which hooks the methods where these intents get broadcasted and instead broadcast default ACTION_MEDIA_BUTTON events, exactly the same way they will be broadcasted when I press the media control buttons on any external (bluetooth) headset, using these 3 standard keycodes:
Code:
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE
KeyEvent.KEYCODE_MEDIA_NEXT
KeyEvent.KEYCODE_MEDIA_PREVIOUS
(for details see: OverrideMusicControls.java)


This way, every player which reacts to the buttons on your headset, will now also work with these three buttons in the Control Center.

The module is available with full source code (under the GPL license) here on Github.

A ready to use APK file can be downloaded from the release section on the Github page:
Download Xposed-module-EUI-MusicControls-v1.0.apk


Compatibility:
This module was developed and tested on the following device:
Device: LeEco LePro 3 (LEX720)
Firmware version: 5.8.018S
Build-ID: WAXCNFN5801811012S

It may or may not work on other EUI versions, so just give it a try and look into the Xposed logs. If everything is working as expected you should see the lines below in there, otherwise it should log an error message.
Code:
EUI MusicControls: We are in com.android.systemui application. Will try to place method hooks for the music Play buttons in EUI Control Center. :)
EUI MusicControls: successfully replaced method handlePlayPause() :)
EUI MusicControls: successfully replaced method handleNext() :)
EUI MusicControls: successfully replaced method handlePrevious() :)

Have fun! :)
 

Attachments

  • screenshot_media_control_eui.jpg
    screenshot_media_control_eui.jpg
    83.4 KB · Views: 529
Last edited:

androcheck

Senior Member
Dec 7, 2009
235
413
john.zweng.at
The controls work just fine with VLC on 19S without any mods.
Good to hear. Do you have the LeEco player and other LeEco services installed or have you removed/disabled them?

The reason why I ask: as the controls definitely broadcast non-standard Intents, I guess there must be another service which re-broadcasts them in a way that VLC understands.

So maybe they were not working for me in the first place because I removed most of the LeEco packages. Maybe I should clarify this in the OP.
Thanks for the note! :)
 

NiHaoMike

Senior Member
May 6, 2012
135
26
Austin, TX
Good to hear. Do you have the LeEco player and other LeEco services installed or have you removed/disabled them?

The reason why I ask: as the controls definitely broadcast non-standard Intents, I guess there must be another service which re-broadcasts them in a way that VLC understands.

So maybe they were not working for me in the first place because I removed most of the LeEco packages. Maybe I should clarify this in the OP.
Thanks for the note! :)
I did not disable the Le apps, but I did disable the "swipe right to open channels" gesture.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Hi!

    [EDIT January 10, 2017]
    THIS MODULE IS NO LONGER NEEDED SINCE EUI 5.9.020S! (and probably also for newer versions).
    As since a few days (finally!) the 5.9.020S version was also released for the LEX720 model (before it was only released for the US model), I updated my phone and can confirm, that with 5.9.20S this module is no longer necessary. Now the buttons also work with 3rd party apps (even when the music app "com.android.music" is disabled or removed).
    [/EDIT]

    I am using the LeEco LEX720 running the original 5.8.018S EUI firmware. I have disabled or removed some of the pre-installed system apps including the pre-installed audio and video player.
    I was hoping that the "Previous" / "Play" / "Next" buttons, which are visible all the time in the EUI control center (see attached screenshot) will also work with 3rd party apps, but unfortunately they do not. :(

    [edit]
    For clarification:
    Normally these buttons do in fact work with 3rd party apps (without any mod), but they need the LeEco Music player installed to do so. The buttons broadcast special LeEco-specific intents to the LeEco Music player, which then performs the desired actions (start stop the own player or forward the event to a currently running 3rd party player). If you disable or remove the Le Eco Music player (package "com.android.music") then this buttons will stop working. This is what this Xposed module is made for: to make these buttons working even without the LeEco Music player installed.
    [/edit]

    When tapping these buttons EUI broadcasts one of these 3 intents (which will not be recognized by 3rd party apps):
    Code:
    new Intent("com.letv.music.musicservicecommand.previous");
    new Intent("com.letv.music.musicservicecommand.next");
    new Intent("com.letv.music.musicservicecommand.togglepause");

    Therefore I created an Xposed module which hooks the methods where these intents get broadcasted and instead broadcast default ACTION_MEDIA_BUTTON events, exactly the same way they will be broadcasted when I press the media control buttons on any external (bluetooth) headset, using these 3 standard keycodes:
    Code:
    KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE
    KeyEvent.KEYCODE_MEDIA_NEXT
    KeyEvent.KEYCODE_MEDIA_PREVIOUS
    (for details see: OverrideMusicControls.java)


    This way, every player which reacts to the buttons on your headset, will now also work with these three buttons in the Control Center.

    The module is available with full source code (under the GPL license) here on Github.

    A ready to use APK file can be downloaded from the release section on the Github page:
    Download Xposed-module-EUI-MusicControls-v1.0.apk


    Compatibility:
    This module was developed and tested on the following device:
    Device: LeEco LePro 3 (LEX720)
    Firmware version: 5.8.018S
    Build-ID: WAXCNFN5801811012S

    It may or may not work on other EUI versions, so just give it a try and look into the Xposed logs. If everything is working as expected you should see the lines below in there, otherwise it should log an error message.
    Code:
    EUI MusicControls: We are in com.android.systemui application. Will try to place method hooks for the music Play buttons in EUI Control Center. :)
    EUI MusicControls: successfully replaced method handlePlayPause() :)
    EUI MusicControls: successfully replaced method handleNext() :)
    EUI MusicControls: successfully replaced method handlePrevious() :)

    Have fun! :)
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone