Office Hours — Today, August 3

Tuesday, August 1

Aug 3
7:25 PM
Mark M.
has entered the room
Mark M.
turned on guest access
7:45 PM
BlueD
has entered the room
Mark M.
hello, BlueD!
how can I help you today?
7:50 PM
BlueD
Hey Mark.
I have two major questions for you today!
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?
Mark M.
outside of device admin APIs, I do not think that you have any control over when the screen locks
Android does not have the concept of screensavers, other than to the extent the old Daydream API (not to be confused with the VR stuff) offered them
and I never played with that API and so know very little about it
BlueD
So can i make the screen on with the device still locked? Is that possible in android?
Mark M.
it should be
if you create a full wakelock, that should light up the screen
however, the screen would still be locked, if it was locked prior to you acquiring the wakelock
I have never tried this, and so YMMV
BlueD
I am able to lock the device using the device admin API using locknow() . I am able to set the screen off timer. But is there any way that could be made consecutive?
7:55 PM
Mark M.
I have no idea, sorry
BlueD
Okay. No problem.
8:00 PM
BlueD
and for wake locks, does acquire(timeout) in powermanager mean that the wakelock ends and screen goes off?
Mark M.
if you mean after the timeout elapses, yes, assuming nothing else is holding a full wakelock
BlueD
Okay. Thank you
8:25 PM
BlueD
Iam sorry i didnt leave. Thanks Mark. Have a goodnight
BlueD
has left the room
BlueD
has entered the room
BlueD
has left the room
Mark M.
turned off guest access

Tuesday, August 1

 

Office Hours

People in this transcript

  • BlueD
  • Mark Murphy