I am working on a background accessibility service and my program needs to respond differently in the following two scenarios.
A is after the user wakes up the screen using the power button, when the screen is in a locked state, but the PIN, Pattern and other password input screens are not displayed.
B is that the user has already entered the interface for entering PIN, Pattern, at this time the screen is still locked, but the user can directly enter the PIN or gesture now.
In order to facilitate the description, I made an animation to illustrate how to identify the A state and B state through the program.