Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,562 Members 37,629 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
shaftenberg
Old
#1  
shaftenberg's Avatar
Senior Member - OP
Thanks Meter 693
Posts: 648
Join Date: Jul 2010
Location: Cologne
Default [MOD] Skip music tracks with Volume buttons (deodexed only)

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.
Attached Files
File Type: jar android.policy.jar - [Click for QR Code] (260.1 KB, 55 views)
The Following 7 Users Say Thank You to shaftenberg For This Useful Post: [ Click to Expand ]
 
Silently
Old
(Last edited by Silently; 3rd December 2013 at 09:44 PM.) Reason: clarification
#2  
Junior Member
Thanks Meter 8
Posts: 21
Join Date: Jul 2011
Default Modification?

Quote:
Originally Posted by shaftenberg View Post
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.
 
shaftenberg
Old
#3  
shaftenberg's Avatar
Senior Member - OP
Thanks Meter 693
Posts: 648
Join Date: Jul 2010
Location: Cologne
Quote:
Originally Posted by Silently View Post
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\PhoneWindowManage r$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
Old
#4  
S0bes's Avatar
Senior Member
Thanks Meter 163
Posts: 208
Join Date: Jan 2012
Location: Tomsk

 
DONATE TO ME
shaftenberg, could you please give a sources? Or just a list of .smalli files that you changed?
 
shaftenberg
Old
#5  
shaftenberg's Avatar
Senior Member - OP
Thanks Meter 693
Posts: 648
Join Date: Jul 2010
Location: 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.
Attached Files
File Type: zip smali-motog.zip - [Click for QR Code] (65.0 KB, 16 views)
The Following 2 Users Say Thank You to shaftenberg For This Useful Post: [ Click to Expand ]
 
Kameo
Old
#6  
Kameo's Avatar
Senior Member
Thanks Meter 539
Posts: 836
Join Date: Jul 2010

 
DONATE TO ME
Nice trick mate, can't wait to see this in a custom rom.
[APP] MotoG Boot Logo Flasher - Custom boot logo.
[APP] MotoG DualSim - Remove Sim2 Icons
[MOD][XPOSED] MotoGuide - Remove or edit Carrier label, Enable Charging LED and DoubleTap2Wake on MotoG
Moto G XT1032 16G - Stock rom [JB 4.3 | Faux kernel v3.4m | MotoGuide v1.0.8]
HTC Sensation - CyanogenMod 11 [KitKat 4.4.4]
HTC Desire - CyanogenMod 11 [KitKat 4.4.2 | A2Ext+]
Hannspad SN10T1/1653 - Eclipse v1.0 [JB 4.2.2]
TronsMart MK908 rev3 - Finless v1.6a [JB 4.2.2]
 
droidjbc
Old
#7  
Junior Member
Thanks Meter 7
Posts: 7
Join Date: Mar 2013
Default 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
Attached Files
File Type: zip android.policy.zip - [Click for QR Code] (228.1 KB, 4 views)
 
Pir4t3
Old
#8  
Senior Member
Thanks Meter 4
Posts: 106
Join Date: May 2011
Location: 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
 
DragonautMk
Old
#9  
Senior Member
Thanks Meter 23
Posts: 108
Join Date: Jul 2013
Sorry for my n00b post, but what you mean with: Deodexed?
 
padhu1989
Old
#10  
padhu1989's Avatar
Senior Member
Thanks Meter 75
Posts: 349
Join Date: Jun 2012
Location: Chennai
Quote:
Originally Posted by DragonautMk View Post
Sorry for my n00b post, but what you mean with: Deodexed?
Google it..

Sent from my XT1032 using XDA Premium 4 mobile app

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Navigate to Your Favorite Places with LocationDetector

If you’re enjoying an active way of life, you probablytravel a lot, go fishing, … more

LifeStats Automatic Journal Keeps Tabs of Your Day

Most of us live very active lives. This is after all why we’re fans of mobile … more

Android App Review: Hide Your Files with Androignito – XDA Developer TV

Stop right now, look at your phone, and see how many pictures, … more

BrightNotes Makes Cloud Notes Simple and Easy

There are literally thousands of note taking apps available on Android, with practically every … more