[MOD] Skip music tracks with Volume buttons (deodexed only)

Search This thread

shaftenberg

Senior Member
Jul 31, 2010
703
742
Cologne
Hi there,

here is the mod for skipping music tracks when long-pressing the volume buttons. This is for stock ROM 14.71.8 DEODEXED ONLY!!
So, if you have an unlocked bootloader and have root access, you may apply my following mod. I'll guide you step through step as we got no CWM recovery yet, so you must do it manually.

- download android.policy.jar and move it to your internal SD card with an explorer or via adb:
Code:
adb push android.policy.jar /sdcard/

- after that type in the following commands, beware that su wants you to grant root access (SuperSU popup)
Code:
adb shell
su
stop
mount -o rw,remount /system/ /system/
cp /sdcard/android.policy.jar /system/framework/
mount -o ro,remount /system/ /system/
reboot

Done! Enjoy this mod :)

Reminder: Although this mod was tested on my device, I'll take no responsibility if you damage your system, so just do it if you know what you do!

If we have CWM, I will provide a flashable .zip then.
 

Attachments

  • android.policy.jar
    260.1 KB · Views: 116

Silently

Senior Member
Jul 16, 2011
74
28
Modification?

here is the mod for skipping music tracks when long-pressing the volume buttons

Thanks for this, something I miss from my old Sony Ericsson are the physical music player buttons.

I was wondering if you could point me in the right direction of modifying this to make a small alteration; instead of vol-down skipping backward a track I'd like it to have the Play/Pause functionality. That is a button press that I'd use much more often!

Another (perhaps more complicated) solution is to have a double-tap of the power button do this Play/Pause, with double taps of the volume buttons providing the skip tracks effect.
 
Last edited:

shaftenberg

Senior Member
Jul 31, 2010
703
742
Cologne
I was wondering if you could point me in the right direction of modifying this to make a small alteration; instead of vol-down skipping backward a track I'd like it to have the Play/Pause functionality. That is a button press that I'd use much more often!

Change the keycode in line 48 in com\android\internal\policy\impl\PhoneWindowManager$VolumeLongPressR.smali from 58 to 55 and you are done.

Unfortunately this mod doesn't support double taps and I don't know how to integrate this easily :)
 

S0bes

Senior Member
Jan 1, 2012
870
969
shaftenberg, could you please give a sources? Or just a list of .smalli files that you changed?
 

shaftenberg

Senior Member
Jul 31, 2010
703
742
Cologne
Sure.

You have to add 2 files in com\android\internal\policy\impl and have to edit PhoneWindowManager.smali.

Note, there are two/three different mods around here at XDA. I used all of them and I found out that the one with "lyapota" (you will see in the sources) works most reliable, whereas the other one (I used it in the Nexus 5 mod) works too but is a little bit less responsive and doesn't work with all media players.

The hardest part is to find the right variables, if you want to use this mod in other phones. The first time I did this, I used this thread as a good start but you can't simply copy as this won't work then :)

Attached are my modded .smali, the 2 ones you have to add and a .txt with the diff's to the original MotoG-smali.
 

Attachments

  • smali-motog.zip
    65 KB · Views: 62

JBCDroid

Senior Member
Mar 16, 2013
372
769
Anápolis
Skip music tracks with Volume buttons 4.4.2

shaftenberg I'm with rom kitkat 4.4.2 and would like function if do not ask for much could do this mod for it
I'm with the rom Blur_Version.171.44.31.falcon_umtsds.Brasil.en.BR
I'll leave the files from my rom
sorry for bad english I'm Brazilian
and greatly appreciate all of you who make mods
I thank
 

Attachments

  • android.policy.zip
    228.1 KB · Views: 32

Pir4t3

Senior Member
May 26, 2011
126
8
Syria
Thank you dear
i think i did the same thing but with Xposed and gravity bot in media option
it works only when the screen is off :)

Thank you again
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Hi there,

    here is the mod for skipping music tracks when long-pressing the volume buttons. This is for stock ROM 14.71.8 DEODEXED ONLY!!
    So, if you have an unlocked bootloader and have root access, you may apply my following mod. I'll guide you step through step as we got no CWM recovery yet, so you must do it manually.

    - download android.policy.jar and move it to your internal SD card with an explorer or via adb:
    Code:
    adb push android.policy.jar /sdcard/

    - after that type in the following commands, beware that su wants you to grant root access (SuperSU popup)
    Code:
    adb shell
    su
    stop
    mount -o rw,remount /system/ /system/
    cp /sdcard/android.policy.jar /system/framework/
    mount -o ro,remount /system/ /system/
    reboot

    Done! Enjoy this mod :)

    Reminder: Although this mod was tested on my device, I'll take no responsibility if you damage your system, so just do it if you know what you do!

    If we have CWM, I will provide a flashable .zip then.
    3
    Sure.

    You have to add 2 files in com\android\internal\policy\impl and have to edit PhoneWindowManager.smali.

    Note, there are two/three different mods around here at XDA. I used all of them and I found out that the one with "lyapota" (you will see in the sources) works most reliable, whereas the other one (I used it in the Nexus 5 mod) works too but is a little bit less responsive and doesn't work with all media players.

    The hardest part is to find the right variables, if you want to use this mod in other phones. The first time I did this, I used this thread as a good start but you can't simply copy as this won't work then :)

    Attached are my modded .smali, the 2 ones you have to add and a .txt with the diff's to the original MotoG-smali.