Code example for KeyguardManager.KeyguardLock

Methods: disableKeyguard, reenableKeyguard

0
            msg.setGravity(Gravity.CENTER, msg.getXOffset() / 2, msg.getYOffset() / 2);
            msg.show();
        } else { 
            getLock(context);
            if (lockScreen && lock != null) {
                lock.disableKeyguard();
                lockScreen = false;
                // writeState(context); 
            } else if (lock != null) {
                lock.reenableKeyguard();
                lockScreen = true;
                // writeState(context); 
            } 
        } 
    } 
 
    /** 
     * Gets the state of GPS location. 
     * 
     * @param context 
     * @return true if enabled.