1

I couldn't find any broadcast receiver to check if User has swiped the Notification Lock Screen and has reached the Enter Pin/Password screen. The extra lock screen has been added since Lollipop. I tried the following:

  1. ACTION_USER_PRESENT: This is called after user unlocks the screen after entering PIN lock (keyguard is gone) .
  2. ACTION_SCREEN_ON: This is called when the screen Wakes up and reaches the Notification Lock Screen.

I am developing an app and one of its use is to capture a picture when user lands on the Enter Pin/Password Screen.

  • ACTION_SCREEN_ON fails to work when a user was involved in a Hangouts/Whatsapp Call and lands to the Lock Screen on Call Disconnect.
  • It also fails to capture the correct picture, in case the user was not present while swiping the Notification Lock Screen.

Notification Lock Screen:

Notification Lock Screen

Pin/Password Screen:

Pin/Password Screen

Geek_2501
  • 31
  • 2
  • Have you checked [this](http://developer.android.com/reference/android/app/KeyguardManager.html)? – t0mm13b Oct 24 '15 at 20:20
  • @t0mm13b What exactly in KeyguardManager as KeyguardLock has been deprecated in API 13 & also it doesn't have any Broadcast Receiver. – Geek_2501 Oct 24 '15 at 20:44
  • Have you searched? This came up [question](http://stackoverflow.com/questions/20224637/a-way-to-get-unlock-event-in-android) – t0mm13b Oct 24 '15 at 20:49
  • @t0mm13b Yes. And, as I mentioned above ACTION_USER_PRESENT is called when user unlocks the screen after entering PIN lock (when keyguard is gone). I am looking for a reciever where Keyguard is displayed on the screen after the extra swipe lock on Android 5.0+ Devices. – Geek_2501 Oct 24 '15 at 21:20
  • Hmmm... Show your `AndroidManifest.xml`. Also, as a FYI, please read [this](http://developer.android.com/reference/android/content/Intent.html#ACTION_USER_PRESENT) and pay attention to what is stated. It looks like a security measure in Lollipop and later. – t0mm13b Oct 24 '15 at 21:29
  • @t0mm13b I have tried that. It didn't work out as per my needs. Also, I haven't registered the receivers via manifest instead i registered receiver via code: https://gist.github.com/ishitcno1/7261765 – Geek_2501 Oct 25 '15 at 12:49
  • @CommonsWare Could you help? – Geek_2501 Oct 25 '15 at 12:52
  • OP: You are missing the point entirely, what I mentioned in the above link, about paying attention to the ACTION_USER_PRESENT, it is only system apps can send the broadcast, in other words, user apps such as yours are blocked from it despite having registered the receiver. – t0mm13b Oct 25 '15 at 17:38
  • @t0mm13b I understand that. But, **ACTION_USER_PRESENT is of no use to me** despite, it being protected. I need a way to detect the swipe of DEFAULT SWIPE LOCK over PIN/PASSWORD Keyguard in Lollipop Devices not the SCREEN UNLOCK. **I repeat I don't need ACTION_USER_PRESENT** as it is called when keyguard is gone not when Keyguard is displayed on the screen. – Geek_2501 Oct 26 '15 at 17:16

0 Answers0