public void deinit() { mContext.unregisterReceiver(mNFGameBroadcastReceiver); mWifiP2pManager.clearLocalServices(mChannel, new NFGameActionListener("clearLocalServices")); mWifiP2pManager.clearServiceRequests(mChannel, new NFGameActionListener("clearServiceRequests")); stopPeerDiscovery(); mWifiP2pManager.cancelConnect(mChannel, new NFGameActionListener("cancelConnect")); mWifiP2pManager.removeGroup(mChannel, new NFGameActionListener("removeGroup")); if (mNetId != -1) { try { Method deletePersistentGroup = mWifiP2pManager.getClass().getMethod("deletePersistentGroup", Channel.class, int.class, ActionListener.class); deletePersistentGroup.setAccessible(true); deletePersistentGroup.invoke(mWifiP2pManager, mChannel, mNetId, new NFGameActionListener("deletePersistentGroup")); } catch (Exception e) { e.printStackTrace(); } } }
/** * @param manager * WifiP2pManager system service * @param channel * WifiP2pChannel being listened on * @param activity * Activity associated with the receiver */ public AperiBroadcastReceiver(WifiP2pManager manager, Channel channel, AperiMainActivity activity) { super(); if (manager == null) { throw new IllegalArgumentException("manager is null"); } else if (channel == null) { throw new IllegalArgumentException("channel is null"); } else if (activity == null) { throw new IllegalArgumentException("activity is null"); } else { mManager = manager; mChannel = channel; mActivity = activity; } }
/** * @param manager WifiP2pManager system service * @param channel Wifi p2p channel * @param wfd wfd associated with the receiver */ public WiFiDirectBroadcastReceiver(WifiP2pManager manager, Channel channel, WiFiDirect wfd) { super(); this.manager = manager; this.channel = channel; this.wfd = wfd; connector = wfd.connector; communicator = wfd.communicator; }
/** * @param manager WifiP2pManager system service * @param channel Wifi p2p channel * @param activity activity associated with the receiver */ public WiFiDirectBroadcastReceiver(WifiP2pManager manager, Channel channel, WiFiDirectBroadcastListener listener) { super(); this.manager = manager; this.channel = channel; this.listener = listener; }
/** * @param manager WifiP2pManager system service * @param channel Wifi p2p channel * @param activity activity associated with the receiver */ public WiFiDirectBroadcastReceiver(WifiP2pManager manager, Channel channel, WiFiDirectActivity activity) { super(); this.manager = manager; this.channel = channel; this.activity = activity; }
/** * @param manager WifiP2pManager system service * @param channel Wifi p2p channel * @param activity activity associated with the receiver */ public WiFiDirectBroadcastReceiver(WifiP2pManager manager, Channel channel, Activity activity) { super(); this.manager = manager; this.channel = channel; this.activity = activity; }
/** Constructor */ public WiFiDirectBroadcastReceiver(WifiP2pManager manager, Channel channel, TransferActivity activity) { super(); this.manager = manager; this.channel = channel; this.activity = activity; }
public BlaubotWifiP2PAdapter(BlaubotUUIDSet uuidSet, WifiP2pManager manager, WifiManager wifiManager, Channel acceptorChannel) { this.uuidSet = uuidSet; this.wifiP2pManager = manager; this.wifiManager = wifiManager; this.acceptorWifiChannel = acceptorChannel; this.knownDevices = new HashSet<>(); this.blaubotWifiP2PBroadcastReceiver = new BlaubotWifiP2PBroadcastReceiver(manager, acceptorChannel); this.acceptor = new BlaubotWifiP2PAcceptor(this); this.connector = new BlaubotWifiP2PConnector(this); this.connectionStateMachineConfig = new ConnectionStateMachineConfig(); this.adapterConfig = new BlaubotAdapterConfig(); ConnectionStateMachineConfig.validateTimeouts(connectionStateMachineConfig, adapterConfig); }
/** * The string that we exploit to pre-filter upnp devices before we probe them if they are really a * blaubot beacon. * @param wifiP2pManager android's wifi p2p manager service * @param beaconChannel the wifi p2p channel to be used for this beacon * @param beaconPort the tcp port for this beacon to listen on */ public BlaubotWifiP2PBeacon(WifiP2pManager wifiP2pManager, Channel beaconChannel, int beaconPort) { this.beaconPort = beaconPort; this.knownActiveDevices = Collections.newSetFromMap(new ConcurrentHashMap<BlaubotWifiP2PDevice, Boolean>()); this.wifiP2pManager = wifiP2pManager; this.wifiP2pBeaconChannel = beaconChannel; this.wifiP2pBroadcastReceiver = new BlaubotWifiP2PBroadcastReceiver(wifiP2pManager, beaconChannel); this.wifiP2pBroadcastReceiver.addEventListener(wifiDirectEventListener); this.bonjourListener = new BonjourListener(); this.upnpListener = new UPNPListener(); this.wifiP2pManager.setDnsSdResponseListeners(beaconChannel, bonjourListener, bonjourListener); this.wifiP2pManager.setUpnpServiceResponseListener(wifiP2pBeaconChannel, upnpListener); }
public WiFiDirectBroadcastReceiver(WifiP2pManager manager, WifiP2pManager.Channel channel, ConnectService service) { super(); this.manager = manager; this.channel = channel; this.service = service; this.infoListener = new InfoActionListener("Discovery Initiated", "Discovery Failed", service); this.peersUpdater = new PeersListUpdater(service); this.connInfo = new ConnectionInfo(service); }
public WiFiDirectBroadcastReceiver(WifiP2pManager manager, WifiP2pManager.Channel channel, StartActivity activity) { super(); this.manager = manager; this.channel = channel; this.activity = activity; this.infoListener = new InfoActionListener("Discovery Initiated", "Discovery Failed", activity); this.peersUpdater = new PeersListUpdater(activity); this.connInfo = new ConnectionInfo(activity); }
public SynCarnetBroadcastReceiver(WifiP2pManager manager, Channel channel, SynCarnet synCarnet, Boolean displayPeers) { super(); this.manager = manager; this.channel = channel; this.synCarnet = synCarnet; this.peerList = new PeerList(synCarnet, manager, channel, displayPeers); this.displayPeers = displayPeers; }
public PeerList(SynCarnet synCarnet, WifiP2pManager manager, Channel channel, Boolean display) { this.peerList = new ArrayList<WifiP2pDevice>(); this.synCarnet = synCarnet; this.manager = manager; this.channel = channel; this.intent = intent; this.peerSelection = new PeerSelection(manager, channel, synCarnet); this.peerListDialog = new PeerListDialog(peerList, peerSelection); this.display = display; }
private void setupWifiDirect() { WifiP2pManager manager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); Channel channel = manager.initialize(this, getMainLooper(), null); wifi = new WifiDirectManager(manager, channel, this, this); wifi.addLocalService(ChatActivity.getInstanceName(), ChatActivity.getRegistrationType(), ChatActivity.getRecords()); wifi.addLocalService("LaserWriter 8500", "_printer._tcp", null); }
/** * Constructor * * @param WifiP2pManager manager * @param WifiP2pManager.Channel channel */ public WifiBroadcastReceiver(WifiP2pManager manager, Channel channel) { super(); this.wifiP2pManager = manager; this.wifiP2pChannel = channel; }
public WiFiDirectBroadcastReceiver(WifiP2pManager manager, Channel channel, MainActivity activity) { super(); this.mManager = manager; this.mChannel = channel; this.mActivity = activity; }
public WiFiDirectBroadcastReceiver(WifiP2pManager manager, Channel channel, FetchingFragment fetcher) { super(); this.manager = manager; this.channel = channel; this.fetcher = fetcher; }
public WifiDirectBroadcastReceiver(WifiP2pManager mManager, Channel mChannel, WifiDirectService wifiDirectService) { super(); this.mManager = mManager; this.mChannel = mChannel; this.wifiDirectService = wifiDirectService; }
/** * @param manager WifiP2pManager system service * @param channel Wifi p2p channel * @param activity activity associated with the receiver */ public WiFiDirectBroadcastReceiver(final WifiP2pManager manager, final Channel channel, final Service service) { super(); mP2pManager = manager; mChannel = channel; mService = service; }
public WifiDirectReceiver(WifiP2pManager manager,Channel channel,WiFiDirectActivity activity){ super(); this.mActivity = activity; this.mChannel = channel; this.mManager = manager; }
public WiFiBroadcastReceiver(WifiP2pManager manager, Channel channel, WifiClient service) { super(); this.manager = manager; this.channel = channel; this.service1 = service; }
public WiFiBroadcastReceiver(WifiP2pManager manager, Channel channel, WifiServer service) { super(); this.manager = manager; this.channel = channel; this.service2 = service; }
public WirelessBroadcastReceiver(WifiP2pManager wifiManager, Channel channel, Context context) { this.wifiP2PManager = wifiManager; this.mChannel = channel; this.context = context; }
public WDBroadcastReceiver(WifiP2pManager manager, Channel channel, WDManager wdManager) { this.p2pManager = manager; this.p2pChannel = channel; this.wdManager = wdManager; }
protected Channel getAcceptorWifiChannel() { return acceptorWifiChannel; }
public void startReceiver(WifiP2pManager mManager, Channel mChannel) { Logger.log(TAG, "Starting receiver"); this.mChannel = mChannel; this.mManager = mManager; }
public PeerSelection(WifiP2pManager manager, Channel channel, SynCarnet synCarnet) { this.manager = manager; this.channel = channel; this.synCarnet = synCarnet; this.progressDialog = this.synCarnet.syncService.getProgressDialog(); }
public SyncService(SynCarnet synCarnet, WifiP2pManager manager, Channel channel, BluetoothAdapter mBluetoothAdapter) { this.synCarnet = synCarnet; this.manager = manager; this.channel = channel; this.mBluetoothAdapter = mBluetoothAdapter; }
/** * Adds the Actions for the WifiP2pManager to IntentFilter and stores Manager and Channel * @param manager * @param channel * @param responseListener * @param connListener */ public WifiDirectManager(WifiP2pManager manager, Channel channel, final DnsSdResponseListener responseListener, ConnectionInfoListener connListener){ intentFilter = new IntentFilter(); intentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION); this.manager = manager; this.channel = channel; this.connectionInfoListener = connListener; setupDnsSdResponseListeners(responseListener); setupDnsSdServiceRequest(); }
/** * The needed {@link WifiP2pManager} and {@link Channel} can be retrieved like this: * mManager = (WifiP2pManager) context.getSystemService(Context.WIFI_P2P_SERVICE); * mChannel = mManager.initialize(context, context.getMainLooper(), null); * * @param manager the {@link WifiP2pManager} manager instace * @param channel the channel */ public BlaubotWifiP2PBroadcastReceiver(WifiP2pManager manager, Channel channel) { super(); this.mManager = manager; this.mChannel = channel; this.eventListeners = new CopyOnWriteArrayList<BlaubotWifiP2PBroadcastReceiver.IBlaubotWifiDirectEventListener>(); }
/** * get wifi direct framework channel * @return channel object */ public Channel getChannel() { return channel; }