I think that you are confusing two different things. You explicitly set the state of the KeepAlive lock.
This means that you can track it in your program.
Yes, I had tried this also, but neither works.
After a certain time, because of the timeout screen, the display brightness down, but the variable "current" always indicates the same value (I put a Log in a Timer).
I can not detect that it is in low light due to the screen timeout.
But the basic question is how can I detect that I have entered in this mode.