How to Override the power key of an IR remote for a rooted Android device? I have tried the following
case KeyEvent.KEYCODE_STB_POWER:
Toast.makeText(this, "KEYCODE_STB_POWER key pressed",
Toast.LENGTH_SHORT).show();
return true;
case KeyEvent.KEYCODE_AVR_POWER:
Toast.makeText(this, "KEYCODE_AVR_POWER key pressed",
Toast.LENGTH_SHORT).show();
return true;
case KeyEvent.KEYCODE_TV_POWER:
Toast.makeText(this, "KEYCODE_AVR_POWER key pressed",
Toast.LENGTH_SHORT).show();
return true;
case KeyEvent.KEYCODE_POWER:
Toast.makeText(this, "KEYCODE_POWER key pressed",
Toast.LENGTH_SHORT).show();
return true;
But none of the above worked. Am I missing anything?