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?
-
7What's your actual goal? Are you just worried about a "friend" turning your phone off to annoy you, or is there something else?– Dan HulmeCommented Mar 11, 2014 at 15:49
-
4You 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 DavisCommented 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.– brichinsCommented 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 HulmeCommented Mar 12, 2014 at 7:41
-
2My 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!– Frustrated CoderCommented Jun 19, 2014 at 10:01
6 Answers
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. 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.– NavinCommented Mar 12, 2014 at 4:25
-
I would think you'd run into the "now how do I turn the screen on?!" problem first...– derobertCommented 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-
-
@MatthewRead huh? repo.xposed.info/module/hk.kennethso168.xposed.apmplus with "Fake Power Off" feature Commented Feb 13, 2021 at 2:09
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
-
1No, 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.