I love my GN4 phone but it has a problem: it wakes up (screen turns on) randomly while in my pocket. When this happens, the screen is on and contact with the inside of my pocket causes spurious random screen touches which is highly dangerous. Not just the risk of butt-dialing people, but it could also change settings, uninstall apps, etc.
The cause is simple. The home button wakes the phone, and it protrudes slightly, so it’s very easy to trigger while in a case or pocket. The best fix would be a system checkbox enabling users to prevent the home button from waking the phone. When disabled, the only way to wake the phone would be the power button, which is quite firm and never is accidentally pushed.
However, Samsung’s response to this is idiotic: “don’t put it in your pocket”. Because Samsung has their heads in the sand (to be polite) on this, users have come up with their own solutions,
One is to install Xposed. But this is a sledgehammer. It works but I didn’t want to deal with it.
Since my device is rooted, I figured there must be some system config text file I could edit to get what I wanted. I didn’t find exactly what I wanted–simply disable wake on the Home button. But I found something close enough that works: swap the Home and Menu buttons.
On my GN4 running T-Mobile Android 6.0.1, the file to edit was: /system/usr/keylayout/Generic.kl
Change two lines:
key 172 HOME
key 254 APP_SWITCH
So they read:
key 254 HOME
key 172 APP_SWITCH
Reboot.
The App Switch (Menu) button will now be Home button, and vice versa. And the Home button will not wake the phone. Nor will the Menu or any other button. The only way to wake the phone will be to press the power button.
My phone no longer randomly wakes up in my pocket. No more butt-dialing, accidentally rearranged home screens, uninstalled apps, or hot phone. No more wasted battery consumption. It’s a bit strange to get used to swapped Menu & Home buttons, but the benefits are worth it.
Note: I tried editing /system/usr/keylayout/gpio-keys.kl and removing the WAKE_DROPPED indicator. Disabling the home button’s WAKE feature without remapping buttons would be ideal. But this didn’t work; it had no effect. Apparently it worked in prior versions of Android, but Samsung changed the way keys are mapped in 6.0.1.