Skip to content Skip to sidebar Skip to footer

Flag_dismiss_keyguard To Unlock A Screen

I am using FLAG_DISMISS_KEYGUARD to disable a keygaurd. This is working only when my app is on foreground. But android documents syas that Use FLAG_DISMISS_KEYGUARD and/or FLAG_S

Solution 1:

From the Javadoc for WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD:

Window flag: when set the window will cause the keyguard to be dismissed, only if it is not a secure lock keyguard. Because such a keyguard is not needed for security, it will never re-appear if the user navigates to another window (in contrast to FLAG_SHOW_WHEN_LOCKED, which will only temporarily hide both secure and non-secure keyguards but ensure they reappear when the user moves to another UI that doesn't hide them). If the keyguard is currently active and is secure (requires an unlock pattern) than the user will still need to confirm it before seeing this window, unless FLAG_SHOW_WHEN_LOCKED has also been set.

It sounds like in your case you'd only want to use FLAG_SHOW_WHEN_LOCKED and not FLAG_DISMISS_KEYGUARD.

Post a Comment for "Flag_dismiss_keyguard To Unlock A Screen"