Post Reply

[Mod] Long press volume buttons to skip songs.

11th September 2011, 12:45 AM   |  #1  
aerobahn's Avatar
OP Member
Thanks Meter: 50
 
83 posts
Join Date:Joined: Feb 2011
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, 1363 views)
The Following 28 Users Say Thank You to aerobahn For This Useful Post: [ View ]
11th September 2011, 01:43 AM   |  #2  
Senior Member
Thanks Meter: 16
 
181 posts
Join Date:Joined: Jun 2010
More
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: [ View ]
11th September 2011, 03:42 PM   |  #3  
petsasj's Avatar
Retired Recognized Developer
Flag Athens
Thanks Meter: 1,566
 
1,597 posts
Join Date:Joined: Mar 2010
Donate to Me
More
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: [ View ]
11th September 2011, 03:53 PM   |  #4  
nexxus.'s Avatar
Member
Thanks Meter: 8
 
80 posts
Join Date:Joined: 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
Last edited by nexxus.; 11th September 2011 at 04:06 PM.
11th September 2011, 05:16 PM   |  #5  
huwande1acruz's Avatar
Senior Member
Flag Makati City
Thanks Meter: 38
 
314 posts
Join Date:Joined: Aug 2011
More
Wink Works on Cognition ROM 1.5.1 ! :)
edit post . ( restore a nandroid backup .
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 . :(
11th September 2011, 06:27 PM   |  #6  
Senior Member
Thanks Meter: 16
 
181 posts
Join Date:Joined: Jun 2010
More
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
Last edited by Sonic7; 12th September 2011 at 12:27 AM.
11th September 2011, 07:13 PM   |  #7  
Senior Member
Thanks Meter: 16
 
181 posts
Join Date:Joined: Jun 2010
More
I think fugutweaks breaks your mod do you have installed it ?

Sent from my GT-I9100 using xda premium
11th September 2011, 07:50 PM   |  #8  
nexxus.'s Avatar
Member
Thanks Meter: 8
 
80 posts
Join Date:Joined: May 2011
Quote:
Originally Posted by Sonic7

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
11th September 2011, 11:36 PM   |  #9  
Senior Member
Flag Paris
Thanks Meter: 218
 
708 posts
Join Date:Joined: Aug 2011
More
Awesome feature. It works on Criskelo rom. Thanks a lot.

Sent from my GT-I9100 using XDA App
12th September 2011, 12:26 AM   |  #10  
Senior Member
Thanks Meter: 16
 
181 posts
Join Date:Joined: Jun 2010
More
Quote:
Originally Posted by nexxus.

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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Galaxy S II Themes and Apps by ThreadRank