I don't normally like to lock my phone as I find it annoying.

Is it possible to enable the lock or some kind of encryption on the phone in an emergency, for example by holding down a number of the hardware buttons?

2 Answers 2


Opposing ce4, I see a possibility using e.g. Tasker. In case you don't know it: Tasker is the most complex automation tool available on Android. You connect "events" (as e.g. phone rings, incoming SMS, a given time (clock), a location, ...) with "tasks" (actions to be taken, as e.g. switching mobile data on/off, enabling/disabling airplane mode, adjust volume, and much more) to so-called "profiles".

So here comes an example profile for your problem:

  • Event:
    • event->hardware->camera button pressed
    • event->sensor->shake->[configure details]
  • Task:
    • Keyguard On

So with that profile, if you hold down the camera key and shake your device, the configured keyguard (pattern lock, pin, password) will be activated. Obviously you need the opposite action as well: Use the above again with a different "shake pattern" and, of course, "Keyguard Off" in the task.

So initially, you configure your pattern/pin/password to be set on, as usual on Android (so the system knows which one to use). After that, use your configured hold-shake-pattern to activate and deactivate it.

Pretty simple. Though I didn't test it -- but I like that idea, so I certainly will test it soon myself :)

  • Speaking of tasker - saw that they made ui changes...
    – t0mm13b
    Commented Jan 22, 2013 at 23:10
  • Quite a while ago. Or is there something new to come? Well, we're not in a forum here to discuss this ;)
    – Izzy
    Commented Jan 22, 2013 at 23:16
  • Okie... /me tip-toes out... <offtopic/> xD
    – t0mm13b
    Commented Jan 22, 2013 at 23:20

It's probably not possible with stock firmware.

You definitely have to have encryption enabled beforehand, as switching it on takes around an hour and cannot be intercepted. And encryption forces you to have a secured lock-screen normally (stock firmwares).

CyanogenMod7/9/10 has a unique Profiles feature; I was able to set up one with a disabled lock-screen. You can switch between profiles rather quickly (long-pressing the power-button brings up the power menu where one can switch profiles).

CyanogenMod users can read more here:
What are Cyanogenmod's profiles good for?
Certificate Install without mandatory PIN lockscreen
Android “fake having a locked phone” - Galaxy SII

You must log in to answer this question.

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