Code example for KeyguardManager.KeyguardLock

Methods: disableKeyguard

	// just acquiring the WakeLock is not enough when a keyguard is on 
	public static void disableKeyguard(Context context){
		Log.v(tag, "Disabling keyduard - will be reenabled later when this process has died");
		KeyguardManager km = (KeyguardManager)context.getSystemService(Context.KEYGUARD_SERVICE);
		KeyguardLock klock = km.newKeyguardLock(tag);
		klock.disableKeyguard(); // will be re-enabled when this process has died
	 * wake up the device when starting an app after an application request from the other side 
	public static void wakeUpIfNeeded(Context context, Handler poster) {
		PowerManager pm = (PowerManager) context
		if (pm.isScreenOn()) {
			Log.i(tag, "Screen is on, nothing needs to be done");
		} else { 
			Log.i(tag, "Screen is off, will wake the device up now!");