How can I disable the keyguard when a broadcast receiver is activated by screen_on, so that when it occurs the user sees an activity that I have started behind it? (The act
I'm not seeing the Keyguard solution work (and it's been deprecated). What works for me is to grab a permanant PARTIAL_WAKE_LOCK
that I never release. This prevents the device from truly falling asleep and thus avoids the lock-screen every being activated.
Then every time the screen shuts off, I listen for that notification and wake the device back up. It works on all the devices I have tested on.
I realize that this will kill the device's battery pretty fast, so, you have to use this very sparingly and mindfully.
i would recommend using the window flags dismiss_keyguard or show_when_locked if you have a window that needs to come over the top of the lockscreen right at wakeup.
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SHOW_WHEN_LOCKED
how you use this is as follows (called in onCreate before setting layout)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
I think I figured out what I did wrong. It seems like it was just a tag error in my manifest when using the disable_keyguard permission. It's working correctly now that I corrected the manifest.