View paste
1) How to set the device lock timer? I want an app that waits till the screen goes off and then locks the device . I have used SCREEN_OFF_TIMEOUT and specified the screen off timeout. And I want the device to be locked immediately. after the screen goes off. Can I use a receiver for this or a service so that the app sees that the screen went off and then locks the device.
2) How do i implement a screensaver after the device is locked or if the device is idle for a long time.? I want the screen to be on for a specific amount of time and then screen goes off. Should I use the daydream api for that?