Code example for WifiManager.WifiLock

Methods: acquire, isHeld

0
		wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
		wifiLock = wifiManager.createWifiLock("FOOBNIX");
	} 
 
	public void acqire() { 
		if (!wifiLock.isHeld()) {
			wifiLock.acquire();
			LOG.d("Wifi LOCK"); 
		} 
	} 
 
	public void release() { 
		if (wifiLock.isHeld()) {
			wifiLock.release();
			LOG.d("Wifi RELEASE"); 
		} 
	} 
 
	public WifiManager getWifiManager() {
		return wifiManager;