When my phone is locked, the camera and volume controls still work which I find strange.
How can I lock these down also, I don't want these controls to be pressed when in my pocket by mistake.
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.
Sign up to join this communityWhen my phone is locked, the camera and volume controls still work which I find strange.
How can I lock these down also, I don't want these controls to be pressed when in my pocket by mistake.
My device doesn't have a separate camera key, so I was able to test my solutions only with volume up and down keys. AutoInput with Tasker (full 7 day trial; userguide) is what you can try. You would either have to buy or enable full trial of former since the solution featuring AutoInput would not work.
Important: Launch AutoInput and enable its accessibility service.
For Tasker:
Task: (Action):
Plugin → AutoInput → Modes
Configuration:
Exit task: (Action):
Plugin → AutoInput → Modes
Configuration:
That did the job in stock Android 6.0.1 in Nexus 6, at least for volume rockers.
On a rooted Android, you can try Xposed Additions app. It requires a compatible Xposed Framework1.
Instructions:
Follow the said instructions for the rest of your relevant hardware keys.
Note: If Ambient Display is enabled, then during the moments when the display lightens up briefly, pressing any of the relevant keys would result in their actual intended effect and not the one the two solutions aim for.
1 Xposed Framework: Android 4.x, Android 5.x and 6.x