We need to trigger device locking at certain points in our application, but the call to the Lockscreen.lock() is failing to lock the screen, and returning result of false. Is there any way to determine why the lock request is failing? We are running fullscreen immersive in customer mode, but didn't think any of that should prevent a lock request.
Code is very straight forward...
Lockscreen lockscreen = new Lockscreen(getBaseContext().getApplicationContext()); lockscreen.lock();