1

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.

  • 1
    Which Android version and device are you using? Is the Android rooted? If yes, then Xposed Additions could help, provided that your ROM is compatible. – Firelord Apr 13 '16 at 18:05
0

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:

  1. Profile: State → Display → Display State → Is: Off
  2. Task: (Action):

    • Plugin → AutoInput → Modes

      • Configuration:

        • Key Suppress: Enable
        • Keys: tick the entries viz. Volume Up, Volume Down and Camera
      • Timeout: None
  3. Exit task: (Action):

    • Plugin → AutoInput → Modes

      • Configuration:

        • Key Suppress: Disable
        • Keys: tick the entries viz. Volume Up, Volume Down and Camera
      • Timeout: None

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:

  1. Launch Xposed Additions → tap Buttons
  2. Tap Add new key and when the dialog appears press your hardware key once to register it
  3. Tap the newly created entry for the button you pressed earlier
  4. Tap Add new ConditionScreen Off
  5. Tap the newly created Screen Off entry → tick Click under Single Actions

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.