I'm working in an app that needs to to do any of this actions:
- Lock the device
- Put the device in sleep mode
- Turn off the screen
How can I achieve this?
Found this option, but it requires the proximity sensor to be in "near" state to turn off the screen:
mWakeLock = mPowerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, "tag");
mWakeLock.acquire();
Thanks