Code example for WifiManager.WifiLock

Methods: isHeld, release

0
 
	/** 
	 * 
	 */ 
	public void cleanup() { 
		if (mWifiLock.isHeld())
			mWifiLock.release();
 
		mTerminalManager.unregisterReceiver(this);
	} 
 
	/** 
	 * Increase the number of things using the network. Acquire a Wi-Fi lock 
	 * if necessary. 
	 */ 
	public void incRef() { 
		synchronized (mLock) {
			acquireWifiLockIfNecessaryLocked(); 
 
			mNetworkRef  += 1;
		}