Code example for KeyguardManager.KeyguardLock

Methods: reenableKeyguard

0
		KeyguardManager keyguardManager = (KeyguardManager) super.context
				.getActivity().getSystemService(Activity.KEYGUARD_SERVICE);
		KeyguardLock lock = keyguardManager
				.newKeyguardLock(Activity.KEYGUARD_SERVICE);
		if (lock != null) {
			lock.reenableKeyguard();
		} 
	} 
 
	@Kroll.method 
	public void wakeUp() { 
		PowerManager pm = (PowerManager) super.context
		.getActivity().getSystemService(Context.POWER_SERVICE);
		PowerManager.WakeLock wl = pm.newWakeLock(
				PowerManager.SCREEN_DIM_WAKE_LOCK | // could use bright instead
						PowerManager.ACQUIRE_CAUSES_WAKEUP | // so we actually
																// wake the 
																// device 
						PowerManager.ON_AFTER_RELEASE // and we keep it on for a
														// bit after release 
Experience pair programming with AI  Get Codota for Java