1

So when Power button is pressed one time then the screen is off or basically locked. I would like to alter this behavior so that if power button is pressed then the screen should not go off. As per discussion here it is not possible Stop the Screen Locking when power button is pressed but then what I have is a rooted one. Is there a solution where I can use su privileges to achieve this somehow?

So far I tried this code snippet but this is not invoked when power button is clicked only once. If I do a long press on Power button then I can get to this but my objective is to get to it for just one click.

@Override
public boolean dispatchKeyEvent(KeyEvent event) {
    if (event.getKeyCode() == KeyEvent.KEYCODE_POWER) {
        //dostuff
        return true;
    }

    return super.dispatchKeyEvent(event);
}

Any Suggestions?

Community
  • 1
  • 1
lazyguy
  • 963
  • 1
  • 13
  • 33

1 Answers1

0

I'm afraid simply rooting the device won't help you. Unless you can get your hands on firmware that's suitable for your device and allows this behavior this will not be possible to implement.

SimonV
  • 511
  • 5
  • 12
  • Getting on to Firmware was my preferred route but that was a long story as I compiled AOSP for toro and generated a flashable zip but could never flash it on the samsung verizon SCH-i705 tablet as the tablet had espressovzw build installed and it was not booting after toro and couldn't find help on forums about that either.. – lazyguy Nov 08 '13 at 16:13