DUPLICATE WARNING: this post IS NOT about screen on/off, this post IS about keyguard lock (those issues are not the same).

Luckily there is a direct event when the keyguard is unlocked, but what about event when the keyguard is locked? I searched Android API event list back and forth, and I simply don't see it (phrase "lock" -- none, phrase "keyguard" -- one, for off state).

I know the workaround -- wait for screen off event, check in loop the state of keyguard AND wait for screen on event, because the phone can go only in two directions starting from screen off -- either phone will be locked or the screen will be on again. Not huge amount of code, but hack anyway, so I hope I missed something in the manual and there is direct event for keyguard lock.