Search in sources :

Example 16 with WifiP2pDevice

use of android.net.wifi.p2p.WifiP2pDevice in project android_frameworks_base by AOSPA.

the class WifiP2pDeviceList method updateSupplicantDetails.

/** Only updates details fetched from the supplicant @hide */
public void updateSupplicantDetails(WifiP2pDevice device) {
    validateDevice(device);
    WifiP2pDevice d = mDevices.get(device.deviceAddress);
    if (d != null) {
        d.deviceName = device.deviceName;
        d.primaryDeviceType = device.primaryDeviceType;
        d.secondaryDeviceType = device.secondaryDeviceType;
        d.wpsConfigMethodsSupported = device.wpsConfigMethodsSupported;
        d.deviceCapability = device.deviceCapability;
        d.groupCapability = device.groupCapability;
        d.wfdInfo = device.wfdInfo;
        return;
    }
    //Not found, add a new one
    mDevices.put(device.deviceAddress, device);
}
Also used : WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice)

Example 17 with WifiP2pDevice

use of android.net.wifi.p2p.WifiP2pDevice in project android_frameworks_base by AOSPA.

the class WifiDisplayController method dump.

@Override
public void dump(PrintWriter pw, String prefix) {
    pw.println("mWifiDisplayOnSetting=" + mWifiDisplayOnSetting);
    pw.println("mWifiP2pEnabled=" + mWifiP2pEnabled);
    pw.println("mWfdEnabled=" + mWfdEnabled);
    pw.println("mWfdEnabling=" + mWfdEnabling);
    pw.println("mNetworkInfo=" + mNetworkInfo);
    pw.println("mScanRequested=" + mScanRequested);
    pw.println("mDiscoverPeersInProgress=" + mDiscoverPeersInProgress);
    pw.println("mDesiredDevice=" + describeWifiP2pDevice(mDesiredDevice));
    pw.println("mConnectingDisplay=" + describeWifiP2pDevice(mConnectingDevice));
    pw.println("mDisconnectingDisplay=" + describeWifiP2pDevice(mDisconnectingDevice));
    pw.println("mCancelingDisplay=" + describeWifiP2pDevice(mCancelingDevice));
    pw.println("mConnectedDevice=" + describeWifiP2pDevice(mConnectedDevice));
    pw.println("mConnectionRetriesLeft=" + mConnectionRetriesLeft);
    pw.println("mRemoteDisplay=" + mRemoteDisplay);
    pw.println("mRemoteDisplayInterface=" + mRemoteDisplayInterface);
    pw.println("mRemoteDisplayConnected=" + mRemoteDisplayConnected);
    pw.println("mAdvertisedDisplay=" + mAdvertisedDisplay);
    pw.println("mAdvertisedDisplaySurface=" + mAdvertisedDisplaySurface);
    pw.println("mAdvertisedDisplayWidth=" + mAdvertisedDisplayWidth);
    pw.println("mAdvertisedDisplayHeight=" + mAdvertisedDisplayHeight);
    pw.println("mAdvertisedDisplayFlags=" + mAdvertisedDisplayFlags);
    pw.println("mAvailableWifiDisplayPeers: size=" + mAvailableWifiDisplayPeers.size());
    for (WifiP2pDevice device : mAvailableWifiDisplayPeers) {
        pw.println("  " + describeWifiP2pDevice(device));
    }
}
Also used : WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice)

Example 18 with WifiP2pDevice

use of android.net.wifi.p2p.WifiP2pDevice in project platform_frameworks_base by android.

the class WifiDisplayController method dump.

