List of usage examples for android.app KeyguardManager isKeyguardLocked
public boolean isKeyguardLocked()
From source file:Main.java
public static boolean isScreenLocked(Context context) { KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); return keyguardManager.isKeyguardLocked(); }
From source file:Main.java
/** * Return whether the keyguard requires a password to unlock and may * have any privacy restrictions./*from w ww.j ava2s.com*/ */ public static boolean isSecure(@NonNull Context context) { KeyguardManager km = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); return km.isKeyguardSecure() && km.isKeyguardLocked(); }