Code example for WifiP2pManager

Methods: clearServiceRequests, stopPeerDiscovery

0
			isServiceRequestRegistered = true;
		} 
	} 
	 
	private void unregisterServiceRequest() { 
		wifiMgr.clearServiceRequests(channel, new TaggedActionListener("clearServiceRequest"));
		isServiceRequestRegistered = false;
	} 
	 
	private void startDiscovery() { 
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
			registerServiceRequest(); 
			wifiMgr.setDnsSdResponseListeners(channel, discoveryListener, null);
			wifiMgr.discoverServices(channel, new TaggedActionListener("discoverService"));
		} else { 
			wifiMgr.discoverPeers(channel, new TaggedActionListener("discoverPeers"));
		} 
	} 
	 
	private void stopDiscovery() { 
		Log.i(TAG, "stop wifi p2p discovery");
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
			wifiMgr.stopPeerDiscovery(channel, new TaggedActionListener("stopPeerDiscovery"));
		} 
	} 
	 
	public void registerService(String serviceName, String serviceType) {
		if (!isEnabled)