@Override
public void dump(PrintWriter pw, String prefix) {
    pw.println("mWifiDisplayOnSetting=" + mWifiDisplayOnSetting);
    pw.println("mWifiP2pEnabled=" + mWifiP2pEnabled);
    pw.println("mWfdEnabled=" + mWfdEnabled);
    pw.println("mWfdEnabling=" + mWfdEnabling);
    pw.println("mNetworkInfo=" + mNetworkInfo);
    pw.println("mScanRequested=" + mScanRequested);
    pw.println("mDiscoverPeersInProgress=" + mDiscoverPeersInProgress);
    pw.println("mDesiredDevice=" + describeWifiP2pDevice(mDesiredDevice));
    pw.println("mConnectingDisplay=" + describeWifiP2pDevice(mConnectingDevice));
    pw.println("mDisconnectingDisplay=" + describeWifiP2pDevice(mDisconnectingDevice));
    pw.println("mCancelingDisplay=" + describeWifiP2pDevice(mCancelingDevice));
    pw.println("mConnectedDevice=" + describeWifiP2pDevice(mConnectedDevice));
    pw.println("mConnectionRetriesLeft=" + mConnectionRetriesLeft);
    pw.println("mRemoteDisplay=" + mRemoteDisplay);
    pw.println("mRemoteDisplayInterface=" + mRemoteDisplayInterface);
    pw.println("mRemoteDisplayConnected=" + mRemoteDisplayConnected);
    pw.println("mAdvertisedDisplay=" + mAdvertisedDisplay);
    pw.println("mAdvertisedDisplaySurface=" + mAdvertisedDisplaySurface);
    pw.println("mAdvertisedDisplayWidth=" + mAdvertisedDisplayWidth);
    pw.println("mAdvertisedDisplayHeight=" + mAdvertisedDisplayHeight);
    pw.println("mAdvertisedDisplayFlags=" + mAdvertisedDisplayFlags);
    pw.println("mAvailableWifiDisplayPeers: size=" + mAvailableWifiDisplayPeers.size());
    for (WifiP2pDevice device : mAvailableWifiDisplayPeers) {
        pw.println("  " + describeWifiP2pDevice(device));
    }
}
Also used : WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice)

Example 19 with WifiP2pDevice

use of android.net.wifi.p2p.WifiP2pDevice in project platform_frameworks_base by android.

the class WifiDisplayController method handleConnectionFailure.

private void handleConnectionFailure(boolean timeoutOccurred) {
    Slog.i(TAG, "Wifi display connection failed!");
    if (mDesiredDevice != null) {
        if (mConnectionRetriesLeft > 0) {
            final WifiP2pDevice oldDevice = mDesiredDevice;
            mHandler.postDelayed(new Runnable() {

                @Override
                public void run() {
                    if (mDesiredDevice == oldDevice && mConnectionRetriesLeft > 0) {
                        mConnectionRetriesLeft -= 1;
                        Slog.i(TAG, "Retrying Wifi display connection.  Retries left: " + mConnectionRetriesLeft);
                        retryConnection();
                    }
                }
            }, timeoutOccurred ? 0 : CONNECT_RETRY_DELAY_MILLIS);
        } else {
            disconnect();
        }
    }
}
Also used : WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice)

Example 20 with WifiP2pDevice

use of android.net.wifi.p2p.WifiP2pDevice in project platform_frameworks_base by android.

the class WifiDisplayController method handleScanResults.

private void handleScanResults() {
    final int count = mAvailableWifiDisplayPeers.size();
    final WifiDisplay[] displays = WifiDisplay.CREATOR.newArray(count);
    for (int i = 0; i < count; i++) {
        WifiP2pDevice device = mAvailableWifiDisplayPeers.get(i);
        displays[i] = createWifiDisplay(device);
        updateDesiredDevice(device);
    }
    mHandler.post(new Runnable() {

        @Override
        public void run() {
            mListener.onScanResults(displays);
        }
    });
}
Also used : WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice) WifiDisplay(android.hardware.display.WifiDisplay)

Aggregations

WifiP2pDevice (android.net.wifi.p2p.WifiP2pDevice)95 Test (org.junit.Test)14 WifiDisplay (android.hardware.display.WifiDisplay)12 Activity (android.app.Activity)7 DialogInterface (android.content.DialogInterface)7 OnClickListener (android.content.DialogInterface.OnClickListener)7 WpsInfo (android.net.wifi.WpsInfo)6 WifiP2pConfig (android.net.wifi.p2p.WifiP2pConfig)6 ActionListener (android.net.wifi.p2p.WifiP2pManager.ActionListener)6 GroupInfoListener (android.net.wifi.p2p.WifiP2pManager.GroupInfoListener)6 PeerListListener (android.net.wifi.p2p.WifiP2pManager.PeerListListener)6 Surface (android.view.Surface)6 ByteArrayInputStream (java.io.ByteArrayInputStream)6 DataInputStream (java.io.DataInputStream)6 IOException (java.io.IOException)6 Inet4Address (java.net.Inet4Address)6 ArrayList (java.util.ArrayList)6 RemoteDisplay (android.media.RemoteDisplay)3 StackTraceElement (java.lang.StackTraceElement)3 ListView (android.widget.ListView)1