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

shaftenberg

Senior Member
Jul 31, 2010
690
738
0
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

Silently

Senior Member
Jul 16, 2011
74
28
0
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
690
738
0
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 :)
 

shaftenberg

Senior Member
Jul 31, 2010
690
738
0
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

JBCDroid

Senior Member
Mar 16, 2013
372
767
0
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

Pir4t3

Senior Member
May 26, 2011
126
8
0
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