Very simple app to lock the screen.
I use it with FAST launcher to quickly lock the screen (either clicking the icon or typing "lk") because I miss my previous launcher feature "lock with double click on home button". I tried a series of apps that were not comfortable with FAST launcher because they required too much steps to lock the screen.
Its behavior is very simple: on first run it will ask the required device administrator permission and then it will lock the screen. On next launches, it will immediately lock the screen.
It is now possible to set Lock as an Assistant app (Settings > Apps > Advanced > Default apps > Assist & voice input
). A long-press on home button will now lock the device wherever you are.
I recently updated to Nougat on my Huawei P9 Lite and it broke my app (screen lock by an administrator requires to enter full password or pin). Thanks to a XDA user, I updated my app to circumvent this. Now, on Huawei with Nougat and EMUI 5, it doesn't even require to be an administrator.
How to remove an app with active device admin enabled on Android?