• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

ICS Volume Wake with Lockscreen help!

Search This thread

tssphysicsboi

Senior Member
May 7, 2011
427
41
Right now I have the stock android 4.0.4 rooted. Since they've updated the volume wake, it has given me nothing but trouble. Yes I know volume wake is enabled when I set lockscreen to none, however, when I am using Playerpro to play music, I don't want the screen to turn on when I hit the volume up or down since the phone will be in my pocket.

I've tried tasker and other programs to try to disabled lockscreen, but none work. The only way to do it is manually changing the 'none' to 'slide lock' in the settings each time, depending on whether I am listening to music or not. Note, I am also using widgetlocker.

If anyone can guide me in the right direction to how I can make it automatic such that it changes the lock option when I open playerpro or to just enable volume wake even under lockscreen that would be great! I've searched for hours and can't find anything.


Thanks~
 

tssphysicsboi

Senior Member
May 7, 2011
427
41
found a temp solution after many hours.

1. set lockscreen to none under settings for stock android (buttons wake will work)

2. download: smart screen off (free version works fine)

Then even with headset when in your pocket screen will not turn on. You can toggle the smart screen off and on so it won't completely drain all your batteries. This is a work around, but I would still want something more concrete than relying on a proximity sensor!
 

evilisto

Senior Member
Nov 26, 2010
486
2,318
Here is another way..
platform_frameworks_base / policy / src / com / android / internal / policy / impl / KeyguardViewMediator.java

See line 864~

Code:
    private boolean isWakeKeyWhenKeyguardShowing(int keyCode, boolean isDocked) {
        switch (keyCode) {
            // ignore volume keys unless docked
[COLOR="Red"]            case KeyEvent.KEYCODE_VOLUME_UP:
            case KeyEvent.KEYCODE_VOLUME_DOWN:[/COLOR]
            case KeyEvent.KEYCODE_VOLUME_MUTE:
                return isDocked;

            // ignore media and camera keys
            case KeyEvent.KEYCODE_MUTE:
            case KeyEvent.KEYCODE_HEADSETHOOK:
            case KeyEvent.KEYCODE_MEDIA_PLAY:
            case KeyEvent.KEYCODE_MEDIA_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_STOP:
            case KeyEvent.KEYCODE_MEDIA_NEXT:
            case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
            case KeyEvent.KEYCODE_MEDIA_REWIND:
            case KeyEvent.KEYCODE_MEDIA_RECORD:
            case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
            case KeyEvent.KEYCODE_CAMERA:
                return false;
        }
        return true;
    }

Remove those 2 lines and compile. Then you can get volume wake feature when using stock lockscreen.
Maybe you can find smali editing method in somewhere in xda..