5

The power button on my Android phone is dodgy and doesn't always work. I think it's on its last legs so I want to avoid pressing it if possible to extend its lifespan!

I know nothing about coding or how Android works. But I was wondering if it is possible to send the button press event to the system using this sort of code somehow: KeyEvent#KEYCODE_POWER.

Is there a way I can open the power menu via the screen only? Is there something I can type into a terminal (how do you get a terminal in Android?) that would open the power menu?

1
  • I should note I'm using LineageOS and not rooted, but can root if that helps. Commented Apr 16, 2022 at 14:49

1 Answer 1

3
  1. Go to "Settings".

  2. Enter the "Accessibility" section, within which shall be an "Accessibility Menu" option. This can be searched for, instead:

    A Screenshot

  3. Press the Accessibility Menu icon. You should see, amongst the icons, one labelled "Power":

    A Screenshot

  4. Press it to show the Power Menu:

    A Screenshot

3
  • Thank you for the answer but unfortunately I'm using LineageOS and the Accessibility Menu is missing, so this solution won't work for me. Is there another way? Commented Apr 16, 2022 at 14:28
  • 2
    @glauco You can install Android Accessibility Suite from the Play Store (just know that it is an app by Google). There are other possibilities to show the power menu, but they all require Accessibility service. Commented Apr 16, 2022 at 15:16
  • 1
    Note that now on LineageOS 14 (240205 build on Fairphone 4) the accessibility tab allows enabling the the accessibility meny which allows emulate a power button use. Commented Mar 6, 2024 at 20:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.