I am using Android L on Lenovo phone. Mostly I don't hand out my phone to anybody or keep it unattended. So, I prefer not to bother myself with a lock (password or pin) and just keep swipe lock screen. But while many a times when I have to keep my phone away from my attention, I want to put lock password over it. For this I have to go to the settings and change it and change it back when I am done. Is there a way to keep two different lock screen setting(say swipe and pass) on two different triggers (say power button and option on long press power button menu)?
You could use Android's Smart Lock feature for this, see e.g.:
- Use Smart Lock in Android 5.0 and Never Unlock Your Phone at Home Again
- How to use Trusted Devices in Android
If you have e.g. any Bluetooth device, you can tell your Android device it's "safe" as long as it can see it (so: no lock), but "not safe" otherwise (device gets locked). To have your device locked, you'd simply have to shutdown or disconnect the BT device (or have it out-of-reach; for Bluetooth-devices usually being away 10m is enough – even less with walls in between).
Smart Lock works natively with Android 5+ – and for earlier versions, there are fitting apps (e.g. Zwype Lock Screen, SkipLock, or using one of the more generic automation solutions to build your own: I e.g. use tasker with the Secure Settings plugin for this).