I have found snippets somewhere on internet few months ago, I have made changes and recently uploaded the working demo on my github account, You can have a look at this
Note:
It will disable “hardware” home button.
I hope it will be helpfull !!
Screenshots:
It provides lockscreen in API 8 or above.
Initial
Locked
Unlocked