Java Code Examples for android.net.wifi.WifiManager.MulticastLock

The following examples show how to use android.net.wifi.WifiManager.MulticastLock. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tilt-game-android   Source File: WifiUtils.java    License: MIT License 5 votes vote down vote up
public static MulticastLock aquireMulticastLock(final Context pContext, final String pMulticastLockName) {
	final WifiManager wifiManager = WifiUtils.getWifiManager(pContext);
	final MulticastLock multicastLock = wifiManager.createMulticastLock(pMulticastLockName);
	multicastLock.setReferenceCounted(true);
	multicastLock.acquire();
	return multicastLock;
}
 
Example 2
Source Project: tilt-game-android   Source File: WifiUtils.java    License: MIT License 4 votes vote down vote up
public static MulticastLock aquireMulticastLock(final Context pContext) {
	return WifiUtils.aquireMulticastLock(pContext, WifiUtils.MULTICASTLOCK_NAME_DEFAULT);
}
 
Example 3
Source Project: tilt-game-android   Source File: WifiUtils.java    License: MIT License 4 votes vote down vote up
public static void releaseMulticastLock(final MulticastLock pMulticastLock) {
	if (pMulticastLock.isHeld()) {
		pMulticastLock.release();
	}
}