Code example for KeyguardManager

Methods: isKeyguardLocked

0
    private boolean isKeyguardForeground() { 
        KeyguardManager km = (KeyguardManager) mContext
                .getSystemService(Context.KEYGUARD_SERVICE);
        if (km == null)
            return false; 
        return km.isKeyguardLocked();
    } 
 
    private void updateBarColors() { 
        if (mGlassEnabled) {
            updateNavbarColorValue(); 
            updateStatusbarColorValue(); 
            applyGlassEffect(); 
        } else { 
            handleNavigationBarColorChange(); 
            handleStatusbarColorChange(); 
        } 
    } 
 
    public void applyGlassEffect() { 
        if (isKeyguardForeground()) {