Removing Power Off Option on Lockscreen

Search This thread

gokuman56

Senior Member
Mar 19, 2010
458
86
N/A
Hello,

I was wondering if it was possible to remove the power off option on the lock screen.
I believe that it is a good way to ensure that the phone does not get turned off when stolen, which could make recovering/tracking it much easier.

Imagine if someone stole your phone and you have an app like find my droid on it, if the phone was turned off, then it would be a problem, in terms of finding it, but if it was on and unable to be turned off (if it was on the lockscreen, with a password), then there would be a perfect way to track it. Is this possible?
Even if you did hold the power button, the phone would reboot, not turn off, so using apps such as findmydroid would work perfectly.
In Fact, I have seen that my EVO LTE did not have a turn off option when you held the power button on the lockscreen, all it did was reboot when you held it.
I was wondering if we could do the same on the nexus 4

Thanks
 
Last edited:

obsanity

Senior Member
Jun 4, 2010
2,035
517
Because the Nexus 4 does not have a removable battery it has a fail safe hardware switch after holding the power button for a few seconds. It is because of that, such a restriction on the lock screen would not be possible.

Sent from my Nexus 4
 
  • Like
Reactions: stevemw

yoft1

Senior Member
Feb 15, 2012
394
216
Hello,

I was wondering if it was possible to remove the power off option on the lock screen.
I believe that it is a good way to ensure that the phone does not get turned off when stolen, which could make recovering/tracking it much easier.

Imagine if someone stole your phone and you have an app like find my droid on it, if the phone was turned off, then it would be a problem, in terms of finding it, but if it was on and unable to be turned off (if it was on the lockscreen, with a password), then there would be a perfect way to track it. Is this possible?

Thanks

It wouldn't really matter since if you hold the power button for around 10s it's the equivalent to a battery pull. This is hard coded into the system and cannot be removed in any way. But I agree it would be nice if there was a way to prevent stolen phones from being turned off.

Sent from my Nexus 4 using xda premium
 

gokuman56

Senior Member
Mar 19, 2010
458
86
N/A
It wouldn't really matter since if you hold the power button for around 10s it's the equivalent to a battery pull. This is hard coded into the system and cannot be removed in any way. But I agree it would be nice if there was a way to prevent stolen phones from being turned off.

Sent from my Nexus 4 using xda premium

The Phone would reboot wouldn't it, instead of turning off? If a person did steal it, then that person would eventually get tired of holding that button down and leave it alone, or put it back, which is why I think removing the power off/boot option is a good way to help with this issue.
 

juicyjones

Senior Member
Nov 16, 2012
182
75
Seattle
The Phone would reboot wouldn't it, instead of turning off? If a person did steal it, then that person would eventually get tired of holding that button down and leave it alone, or put it back, which is why I think removing the power off/boot option is a good way to help with this issue.

No, holding down the power button for ten seconds breaks the power circuit to the battery and turns the phone off. To turn it back on you have to press the power button again.

- Nexus 4 / Paranoid Android / Franco r82 / 1188MHz / 1010mV -
 
  • Like
Reactions: stevemw

gokuman56

Senior Member
Mar 19, 2010
458
86
N/A
No, holding down the power button for ten seconds breaks the power circuit to the battery and turns the phone off. To turn it back on you have to press the power button again.

- Nexus 4 / Paranoid Android / Franco r82 / 1188MHz / 1010mV -

Nope, Try it and tell me, when I hold down the power button, it reboots the phone


Edit: If I hold it until the screen turns off, then it will reboot (which is usually what an normal person would do)
If I hold it for about 5 seconds longer than the screen turns off, then it will turn off (which a normal person would not do, and it took me a few tries to figure it out)

So, I am still wondering if it would be possible to remove the power/boot options from the lockscreen, as it would be a great security feature
 
Last edited:

haverlok

