I have a Nexus 5. Even if I enable security passcode or pattern, someone can still switch off my mobile using the power button. How can I prevent it?

  • 7
    What's your actual goal? Are you just worried about a "friend" turning your phone off to annoy you, or is there something else?
    – Dan Hulme
    Commented Mar 11, 2014 at 15:49
  • 4
    You can also remove the power button and alter it so pressing it no longer presses the actual electronic button inside the phone. If you drill a small hole in the power button where the electronic button is, you may then use a paperclip to press the button. There are also apps that turn the device off if you want to turn it off without a paperclip.
    – Adam Davis
    Commented Mar 11, 2014 at 17:25
  • 2
    @DanHulme First use case that comes to my mind is thwarting a thief trying to turn off the device to prevent locating it remotely.
    – brichins
    Commented Mar 11, 2014 at 22:17
  • 2
    @brchins I can think of lots of reasons one might want to stop the phone being turned off, but that's irrelevant. The question is why Frustrated Coder wants to stop someone turning his phone off.
    – Dan Hulme
    Commented Mar 12, 2014 at 7:41
  • 2
    My main concern was thieves! They steal your phone and turn it off so that it can no longer be traced!. Lost my Nexus 4 dont want to lose this! Commented Jun 19, 2014 at 10:01

6 Answers 6


You cannot (barring any hardware tweaks.)

If you root your phone and install a custom ROM, you may be able to remove the "Turn off" and "Reboot" options from the Power menu. However, Nexus 5 (as do most modern phones) has a hard-wired feature, where holding the power button for 10 seconds shuts the phone off. This is done so that you can restart the phone if it freezes up. Since Nexus 5 doesn't have a removable battery, this hard reset would be the only way to shut it off without having to wait for the battery to drain.

If you are technically inclined, you can always make hardware modifications to the phone which would prevent the Power button from functioning normally. However, such mods are not for the novices, and will certainly void your warranty.

  • Almost every device today has that feature - press long to power off.
    – Om Shankar
    Commented Mar 12, 2014 at 13:20
  • Note that on some devices, holding down the power button actually causes the device to reboot. Commented Oct 8, 2018 at 11:28

You could make/modify a phone case so that the power button is covered. This would avoid having to void the warranty.

  • 7
    ...then you have the problem of making the case non-removable.
    – Navin
    Commented Mar 12, 2014 at 4:25
  • I would think you'd run into the "now how do I turn the screen on?!" problem first...
    – derobert
    Commented Mar 12, 2014 at 17:41
  • Good idea butt i think u can turn the phone off via software Commented Mar 12, 2014 at 19:42

So I would say the best way would be :

1 - custom rom to alter the turn off menu

2 - not to remove the power off option but replace by a fake one that would pretend that the phone switch off (playing a dumb animation as usual) but just putting the phone in sleep/locked mode, actually it should already start at that point to turn on gps, send position thru email, record voice and take picture... only a thief would use a button that a user dismissed.

Aside that a device should not have a lock screen, otherwise a thief would flash it straight away imho, he should be able to use it as he wants, or supposedly as he wants... probably a fake normal mode without lock activated by the fake turning off described in 2-


You can try this app to achieve this - Smart Lockscreen Protector

This app blocks the power menu from showing up if your phone is locked. So it stops people from powering off or rebooting your phone when its locked.

Note: However if the person tries to hard reboot by holding the power button for more than 10 seconds (hard reset), then this app cannot support that. As it's hard-wired to do so.

It at least protects your phone to some extent, without rooting your phone.

  • A device can be halted by long-pressing the power button for few seconds. Does this app prevent it?
    – Firelord
    Commented Feb 10, 2016 at 20:08
  • 1
    No, Long-pressing is a hardware triggered operation. So this app cannot prevent that from happening. Commented Feb 11, 2016 at 6:52

There is no way you can prevent the phone from getting turned off(without rooting, which will void your warranty if the device is in warranty).

If your phone is supposed to get stolen, it will be.

So Only thing you can do is keep your devices safe.


Just root your phone and buy Cerberus. They got this option.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .