Code example for PowerManager.WakeLock

Methods: isHeld, release

0
    } 
 
    public static void releaseWakelock() 
    { 
    	Log.d(TAG, "releaseWakelock called");
    	if ((screen_on_wakelock != null) && (screen_on_wakelock.isHeld()))
    	{ 
    		screen_on_wakelock.release();
    		screen_on_wakelock = null;
    		Log.d(TAG, "Wakelock " + WAKELOCK + " released");
    	} 
    } 
 
    public static void releaseWifilock() 
    { 
    	Log.d(TAG, "releaseWifilock called");
    	if ((screen_on_wifilock != null) && (screen_on_wifilock.isHeld()))
    	{ 
    		screen_on_wifilock.release();
    		Log.d(TAG, "Wifilock " + WIFILOCK + " released");