Member
Jan 23, 2013
49
3
I have a N4 and is a really good solution from it. My sgs was stolen and was a first thing that the thief do: Turn off.. :(

Enviado desde mi Nexus 4 usando Tapatalk 2
 

chrisMBP

Member
Dec 10, 2011
12
2
This is such a good idea. But then again if they were smart they could just boot in recovery and wipe :/ or take out the sim
 
Last edited:

haverlok

Member
Jan 23, 2013
49
3
Re: Removing Power Off Option on Lockscreen,

Somebody have a little solution? In some threat recommended don't have block screen all with the objective that the thief use our phone and we have more time, but I really know exist the way to difficult the power off ours phone. Some have an idea?

Enviado desde mi Nexus 4 usando Tapatalk 2
 

MrDarkKV

Senior Member
Feb 24, 2013
342
254
Seems like a really good idea! I would love ROM's to start featuring this option! I shouldn't be too hard to code...
Hmmm, subscribed.
Hopefully a dev picks this up.
 

MrDarkKV

Senior Member
Feb 24, 2013
342
254
Thief can pull out SIM or reboot to recovery even if there is no way to turn phone off.

Lets be honest here, 98% of thief's probably wont even know what the recovery is. And it can still be tracked via the GPS even if the sim is removed.

Plus most phones (inc mine) are locked to one sim card, so if the sim is removed, or changed, the phone automatically locks itself, and the location sent to me via a web app and email.

Again, its not meant to stop all thief's, but it's a fail-safe against the majority.
 

stpx88

New member
Nov 29, 2011
4
3
Arright.. gimme one sec. I'm on cm10.1 so i have to flash aokp real quick.

EDIT:
MAKE A BACKUP FIRST!! JUST IN CASE.

Well here is a flashable zip ONLY for AOKP mr1 Build 5 (You will BOOTLOOP flashing on any other rom) . This will remove the power off option, in the power dialog, while on the lockscreen.

link:
db . tt/A2hLvgFw
(remove the spaces, i can't post links yet apparently)
 
Last edited:
  • Like
Reactions: MrDarkKV

MrDarkKV

Senior Member
Feb 24, 2013
342
254
Arright.. gimme one sec. I'm on cm10.1 so i have to flash aokp real quick.

EDIT:
MAKE A BACKUP FIRST!! JUST IN CASE.

Well here is a flashable zip ONLY for AOKP mr1 Build 5 (You will BOOTLOOP flashing on any other rom) . This will remove the power off option, in the power dialog, while on the lockscreen.

link:
db . tt/A2hLvgFw
(remove the spaces, i can't post links yet apparently)

Slight problem. Screenshot_2013-03-19-10-37-171543632861.jpg
 

stpx88

New member
Nov 29, 2011
4
3
Sorry bout that. This one will work.
www . dropbox . com/s/y3ezavo738ro8i1/remove-poweroff-AOKP-mr1-build5.zip

Sent from my Nexus 4 using XDA Premium HD app
 
  • Like
Reactions: MrDarkKV

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Because the Nexus 4 does not have a removable battery it has a fail safe hardware switch after holding the power button for a few seconds. It is because of that, such a restriction on the lock screen would not be possible.

    Sent from my Nexus 4
    1
    The Phone would reboot wouldn't it, instead of turning off? If a person did steal it, then that person would eventually get tired of holding that button down and leave it alone, or put it back, which is why I think removing the power off/boot option is a good way to help with this issue.

    No, holding down the power button for ten seconds breaks the power circuit to the battery and turns the phone off. To turn it back on you have to press the power button again.

    - Nexus 4 / Paranoid Android / Franco r82 / 1188MHz / 1010mV -
    1
    Arright.. gimme one sec. I'm on cm10.1 so i have to flash aokp real quick.

    EDIT:
    MAKE A BACKUP FIRST!! JUST IN CASE.

    Well here is a flashable zip ONLY for AOKP mr1 Build 5 (You will BOOTLOOP flashing on any other rom) . This will remove the power off option, in the power dialog, while on the lockscreen.

    link:
    db . tt/A2hLvgFw
    (remove the spaces, i can't post links yet apparently)
    1
    Sorry bout that. This one will work.
    www . dropbox . com/s/y3ezavo738ro8i1/remove-poweroff-AOKP-mr1-build5.zip

    Sent from my Nexus 4 using XDA Premium HD app
    1
    Right got it working !
    View attachment 1820086 any chance you could release the source for further development? :)

    All it takes is editing the android.policy.jar. The file (android system root)/frameworks/base/policy/src/com/android/internal/policy/impl/GlobalActions.java

    Change:
    Code:
    mItems.add(
                new SinglePressAction(
                        com.android.internal.R.drawable.ic_lock_power_off,
                        R.string.global_action_power_off) {
    
                    public void onPress() {
                        // shutdown by making sure radio and power are handled accordingly.
                        mWindowManagerFuncs.shutdown(true);
                    }
    
                    public boolean showDuringKeyguard() {
                        return true;
                    }
    
                    public boolean showBeforeProvisioning() {
                        return true;
                    }
                });

    to:
    Code:
    mItems.add(
                new SinglePressAction(
                        com.android.internal.R.drawable.ic_lock_power_off,
                        R.string.global_action_power_off) {
    
                    public void onPress() {
                        // shutdown by making sure radio and power are handled accordingly.
                        mWindowManagerFuncs.shutdown(true);
                    }
    
                    public boolean showDuringKeyguard() {
                       [B]// Change to false to hide when on lockscreen[/B]
                        [B]return false;[/B]
                    }
    
                    public boolean showBeforeProvisioning() {
                        return true;
                    }
                });

    Pretty simple. They should add an option to disable this in lockscreen

    ---------- Post added at 11:22 PM ---------- Previous post was at 11:11 PM ----------

    Hmmm it still has the reboot and airplane options making this almost uselessView attachment 1819868

    Those, im pretty sure at least on cm, can be configured.