Code example for KeyguardManager

Methods: isKeyguardLocked, isKeyguardSecure

0
    private boolean isKeyguardLocked() { 
	    if (Build.VERSION.SDK_INT >= 16) {
	        KeyguardManager kgm = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
	        if (LOGV) {
	            if (kgm != null) {
	                GLogger.v(TAG, "kgm.isKeyguardLocked()="+kgm.isKeyguardLocked()
	                        + ". kgm.isKeyguardSecure()="+kgm.isKeyguardSecure());
	            } 
	        } 
	        // isKeyguardSecure excludes the slide lock case. 
	        return (kgm != null) && kgm.isKeyguardLocked() && kgm.isKeyguardSecure();
	    } else { 
	        return false; 
	    } 
    } 
}