[MOD] Skip music tracks with Volume buttons (deodexed only) - Moto G Themes and Apps

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.

Modification?
shaftenberg said:
here is the mod for skipping music tracks when long-pressing the volume buttons
Click to expand...
Click to collapse
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.

Silently said:
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!
Click to expand...
Click to collapse
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, could you please give a sources? Or just a list of .smalli files that you changed?

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.

Nice trick mate, can't wait to see this in a custom rom.

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

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

Sorry for my n00b post, but what you mean with: Deodexed?

DragonautMk said:
Sorry for my n00b post, but what you mean with: Deodexed?
Click to expand...
Click to collapse
Google it..
Sent from my XT1032 using XDA Premium 4 mobile app

Related

[GUIDE] Getting some old features back in Virtuous Sense ROMS

GUIDE: Getting some old features back
INTRO: For those who dislike some of the changes/features made to roms as they are developed and are asking how to get them back, here is a how to. It is usually a simple matter of pushing the old files from previous builds into your current rom. Keep in mind that the devs are building a rom as they see fit. As with any rom that you don't build yourself, there will always be things you want to change.
-If there is a bug, post it in the thread.
-If there is a change that you personally want, then do it yourself. Don't expect the dev, and everyone else who uses the rom, to accommodate your specific needs/wants. You may not have noticed, but you aren't the only one using the rom!
NOTE: This guide and code are meant for the virtuous sense rom, but the concept is universal. For example, if you are using some rom and the new version is posted with, say the amazon mp3 apk removed, and you want it back, refrain from cluttering up the dev's thread with a request to have it back. This is both selfish and a waste of posting space. If you are to the point of installing custom roms, you should first be able to type basic adb/terminal emulator commands to copy/delete files. In this case you would extract the amazon mp3 apk from an old .zip and push/install it into your current one. Now wasn't that easier than waiting and hoping that someone will do it for you?
NOW TO THE GUIDE:
Auto brightness mod - To revert from the auto brightness 'mod', which is far too sensitive, to the original, simply pull the services.jar and framework-res.apk from a rom before the patch, and push them to your framework folder. I've attached them to the second post for ease.
Reboot into recovery
Code:
adb shell mount /system
adb shell rm /system/framework/services.jar
adb shell rm /system/framework/framework-res.apk
adb push [directory of saved file]\services.jar /system/framework
adb push [directory of saved file]\framework-res.apk /system/framework
Reboot
-------------------
Keyboard mapping - The www/com key has been changed to a tab, which is good, as it was non-functional before. However the user keys have been changed too. I've modified a file which keeps the www/com key as TAB but also keeps the user keys as user assignable keys. Also attached to second post.
Reboot into recovery
Code:
adb shell mount /system
adb shell rm /system/usr/keylayout/vision-keypad.kl
adb push [directory of saved file]\vision-keypad.kl /system/usr/keylayout
Reboot
-------------------
Rosie auto-rotate - If you want to keep it so that rosie will only be in portrait mode with the keyboard closed, but dont want to turn off auto-rotate throughout all apps, just push the old rosie. Also attached to second post.
Reboot into recovery
Code:
adb shell mount /system
adb shell rm /system/app/com.htc.launcher.apk
adb push [directory of saved file]\com.htc.launcher.apk /system/app
Reboot
Attachments:
You need to rename "services.jar.zip" back to "services.jar" and "vision-keypad.kl.zip" back to "vision-keypad.kl". This is because the forum wont let you upload .kl and .jar extensions as attachments.
Thanks so much for this. I'll definitely be pushing the auto-brightness mod back, and I may do the keyboard, too (might let others do that one first, or see if rmk40/eViL release an update with that first).
Thanks for this!
Sent from my HTC Vision using Tapatalk
Couldn't make the quick key to work.. maybe I might be doing it wrong but I couldn't make it work.. ill keep trying
sent from t-mobile g2 using HTC sense
android602 said:
Couldn't make the quick key to work.. maybe I might be doing it wrong but I couldn't make it work.. ill keep trying
sent from t-mobile g2 using HTC sense
Click to expand...
Click to collapse
What version of virtuous are you running? Did you rename it and remove the .zip from the end?
I'm using that exact file w/ no issues
calendar/lockscreen
Is it possible to replace the sense lockscreen/calendar with the vanilla versions? I have tried searching but can't find find any instructions for how to do this
felixk87 said:
Is it possible to replace the sense lockscreen/calendar with the vanilla versions? I have tried searching but can't find find any instructions for how to do this
Click to expand...
Click to collapse
Lockscreen - no.
Calendar - maybe, haven't tried. However I did find these 2 threads by typing in the words "htc calendar" in the search box (which means you didn't search very hard )
http://forum.xda-developers.com/showthread.php?t=795222
http://forum.xda-developers.com/showthread.php?t=723761]
They may help you.
Good idea with this thread. It's impossible for us to please everyone and this is absolutely the most constructive way to deal with everyone's personal preferences. There is one key consideration for everyone. If we make other changes to the frameworks which you DO want, pushing files from this thread which have not been updated with said features will eliminate those changes as well. Point is, the concept here is good but it needs to be maintained.
Also, the intention with Virtuous is to provide options. The ROM isn't finalized so ROM Manager isn't populated with all the variants it will eventually have. Case in point, we had to re-base on the new Egypt RUU and are in the process of re-applying all our changes. If we had a variety of options, we would have to redo all of those as well. Once we're in a more "final" state, you'll start to see a lot more choices officially supported with the ROM.
The keyboard mod you have here will probably just become part of Virtuous 0.8.0, by the way. I had not realized our replacement eliminated the quick key customizations (oversight).
Chances are I'm not doing it right, as I'm only about 2% oriented in using ADB, but after following the code, pushing the files, etc, the phone boots up with perpetual errors and crashes. (Phone cannot be launched, etc.)
The process in which I did it was:
Wipe the G2, install v0.7.0, update to 0.7.4, remain in recovery and use adb and followed the code you provided above. (Everything says it works, in terms of mounting, pushing, etc.)
I've also tried it where I reboot after updating, let the phone launch fully, then go back to recovery to push the mod files. Same errors occur.
The only two mods I was interested in were the auto-brightness one and the orientation one.
Any idea what I did wrong?
felixk87 said:
Is it possible to replace the sense lockscreen/calendar with the vanilla versions? I have tried searching but can't find find any instructions for how to do this
Click to expand...
Click to collapse
You could possibly try pushing the lockscreen apk from SuperVillainZ.
NANDROID 1ST THOUGH!!!!!
Sent from my HTC Vision using XDA App
fox-orian said:
Chances are I'm not doing it right, as I'm only about 2% oriented in using ADB, but after following the code, pushing the files, etc, the phone boots up with perpetual errors and crashes. (Phone cannot be launched, etc.)
The process in which I did it was:
Wipe the G2, install v0.7.0, update to 0.7.4, remain in recovery and use adb and followed the code you provided above. (Everything says it works, in terms of mounting, pushing, etc.)
I've also tried it where I reboot after updating, let the phone launch fully, then go back to recovery to push the mod files. Same errors occur.
The only two mods I was interested in were the auto-brightness one and the orientation one.
Any idea what I did wrong?
Click to expand...
Click to collapse
Well from what you are saying, it sounds like the methods are correct. Did you make sure to remove the ".zip" from the end of the services.jar.zip file?
Can this be modified to restore ".com/www" to G2's?
the1wingedangel said:
Well from what you are saying, it sounds like the methods are correct. Did you make sure to remove the ".zip" from the end of the services.jar.zip file?
Click to expand...
Click to collapse
Yup, and I have "always show extension" enabled in folder options, so I definitely got rid of the .zip.
Maybe I'll fiddle with it a little more, see if I missed something.
All right, here's the error I get after removing the files for the brightness mod, and pushing the ones you attached in:
"The application Google Services Framework (process com.google.process.gapps) has stopped unexpectedly."
Basically the launcher is completely inaccessible, the phone remains perpetually in the settings screen because I suppose it's the only thing that it can load without the launcher. It also can't get a signal except for wi-fi, "Mobile Networks" in the settings remains unchecked, and it can't be turned on. Hahaha pretty severe for a rather simple mod.
Here's a full step-by-step of exactly what I did:
Wipe User Data, Wipe Cache
Install virtuous v0.7.0, then v0.7.4 from zip
Remain in Recovery
Open command prompt Change directory to ADB (c:\AndroidSDK\tools)
Entered the following codes one at a time:
- adb shell mount /system (mounts)
- adb shell rm /system/framework/services.jar (file removed)
- adb shell rm /system/framework/framework-res.apk (file removed)
- adb push C:\services.jar /system/framework (success 0.250s)
- adb push C:\framework-res.apk /system/framework (success 1.80s)
(I just have the files on C temporarily for the ease of it.)
Reboot
Then the errors hit once I unlock the screen.
Heheh, I can't really think of any other way to approach it. Hmmmm.
Any idea what I'd need to put back for video codecs? I'm running CM 6.1 but it doesn't run streaming videos from the NHL Gamecenter unlike the stock rom. I'm assuming its a codec issue and was wondering what I'd want to replace.
fox-orian said:
All right, here's the error I get after removing the files for the brightness mod, and pushing the ones you attached in:
"The application Google Services Framework (process com.google.process.gapps) has stopped unexpectedly."
Basically the launcher is completely inaccessible, the phone remains perpetually in the settings screen because I suppose it's the only thing that it can load without the launcher. It also can't get a signal except for wi-fi, "Mobile Networks" in the settings remains unchecked, and it can't be turned on. Hahaha pretty severe for a rather simple mod.
Here's a full step-by-step of exactly what I did:
Wipe User Data, Wipe Cache
Install virtuous v0.7.0, then v0.7.4 from zip
Remain in Recovery
Open command prompt Change directory to ADB (c:\AndroidSDK\tools)
Entered the following codes one at a time:
- adb shell mount /system (mounts)
- adb shell rm /system/framework/services.jar (file removed)
- adb shell rm /system/framework/framework-res.apk (file removed)
- adb push C:\services.jar /system/framework (success 0.250s)
- adb push C:\framework-res.apk /system/framework (success 1.80s)
(I just have the files on C temporarily for the ease of it.)
Reboot
Then the errors hit once I unlock the screen.
Heheh, I can't really think of any other way to approach it. Hmmmm.
Click to expand...
Click to collapse
Weird, I have no idea why that won't work for you. Anyway, there is another way around it. Just open up your patch.zip (from 0.7.0 to 0.7.4), go to the framework folder, and remove the services.jar and framework-res.apk from it. Then go about the wipe/install of both zips like normal. That way the patch zip will no longer replace those two files. Anything that you don't want changed in a patch zip can just removed from it.
Snap Jackel Pop said:
Any idea what I'd need to put back for video codecs? I'm running CM 6.1 but it doesn't run streaming videos from the NHL Gamecenter unlike the stock rom. I'm assuming its a codec issue and was wondering what I'd want to replace.
Click to expand...
Click to collapse
Sorry cant help on that one, I haven't run a CM rom since like 1 or 2.0 haha. You may try to see if others are having that problem, or if it is a known issue with the 6.1 and streaming videos. Is it only that site? Maybe a flash player version problem?
rmk40 said:
Good idea with this thread. It's impossible for us to please everyone and this is absolutely the most constructive way to deal with everyone's personal preferences. There is one key consideration for everyone. If we make other changes to the frameworks which you DO want, pushing files from this thread which have not been updated with said features will eliminate those changes as well. Point is, the concept here is good but it needs to be maintained.
Also, the intention with Virtuous is to provide options. The ROM isn't finalized so ROM Manager isn't populated with all the variants it will eventually have. Case in point, we had to re-base on the new Egypt RUU and are in the process of re-applying all our changes. If we had a variety of options, we would have to redo all of those as well. Once we're in a more "final" state, you'll start to see a lot more choices officially supported with the ROM.
The keyboard mod you have here will probably just become part of Virtuous 0.8.0, by the way. I had not realized our replacement eliminated the quick key customizations (oversight).
Click to expand...
Click to collapse
Yea, I assumed it would be out-dated soon anyway, as changes are made to your roms. I'll adjust it to keep up if the need is there though. It was just a couple of the more simple alterations that I made, and after seeing so many people cluttering up your thread with posts about them, I decided to post this.
Mostly, though, I just wanted to remind people that many simple issues/personal needs (like an app being removed from a rom, or a small change to one or two apps) can be solved with a little bit of thought and some adb knowledge - both of which should be present if you are working with a rooted phone in the first place!
the1wingedangel said:
many simple issues/personal needs can be solved with a little bit of thought and some adb knowledge - both of which should be present if you are working with a rooted phone in the first place!
Click to expand...
Click to collapse
I really cant emphasise this enough!
Sent from my sweet G2
Do you know if there is anyone to return the power down message. I remember before there being and option to restart the phone, hibernate, power off, or reboot into recovery. I liked having that. Is there anyway to return this feature?
Sent from my sweet G2
felixk87 said:
Is it possible to replace the sense lockscreen/calendar with the vanilla versions? I have tried searching but can't find find any instructions for how to do this
Click to expand...
Click to collapse
ddotpatel said:
You could possibly try pushing the lockscreen apk from SuperVillainZ.
NANDROID 1ST THOUGH!!!!!
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
by chance, did anyone try this? if not, I will try it in a few...

