android.net.wifi.p2p.WifiP2pManager.PeerListListener Java Examples

The following examples show how to use android.net.wifi.p2p.WifiP2pManager.PeerListListener. 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 File: WifiDisplayController.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private void requestPeers() {
    mWifiP2pManager.requestPeers(mWifiP2pChannel, new PeerListListener() {
        @Override
        public void onPeersAvailable(WifiP2pDeviceList peers) {
            if (DEBUG) {
                Slog.d(TAG, "Received list of peers.");
            }

            mAvailableWifiDisplayPeers.clear();
            for (WifiP2pDevice device : peers.getDeviceList()) {
                if (DEBUG) {
                    Slog.d(TAG, "  " + describeWifiP2pDevice(device));
                }

                if (isWifiDisplay(device)) {
                    mAvailableWifiDisplayPeers.add(device);
                }
            }

            if (mDiscoverPeersInProgress) {
                handleScanResults();
            }
        }
    });
}
 
Example #2
Source File: CommCareWiFiDirectActivity.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
@Override
public void updatePeers() {
    Logger.log(TAG, "Wi-Fi direct peers updating");
    mManager.requestPeers(mChannel, (PeerListListener)this.getSupportFragmentManager()
            .findFragmentById(R.id.frag_list));

}
 
Example #3
Source File: LeBoxNetworkManager.java    From letv with Apache License 2.0 4 votes vote down vote up
public void requestP2pPeers(PeerListListener peerListListener) {
    LeBoxWifiDirectModel.getInstance().requestPeers(peerListListener);
}