[MOD] Volume Wake

Search This thread

jh787

Senior Member
Dec 15, 2008
405
91
Yep, it'll work for both.




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 :-\

I need some help if you would be so kind.
I am trying to follow your instructions but i am only getting as far as pulling the files.
I am on a rooted stock odexed rom and when i try to run
baksmali.jar -x android.policy.odex -o classout
It seems to go through (no error) but i dont get a classout folder in my adbtools folder or anywhere else as far as i can tell.

Am i doing it all wrong?
 

tatankam@hotmail.com

Senior Member
Mar 25, 2011
64
3
I need some help if you would be so kind.
I am trying to follow your instructions but i am only getting as far as pulling the files.
I am on a rooted stock odexed rom and when i try to run
baksmali.jar -x android.policy.odex -o classout
It seems to go through (no error) but i dont get a classout folder in my adbtools folder or anywhere else as far as i can tell.

Am i doing it all wrong?

For me it works only when the teriminal is connected to usb.
 

wmg316

Senior Member
Dec 30, 2009
1,534
468
Tyler, TX
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 :-\

Ok so this volume unlock doesn't really work when in deep sleep?

Yeah... most of the time it doesn't work when in deep spleep. OP mentioned this on post #6 too.

Try setting /sys/keyboard/vol_wakeup to 1 instead of 0...along with instructions in OP....

Sent from my HTC One X+ using Tapatalk 2
 

Cyb0rgz

Senior Member
Jan 2, 2012
392
175
Chennai
Thank you OP. Just followed the instructions and now i modded Incredible S to wake up by pressing volume up/down.

Thank you so much!
 

Dwill107

Member
Jan 14, 2012
29
4
Sorry if this is a weird question but I am interested in disabling this feature in the ROM I'm on, it's the only feature I don't care for. On a galaxy s2 if it matters. Can I simply reverse the processes if this was the process used to initiate volume wake?

Sent from my SGH-T989 using xda app-developers app
 

andybones

Retired Forum Moderator / Inactive RD
May 18, 2010
15,092
15,480
Google Pixel 5
Sorry if this is a weird question but I am interested in disabling this feature in the ROM I'm on, it's the only feature I don't care for. On a galaxy s2 if it matters. Can I simply reverse the processes if this was the process used to initiate volume wake?

Sent from my SGH-T989 using xda app-developers app

Yes you most certainly can.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    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.
    2
    thanks much. I need this feature much.

    One question, is this change use up volume or down volume or both will work?

    Yep, it'll work for both.


    Am I correct that this mod will work only on deodexed android.policy.jar ?

    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 :-\
    2
    "/sys/keyboard/vol_wakeup to 1 instead of 0" doesn't work...

    thats an old thread..look here:

    http://xdaforums.com/showthread.php?t=2084522

    this one works
    1
    How if I play music in off screen mode adjusting the volume?

    It'll still work, but the screen will wake too.
    1
    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.

    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).