Code example for KeyguardManager

Methods: newKeyguardLock

0
	// Methods 
	@Kroll.method 
	public void disable() { 
		KeyguardManager keyguardManager = (KeyguardManager) super.context
				.getActivity().getSystemService(Activity.KEYGUARD_SERVICE);
		KeyguardLock lock = keyguardManager
				.newKeyguardLock(Activity.KEYGUARD_SERVICE);
		if (lock != null) {
			lock.disableKeyguard();
		} 
	} 
 
	@Kroll.method 
	public void enable() { 
		KeyguardManager keyguardManager = (KeyguardManager) super.context
				.getActivity().getSystemService(Activity.KEYGUARD_SERVICE);
		KeyguardLock lock = keyguardManager
				.newKeyguardLock(Activity.KEYGUARD_SERVICE);
		if (lock != null) {
			lock.reenableKeyguard();
		}