Added support for locking the IOS device for a number of seconds.

Removed unused code
Merge branch 'master' into ios_background