[MOD] Enable custom Boot Sounds in CyanogenMod 07/15/2011

Enable Custom Boot Sounds
First make sure you are running a cyanogenmod based rom, i have only tested on CM7, but i believe the capability exists in CM6 as well.
Flash from recovery:
http://www.mediafire.com/?4cr7aa4lg51y8pc
BUSYBOX REQUIRED - if you dont have a proper busybox install (like cm7) this can sometimes fail. if you experience issues, mount system rw before running the script.
Zip contains the default "DROID" sound, to replace with your own see below.
Instructions:
1) Flash from recovery over current rom
2) reboot phone
Once you have flashed this you will also have some new commands in terminal or adb:
enablebootsound - enables boot sound if enable from recovery was unsuccesful
bootsoundtoggle - turns bootsound on or off
newbootsound - copies /sdcard/android_audio.mp3 as new boot sound
newbootanim - copies /sdcard/bootanimation.zip as new bootanimation.
Feel free to post your custom sounds in this thread. i'll try and keep the first post updated.
Once again - to set custom sound or animation place them on root of sdcard named appropriately i.e. 'bootanimation.zip' and 'android_audio.mp3'
Enjoy.
bootsound enable script by mrdaviso modified by me for compatibility and to eliminate double runs, from a tutorial posted by spiicytuna
Very cool idea and a very nice implementation. I had a media force close as soon as the phone finished turning on, but then again I was using a 5mb mp3. Also as soon as I did "newbootsound", the selected song started playing. Other then that everything works exactly as you described . Ill post some logs up tomorrow. Thanks!
Nice work. I always thought this had to be done by fixing the links in /system/bin/bootanimation
Sent from my HTC Vision using XDA Premium App
I'm always changing my animations and will now be changing bootsounds....so I hope you don't mind, I made a small change to /system/bin/bootsound
Its now
#!/system/bin/sh
bprop=/system/build.prop
play=$(cat $bprop | egrep -c -i -o ro.config.play.bootsound=1)
if [ "$play" = "1" ]; then
stagefright -a -o /system/media/*.ogg
stagefright -a -o /system/media/*.mp3
fi
exit 0
Sent from my HTC Vision using XDA Premium App
Doesn't work on PyroMod.
----------------------------------------
Never mind. A wipe and a few reflashes later and I got it working right.
In CM7 RC2, remember to type "su" before typing enablebootsound...
It works! great add-on to cm7, u tha man!
EdWRX said:
In CM7 RC2, remember to type "su" before typing enablebootsound...
It works! great add-on to cm7, u tha man!
Click to expand...
Click to collapse
In Terminal Emulator period you need to type su (to gain root access) before typing any of the commands.
I'm running CM 6.1.1 and it worked great..only thing is the boot audio cuts out about 5 seconds before my animation ends (and it's not the audio clip..it's 30seconds long)..is there any way to increase the length of this?
In case you wanna add to the OP, this is from enablebootsound.
#I just made this into a script this was from a post on XDA by spiicytuna
#http://forum.xda-developers.com/showpost.php?p=8274824&postcount=2
#Please give the credit to him not me.
Sent from my HTC Vision using XDA Premium App
only thing is the boot audio cuts out about 5 seconds before my animation ends (and it's not the audio clip..it's 30seconds long)..is there any way to increase the length of this?[/QUOTE]
I have the same problem. Any suggestions? I might have to wipe, but I don't want to unless I have to xD
Sent from my HTC Vision using XDA Premium App
this sounds so awesome, but im a super noob when it comes to other things that isnt just flashing something and bam its there.......
Simer03 said:
this sounds so awesome, but im a super noob when it comes to other things that isnt just flashing something and bam its there.......
Click to expand...
Click to collapse
EDIT no terminal required now
Already have the perfect start sound. Android Hell wave from Portal. Other good ones would be "Hello friend" and "Amusing Fact" from Portal.
when i run enablebootsound after su and reboot...it loop....
but i get into recovery and press fix permissions ..it sound DRIOD...
well done!
I was able to get this working on my evo shift cm7 nightly rom, great work!
update:
http://www.mediafire.com/download.php?dxjcc9cyhzyalz3
if you have already flashed and used the previous version, this one is of no use to you.
The only modification is after flashing when you are rebooting you will see your splash screen for a few seconds, then your device will reboot and continue like normal. ONE REBOOT is normal. after this reboot the boot sound will automatically play. so for you self proclaimed super noobs, all you do is flash and reboot. once again after flashing your device will boot to splash screen for a few seconds then reboot and greet you with your animation and the default android sound.
see OP for changing the sound.
If you can, why not build an app that lets you change your sound? Something similar to Root Tools by Rummler. You can swap boot-animations easily with that app, granted you can only change from the ones he has. There are 24 of them.
sounds like a good idea. I would use an App to do this. Shouldn't be too hard, as right now I use gscripts to do most of my changing/testing.
This will never be released as an app by me. Script only. a few commands in terminal should be easy enough, and it isn't a customization suite, it's just to enable the boot sound, the ability to change was an after thought and is a simple few lines.
mejorguille said:
Very cool idea and a very nice implementation. I had a media force close as soon as the phone finished turning on, but then again I was using a 5mb mp3. Also as soon as I did "newbootsound", the selected song started playing. Other then that everything works exactly as you described . Ill post some logs up tomorrow. Thanks!
Click to expand...
Click to collapse
I know how to get the clip to play all the way through. I got it on mine. Not sure if there are any side effects, but perhaps you would like to test it out? If so, please send me your clip.
@ amazinglarry311
Do you think this will cause any side effects? I dont know much, but I like to tinker and learn
If you remove the line that tells it to stop playing the boot audio
this
Code:
on property:dev.bootcomplete=1
stop bootsound
from
/etc/init.local.rc
so it now looks like this
Code:
# CyanogenMod Extras
# Compcache - handle at boot
service compcache /system/bin/handle_compcache
user root
group root
oneshot
###Bootsound - Safe to Delete: Start ###
service bootsound /system/bin/bootsound
user media
group audio
disabled
oneshot
on property:init.svc.bootanim=running # to correct timin
start bootsound
### Bootsound - Safe to Delete: End ###
As long as the audio clip doesn't exceed boot time, than you should be good.
If the clip is longer, it will continue to play, until its finished...which no one probably wants.
If anyone wants to give it a shot, just backup your file, and edit it... or use the attached file. Its not zipped, just remove the .zip from the filename.
Thanks.

Headset Button Fix

This fix allows you to use the one button or middle button on your headsets. You will be able to pause/start music answer/hangup phone for Samsung Galaxy S II and other phones using Gingerbread that the headset buttons may no longer work on.
I spent way too much time on this, so I figured I would share a how to for all of you.
You WILL need to Root your phone. I’ve found what I think is the best/easiest way of doing this. This Root process WILL NOT flash or change your OS.
Step 1:
Root your phone with DooMLoRD fantastic ‘Easy Root Toolkit’ link http://forum.xda-developers.com/showthread.php?t=1321582 you can read the 27 plus page link like I did or just trust me it works great. I rebooted the phone before running the install I used his V2 on the first page. Download his DooMLoRD_v2_ROOT-zergRush-busybox-su.zip <NEW> from the link on the first page. Again his process DOES NOT flash your phone as other rooting processes with ODIN will. He also has an unRoot.
Step 2:
Install one of the file managers I use Linda File Manager and/or File Expert from the market.
Install a texted editor I use Text Edit from the market.
Install a terminal emulator I use Android Terminal Emulator from the market.
Install Jays Headset Control. (This app is no longer available from the market for the SGS2. Compatibility issues stemming from the improper coding the sec_jack.kl file. The developer of Jays Headset is kind enough to post a link to app, see link at the bottom of this post.)
Step 3:
Open the terminal emulator
(To bring up the soft keyboard hit the menu button then the toggle soft keyboard “the menu button is at the bottom left of the SGS2” ) now type and enter the following commands:
cd /sdcard
mkdir fixbutton
cp /system/usr/keylayout/sec_jack.kl /sdcard/fixbutton/sec_jack.kl
cd /sdcard/fixbutton
ls
You should see the sec_jack.kl file.
To make a backup of the original type and enter the following command:
cp /system/usr/keylayout/sec_jack.kl /sdcard/fixbutton/sec_jack.kl.bkp
(if you have this problem where the i to turns into an I in the mkdir command the work around is type mkdi then hit the menu key and the toggle soft keyboard twice then enter the r)
Hit the home button
Step 4:
Open Linda File Manager
Hit SD Card
Scroll to fixbutton directory hit it
Hit the sec_jack.kl
Select Text Edit
It will look like this:
key 163 MEDIA_NEXT WAKE
key 165 MEDIA_PREVIOUS WAKE
key 226 SEND_END WAKE
change SEND_END to HEADSETHOOK
And add
key 164 MEDIA_PLAY_PAUSE WAKE
hit menu key then save.
It should look like this
key 163 MEDIA_NEXT WAKE
key 164 MEDIA_PLAY_PAUSE WAKE
key 165 MEDIA_PREVIOUS WAKE
key 226 HEADSETHOOK WAKE
Step5:
Find the mount point of /system . On my SGS2 its /dev/block/mmcblk0p9
Open Terminal Emulator and type and enter the following command (this is just a display command):
mount
The /system mount point is in the middle. If you click on the attachment below you will see a display from my SGS2, in the middle of the display on line 14 is the mount point
/dev/block/mmcblk0p9 /system ext4 ro,realtime,battier=1,data=ordered 0 0
The mount point is the first part of that line, on my SGS2 its:
/dev/block/mmcblk0p9
Other phones will be different, so write it down.
Step 6:
Remount /system in read write mode and copy the modified kl file back. (Click Allow for the su command when it pops up). If your mount point is different then /dev/block/mmcblk0p9 replace your mount point in the mount command below.
Open the terminal emulator and enter the following commands:
su
mount -o remount,rw /dev/block/mmcblk0p9 /system
cp /sdcard/fixbutton/sec_jack.kl /system/usr/keylayout/sec_jack.kl
hit the back button power off and power on
Step 7:
Open Jays Headset Controller
Choose Advanced
Hit Button Actions
Change Phone options right side of Click and Hold to Answer and End call
Change Headset options left side of Click and Hold to whatever you want (I like Play/Pause)
Enjoy, Click and Hold button for a second or 2 this will
Startup Music Player / Pause / Start / Music / Answer / Hangup phone calls
That’s it, if this helps you give me a thumbs up and send money to the people that created the software that helps you!
Another tip, to save a lot of battery life, every time you reboot the phone hit Settings>Applications>Running services then hit DRM content > stop > ok, turn your display down to under 50%
Jays software can be found here http://forum.xda-developers.com/showpost.php?p=20033923&postcount=86
Now in a Flashable zip file
Made by ravizzle....thank you
Ok so i made a flashable zip of this mod. Op feel free to add this to the first post. Thanks for the mod in the first place!
Instructions:
1)Download zip
2)Flash in cwm
3)download "Jays headset control"
4)open Jays headset control app~ choose advanced~ button actions~ change phone options next to "click and hold" to answer and end call ~ change options on music icon next to "click and hold" to desired actions (OP used for pause/play, i personally use it to skip to next track.)
5) Enjoy!
if you have any problems or instructions are unclear please let me know and i will try to correct them.
Attached Files Headset button mod-signed.zip here or at the bottom of this post
/*
Anyone using a Custom ROM can use this code for the sec_jack.kl file, it will allow for more options working:
key 226 HEADSETHOOK WAKE
key 164 HEADSETHOOK WAKE #V2 Hardware support
key 163 MEDIA_NEXT WAKE
key 165 MEDIA_PREVIOUS WAKE
key 168 MEDIA_REWIND WAKE #V2 Hardware support
key 208 MEDIA_FAST_FORWARD WAKE #v2 Hardware support
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 107 ENDCALL WAKE
key 113 MUTE WAKE
key 231 CALL WAKE
key 248 HEADSETHOOK WAKE
key 76 HEADSETHOOK WAKE
Thanks for the awesome work. Gonna try it out.
Does dbl click skip to next track? If not, Any way to get that?
Sent from my Galaxy S2
ravizzle said:
Thanks for the awesome work. Gonna try it out.
Does dbl click skip to next track? If not, Any way to get that?
Sent from my Galaxy S2
Click to expand...
Click to collapse
Thanks for the thanks, let me know how it goes if you have any questions post em I'll be checking. Well you can skip tracks also but then you can't pause/start its one or the other. I'm just really happy I got this to work with pause/start answer/hangup with a long press. I may try again to get the next/previous to work, along with pause/start but my time is valuable and I need to make money like everyone else. Being an independent systems programmer having no real knowledge of phones software and just being a hack. I spent the whole day on this stupid phone problem..lol. I'd really would like to have next/previous double and triple press. I was hoping that the new OS Ice Cream due to hit the SGS2 sometime next year would address this issue, but I doubt they will fix it.
/* Glenn
Glenn54 said:
Thanks for the thanks, let me know how it goes if you have any questions post em I'll be checking. Nope, I'm just really happy I got this to work with pause/start answer/hangup with a long press. I may try again to get the next/previous to work, but my time is valuable and I need to make money like everyone else. Being an independent systems programmer having no real knowledge of phones software and just being a hack. I spent the whole day on this stupid phone problem..lol. I'd really would like to have next/previous double and triple press, but I was hoping that the new OS Ice Cream due to hit the SGS2 sometime next year would address this issue, that's been like this for a long time, I doubt they will fix it though.
/* Glenn
Click to expand...
Click to collapse
Can i do this fix over any rom or do i have to use doomlord's easy root kit?
currently running calkulin's rom v1.1
And thanks for your efforts. you definently got the wheels turning.
donp2700 said:
Can i do this fix over any rom or do i have to use doomlord's easy root kit?
currently running calkulin's rom v1.1
And thanks for your efforts. you definently got the wheels turning.
Click to expand...
Click to collapse
If your phone is rooted you can start with Step 2
Welcome!
Glenn54 said:
If your phone is rooted you can start with Step 2
Welcome!
Click to expand...
Click to collapse
I entered "mkdir /fixbutton"
and got
mkdir failed for /fixbutton, read-only file system
Did i miss somthing?
donp2700 said:
I entered "mkdir /fixbutton"
and got
mkdir failed for /fixbutton, read-only file system
Did i miss somthing?
Click to expand...
Click to collapse
sorry i fixed the doc it should be mkdir fixbutton without the /
Glenn54 said:
do you have a SGS2?
did you cd / to your are your sdcard?
Click to expand...
Click to collapse
yes and yes
E4GT
running calkulins rom.
donp2700 said:
yes and yes
E4GT
running calkulins rom.
Click to expand...
Click to collapse
try it without the / just mkdir fixbutton sorry
Glenn54 said:
try it without the / just mkdir fixbutton sorry
Click to expand...
Click to collapse
sorry but iam not understanding how step 5 and 6 work. how do i find the mount point and remount? Im fairly new to this.
donp2700 said:
sorry but iam not understanding how step 5 and 6 work. how do i find the mount point and remount? Im fairly new to this.
Click to expand...
Click to collapse
open the terminal emulator and enter
mount
click on the attachment above you will see in the middle of the display line 14
/dev/block/mmcblk0p9 /system ext4 ro,realtime........
the mount point is the first part of that line, on my SGS2 its
/dev/block/mmcblk0p9
This didn't work for me. I tried 3 different headsets. The center buttons don't activate anything. Thanks for your work though.
Glenn54 said:
try it without the / just mkdir fixbutton sorry
Click to expand...
Click to collapse
IT WORKS!!!!!!
Forget my previous noob questions, i figuered it out and you are a genius!!!!!!!!
I dont care much for pausing and answering calls from the HS button, so i simply chose the next track option under long click on the headset controller app.
It works and i cant understand why no one has figured this out already. Thank you for your work, much appreciated.
dtruong23 said:
This didn't work for me. I tried 3 different headsets. The center buttons don't activate anything. Thanks for your work though.
Click to expand...
Click to collapse
Are you sure all the commands worked? With Linda File Manager you can look at the sec_jack.kl file
Open up Linda
Hit My Phone
Hit Enter to the Alert
Scroll down and hit system
Scroll down and hit usr
Hit keylayout
hit sec_jack.kl
Scroll down and hit Text Edit
It should look like this
key 163 MEDIA_NEXT WAKE
key 164 MEDIA_PLAY_PAUSE WAKE
key 165 MEDIA_PREVIOUS WAKE
key 226 HEADSETHOOK WAKE
Oh I thought I put that in the Step 4 I left out
Add
key 164 MEDIA_PLAY_PAUSE WAKE
I'll fix the doc now, please try it again sorry this will and does work!
donp2700 said:
IT WORKS!!!!!!
Forget my previous noob questions, i figuered it out and you are a genius!!!!!!!!
I dont care much for pausing and answering calls from the HS button, so i simply chose the next track option under long click on the headset controller app.
It works and i cant understand why no one has figured this out already. Thank you for your work, much appreciated.
Click to expand...
Click to collapse
Oh Great! your welcome just give me a thumbs up and enjoy
If this works for you can just post a 'It worked for me' and give me a thumbs up. Thanks!
Also, I'm sure this would work for other phones/devices not just the SGS2. The sec_jack.kl file and the mount point would be a different name on other devices. If you send a dir of your /system/usr/keylayout/ directory someone should be able to tell you what file to use.
/* Glenn
Any way to make this a flashable mod?
Sent from my Galaxy S2
ravizzle said:
Any way to make this a flashable mod?
Sent from my Galaxy S2
Click to expand...
Click to collapse
I'm sure the MOD makers can do this. This procedure is pretty easy to follow and I think a little safer then flashing!
It works now!!! I guess I needed that key 164 entry. Thanks so much.
Glenn54 said:
Are you sure all the commands worked? With Linda File Manager you can look at the sec_jack.kl file
Open up Linda
Hit My Phone
Hit Enter to the Alert
Scroll down and hit system
Scroll down and hit usr
Hit keylayout
hit sec_jack.kl
Scroll down and hit Text Edit
It should look like this
key 163 MEDIA_NEXT WAKE
key 164 MEDIA_PLAY_PAUSE WAKE
key 165 MEDIA_PREVIOUS WAKE
key 226 HEADSETHOOK WAKE
Oh I thought I put that in the Step 4 I left out
Add
key 164 MEDIA_PLAY_PAUSE WAKE
I'll fix the doc now, please try it again sorry this will and does work!
Click to expand...
Click to collapse
it worked for me without that extra line. What would the diffrence be with the additional command?
and do i have to redo steps 5 and 6 after edit or can i just edit the sec_jack.kl file and save?

[MOD] Volume Wake

I got so used to using the volume rocker to wake my DHD and show the lockscreen instead of the power button that i decided to try and add the same functionality to the OneX. The only caveat with this is that sometimes the volume slider shows up when it wakes, but i can live with that
Hopefully, in time, the ROM devs will add this in by default or as an option. Until then it'll require these manual mods...
Don't try the following if you're unsure what you're doing as you could potentially break the ROM if not done correctly. I recommend backing up first in Clockwork Recovery in case things go wrong.
I accept no responsibility for any issues encountered making these changes!
Requirements
Rooted phone
Android-SDK
baksmali/smali from here
Step 1 - Update android.policy.jar
1. Do the following to get the android.policy.jar from your phone and disassemble it
Code:
adb pull /system/framework/android.policy.jar .
baksmali -x android.policy.jar -o classout
2. Open the following file in a text editor
Code:
classout/com/android/internal/policy/impl/KeyguardViewMediator.smali
3. Find the method "isWakeKeyWhenKeyguardShowing(IZ)Z"
4. At the bottom of the method, there's a switch statement. Remove the following 2 lines from it:
Code:
0x18 -> :sswitch_5
0x19 -> :sswitch_5
5. Save the file and close it.
6. Run the following commmand to re-assemble classes.dex
Code:
smali classout -o classes.dex
7. Drag the classes.dex into the android.policy.jar file to update the file in there.
8. Push the updated android.policy.jar back to the phone
Code:
adb push android.policy.jar /sdcard/
adb shell
su
sysrw
cp /sdcard/android.policy.jar /system/framework/
chmod 644 /system/framework/android.policy.jar
Step 2 - Update Generic.kl
1. Pull the file from your phone
Code:
adb pull /system/usr/keylayout/Generic.kl
2. Open it in a text editor and change the lines
Code:
key 114 VOLUME_DOWN
key 115 VOLUME_UP
to
Code:
key 114 VOLUME_DOWN WAKE_DROPPED
key 115 VOLUME_UP WAKE_DROPPED
3. Push the file back to your phone
Code:
adb push Generic.kl /sdcard/
adb shell
su
sysrw
cp /sdcard/Generic.kl /system/usr/keylayout/
chmod 644 /system/usr/keylayout/Generic.kl
(of course, you could also make those changes to the file directly using a root file explorer app and text editor.)
Step 3
Reboot the phone.
Note: The first time it boots after changing android.policy.jar, there'll be an 'Android is upgrading' dialog. This is normal and it won't happen on subsequent reboots.
How if I play music in off screen mode adjusting the volume?
w1nter456 said:
How if I play music in off screen mode adjusting the volume?
Click to expand...
Click to collapse
It'll still work, but the screen will wake too.
thanks much. I need this feature much.
One question, is this change use up volume or down volume or both will work?
Am I correct that this mod will work only on deodexed android.policy.jar ?
mmx6688 said:
thanks much. I need this feature much.
One question, is this change use up volume or down volume or both will work?
Click to expand...
Click to collapse
Yep, it'll work for both.
ckpv5 said:
Am I correct that this mod will work only on deodexed android.policy.jar ?
Click to expand...
Click to collapse
Yep, the above steps are for de-odexed ROMs, but you may still be able to disassemble if you pull the jar and odex and run baksmali on android.policy.odex. If you get errors trying that then pull everything from the /system/framework folder and try it again
Annoyingly, i've just noticed that once the phone goes into a 'deep sleep', the volume buttons don't always wake it. Sometimes they'll work after a double press sometimes it needs to be the power button :-\
Thanks it worked on my device. And I have added your mod to my mod pack for easy enabling and disabling
any kind person can help to make it into a flashable zip?
ck_looi said:
any kind person can help to make it into a flashable zip?
Click to expand...
Click to collapse
+1 10 chars
Would it in theory be possible to use the home button to wake the phone or is that impossible because the buttons don't work when the screen is off?
I have wake on TP on my Desire now.
mgmCube said:
Would it in theory be possible to use the home button to wake the phone or is that impossible because the buttons don't work when the screen is off?
I have wake on TP on my Desire now.
Click to expand...
Click to collapse
Not possible as the buttons don't work when the screen is off.
And when the phone goes to deep sleep mode, volume button to wake it not really works (tried both on odex and deodex ROMs).
Totally eager to try this out.
I'm using the LC ModPack 2.1.0 and this doesn't work
ckpv5 said:
Not possible as the buttons don't work when the screen is off.
And when the phone goes to deep sleep mode, volume button to wake it not really works (tried both on odex and deodex ROMs).
Click to expand...
Click to collapse
Ok so this volume unlock doesn't really work when in deep sleep?
This isn't mentioned in the first post.
So what if I use this volume unlock and disable the power button, then I have a problem after deep sleep?
mgmCube said:
Ok so this volume unlock doesn't really work when in deep sleep?
This isn't mentioned in the first post.
So what if I use this volume unlock and disable the power button, then I have a problem after deep sleep?
Click to expand...
Click to collapse
Yeah... most of the time it doesn't work when in deep spleep. OP mentioned this on post #6 too.
With volume to wake (not unlock, you still need the swipe up to unlock), and disable the power button, you will have problem to wake and unlock when it goes deep sleep. When you have this problem, the only way to wake it is to plug-in a usb cable or charger as it will wake the phone, then you can unlock.
Well then.. I think its better to disable it as it does messes up my volume levels even if it doesnt wake up the device..
Any chance of a full feature here? Coz the phone is expected to go into deep sleep most of the time..
Sent from my HTC One X using XDA
Jumping in here real quick, i dont (unfortunately) have an amazing all powerful OneX but i do have an HD2
Anyhow, im posting in regards to the isWakeKeyWhenKeyguardShowing(I)Z method in the KeyguardViewMediator.smali file found in android.policy.jar. I already have the volume wake keys set via cyanogen mod, my question is this:
How can i ADD keys to this file to prevent the device from waking?
I tried converting the hex values from that file but they dont correspond with any key values (ex, volume down is 115) but 0x18 is 24, decimal value, so im not sure exactly what numbers must be added to correspond to the correct key.
Thanks all for your efforts and time spent reading!
Thank you for the guide. I don't have Generic.kl on my Motorola XT530, so I think I might need to fiddle round with the .kl files to see if I can get this mod working.
I had to modify my process slightly, so I'll explain what I did in case it may be of help to anyone else.
1. To copy android.policy.jar to my PC, I used Android Commander. It's nice and simple. Make sure you make a back up of android.policy.jar before you modify it in case you need/want to restore it.
2. Use Command Prompt and navigate to the folder in which android.policy.jar is located. For example:
Code:
cd C:\Android\temp
3. Disassemble classes.dex using the following command:
Code:
java -jar baksmali-1.3.2.jar -x android.policy.jar -o classout
4. Edit and save KeyguardViewMediator.smali as per the original post.
5. Reassemble classes.dex using the following command:
Code:
java -jar smali-1.3.2.jar classout -o classes.dex
6. Open android.policy.jar with 7-Zip (any archive manager should work) and replace classes.dex with the modified one.
7. Use Android Commander to replace android.policy.jar on phone.
8. Edit Generic.kl as per original post. I don't have Generic.kl on my phone, so I just left-out this step. I figured I could poke around the .kl files later if need be. I haven't done so yet.
9. Reboot.
Note: The filenames for baksmali-1.3.2.jar and smali-1.3.2.jar may be different if you have a different version. Simply adjust the commands above accordingly.
HTC Ones S --Works
Was looking for this on the HOS forums but found this close enough instead. Prob everyone knows this, but I did this same setup on my one s (t-mo-us) version, and it stuck. So thanks for this nice little tweak. Good to know dev's have our backs in everything.
this was much appreciated for my inc2!
we got a new kernel and messed up it working in the tweaks app, so this really saved me, I didn't realize the Generic.kl needed to be updated.
thanks again!
in defy, it's umts_jordan-keypad.kl instead of Generic.kl (doesn't exist).

Tw 4.1.2 vol-wake/non-wake Guide

First & as always, it's safest, since you're working in the /sys or /system file path to make a nandroid backup before hand just in case.
hasn't been tested for JB but i believe it will work.
using a file explorer on the phone, mount the system as Read/Write,
navigate to the directory path:
WAKE - turns on volume rocker wake
WAKE_DROPPED - shuts the the wake off
/system/usr/keylayout/
find the "ffa-keypad.kl" file, long press it, open in text editor
find VOLUME_UP
and
VOLUME_DOWN
and type "WAKE" next to each entry. this will enable wake on volume rocker.
if you were wanting to disable wake on volume rocker type "WAKE_DROPPED".
then settings or menu and "save changes"
now, in the same directory, open "fluid-keypad.kl", "generic.kl.
and do the same steps to add "WAKE" or "WAKE_DROPPED" accordingly next to each Volume UP/DOWN entry.
may require a restart of the phone to take effect.
exelent info ..thanks
I'm on stock UVMC6 rooted and this is not working for me. I've made changes to all three files and after a reboot, no luck.
Help? I really need this mod. I've seen edits to Android policy .jar in the past but I'm not too sure how that works or whether that is needed in this case.
I tried this too and it didn't work. I followed the instructions and had no luck with it.
Same, both files say dropped, but still able to wake screen with volume keys. Running Jedi mind trick
Sent from my SGH-T989 using xda premium
to enable vol wake, you have to mod the android.policy.jar
does this make both volume up and volume down to function as the power button? or just one of them? also, is it possible to change the power button to act as volume down/up?
thanks!
Sent from my SGH-T989D using xda app-developers app
YourPartyBoy said:
First & as always, it's safest, since you're working in the /sys or /system file path to make a nandroid backup before hand just in case.
hasn't been tested for JB but i believe it will work.
using a file explorer on the phone, mount the system as Read/Write,
navigate to the directory path:
WAKE - turns on volume rocker wake
WAKE_DROPPED - shuts the the wake off
/system/usr/keylayout/
find the "ffa-keypad.kl" file, long press it, open in text editor
find VOLUME_UP
and
VOLUME_DOWN
and type "WAKE" next to each entry. this will enable wake on volume rocker.
if you were wanting to disable wake on volume rocker type "WAKE_DROPPED".
then settings or menu and "save changes"
now, in the same directory, open "fluid-keypad.kl", "generic.kl.
and do the same steps to add "WAKE" or "WAKE_DROPPED" accordingly next to each Volume UP/DOWN entry.
may require a restart of the phone to take effect.
Click to expand...
Click to collapse
Thanks for the info.
Was anyone ever able to get this working? I tried the guide in the first post and no luck.
Running UVMC6, rooted.
Does anyone have an android.policy.jar for this ROM edited for volume wake?
Joe USer said:
Was anyone ever able to get this working? I tried the guide in the first post and no luck.
Running UVMC6, rooted.
Does anyone have an android.policy.jar for this ROM edited for volume wake?
Click to expand...
Click to collapse
Try using my guide, it seems to work for everybody.
http://forum.xda-developers.com/showthread.php?t=2299222
joyj112 said:
Try using my guide, it seems to work for everybody.
http://forum.xda-developers.com/showthread.php?t=2299222
Click to expand...
Click to collapse
Thanks, but I'm trying to enable, not disable.
Solved
Solved it.
Install the stock ROM from here http://forum.xda-developers.com/showthread.php?t=2226860 and the volume mod is available as well.
Joe USer said:
Solved it.
Install the stock ROM from here http://forum.xda-developers.com/showthread.php?t=2226860 and the volume mod is available as well.
Click to expand...
Click to collapse
You could do that if you want, but I think in order to turn non the volume wake mod, you just reverse the process and everything should be working
joyj112 said:
You could do that if you want, but I think in order to turn non the volume wake mod, you just reverse the process and everything should be working
Click to expand...
Click to collapse
I tried that first, unfortunately it doesn't work with Jellybean. JB requires changes to the android.policy.jar which requires far more work.

Categories

Resources