Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,769,680 Members 45,936 Now Online
XDA Developers Android and Mobile Development Forum

[Mod] Long press volume buttons to skip songs.

Tip us?
 
aerobahn
Old
#1  
aerobahn's Avatar
Member - OP
Thanks Meter 50
Posts: 83
Join Date: Feb 2011
Default [Mod] Long press volume buttons to skip songs.

Attached is a mod I've spent the last week and a half working on for my friend and I. We were working out and found it a hassle to have to bring out our phones from our pocket in order to seek past tracks. This mod allows you to now seek from your pocket easily.
Those of you who've used CM6/7 are probably aware of a feature they have where you can seek music tracks with the screen off using the volume up (forward track) / volume down (previous track) buttons.

Essentially, I've ported this feature onto the Samsung Framework. Since the Samsung Framework is closed source, I had to reverse engineer a lot of their functions in the Android.Policy framework which took a while. Although the CM6/7 is open source, the code they provide is in Java which you can't really inline with dalvik assembler code so converting their relevant functions into .smali compatible code took more time.
Because of this, I'm only releasing this for Leomar75 (v. 2.6 XXKH3) Rom since it's the Rom I've settled on. I have not tested it on other roms, it may or may not work with others, I make no guarantees. However, I'm ~80% sure it will work with other KH3 based Samsung Firmwares. I don't have time, or the will, to port it to other roms so please don't ask.


Installation:
Make a Nandroid backup using Clockwork Recovery.
Wipe your Cache & Dalvik Cache.
Unzip the file.
ADB push the file to your phone:
Code:
adb push android.policy.jar /system/framework/
Make sure permissions are correct:
Code:
adb shell
busybox chmod -R 644 /system/framework/android.policy.jar
Reboot.

Usage:

When the screen is off, and music is playing, holding the volume up button for ~1 second will seek forward 1 track.
Holding the volume down button for ~1 second will seek back 1 track.

When you do either actions, the screen will not wake (battery life is conserved).
If the screen is ON, and music is playing, it will not seek forward/back if you hold the buttons.


Known bugs:
My friend told me this breaks JKAY AOSP Lockscreen mods. I don't use JKAY mods so that bug probably won't be fixed.


Caveats:

I don't want any donations, plz don't ask.
If you want to disassemble this using baksmali to try to see what I've changed, that's fine by me. I don't really care tbh.
If you have honest questions I will answer but if it's answerable with a Google search, I probably will not bother.

Credits:
Jon Boekenoogen (metalhead8816): First guy to submit the 'Long press volume buttons to skip songs' concept for CM6. Thanks for this simple, but great feature.
Obviously the CM6/7 team: I disassembled & used your code, thanks.
Leomar75: I use your rom, thanks.
JesusFreak: You made an awesome tool for disassembling and assembling .dex. Thanks.
Attached Files
File Type: zip android.policy.zip - [Click for QR Code] (154.6 KB, 1362 views)
The Following 28 Users Say Thank You to aerobahn For This Useful Post: [ Click to Expand ]
 
Sonic7
Old
#2  
Senior Member
Thanks Meter 16
Posts: 181
Join Date: Jun 2010
You are my hero ! Thx for this. But sadly not working on Batista 3.7.6 so I have to change to Leo Rom

Sent from my GT-I9100 using xda premium
The Following User Says Thank You to Sonic7 For This Useful Post: [ Click to Expand ]
 
petsasj
Old
#3  
petsasj's Avatar
Retired Recognized Developer
Thanks Meter 1566
Posts: 1,597
Join Date: Mar 2010
Location: Athens

 
DONATE TO ME
Could you please release the changes that were made in the android.policy.jar? Please post the code and what was changed so developers (and users) modify it themselves.

Thanks a lot.
The Following User Says Thank You to petsasj For This Useful Post: [ Click to Expand ]
 
nexxus.
Old
(Last edited by nexxus.; 11th September 2011 at 04:06 PM.)
#4  
nexxus.'s Avatar
Member
Thanks Meter 8
Posts: 80
Join Date: May 2011
Wow, nice work. I'll try this later.

Edit : works perfectly on leomars rom. Thank you very much!

Sent from my GT-I9100 using Tapatalk
NEXUS 4
 
huwande1acruz
Old
(Last edited by huwande1acruz; 11th September 2011 at 05:49 PM.) Reason: force close my launcher and also i can't go to my power menu . :(
#5  
huwande1acruz's Avatar
Senior Member
Thanks Meter 38
Posts: 314
Join Date: Aug 2011
Location: Makati City
Wink Works on Cognition ROM 1.5.1 ! :)

edit post . ( restore a nandroid backup .
GT-i9505 with the taste of CyanogenMod11

-For New In XDA Forum-
 
Sonic7
Old
(Last edited by Sonic7; 12th September 2011 at 12:27 AM.)
#6  
Senior Member
Thanks Meter 16
Posts: 181
Join Date: Jun 2010
Does not work with leo rom and root explorer have to try it later with adb but should not make any diiference

Edit: works fine even with explorer but tw 4.5 breaks it

Sent from my GT-I9100 using xda premium
 
Sonic7
Old
#7  
Senior Member
Thanks Meter 16
Posts: 181
Join Date: Jun 2010
I think fugutweaks breaks your mod do you have installed it ?

Sent from my GT-I9100 using xda premium
 
nexxus.
Old
#8  
nexxus.'s Avatar
Member
Thanks Meter 8
Posts: 80
Join Date: May 2011
Quote:
Originally Posted by Sonic7 View Post
Does not work with leo rom and root explorer have to try it later with adb but should not make any diiference

Sent from my GT-I9100 using xda premium
It works with rootexplorer. I did it this way. Maybe you forgot to set permissions?


Sent from my GT-I9100 using Tapatalk
NEXUS 4
 
Thialala
Old
#9  
Senior Member
Thanks Meter 218
Posts: 708
Join Date: Aug 2011
Location: Paris
Awesome feature. It works on Criskelo rom. Thanks a lot.

Sent from my GT-I9100 using XDA App
Please Press Thanks if my answer helped you. I heard it's the XDA currency .

Criskelo Rom : Latest Version
Kernel : Siyah Kernel
 
Sonic7
Old
#10  
Senior Member
Thanks Meter 16
Posts: 181
Join Date: Jun 2010
Quote:
Originally Posted by nexxus. View Post
It works with rootexplorer. I did it this way. Maybe you forgot to set permissions?


Sent from my GT-I9100 using Tapatalk
I installed the touchwiz 4.5 and I think this breaks the mod. It works fine on a fresh instal

Sent from my GT-I9100 using xda premium

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes