Search in sources :

Example 76 with WifiP2pDevice

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

the class WifiDisplayController method dump.

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

Example 77 with WifiP2pDevice

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

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 78 with WifiP2pDevice

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

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 79 with WifiP2pDevice

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

the class WifiDisplayController method retryConnection.

private void retryConnection() {
    // Cheap hack.  Make a new instance of the device object so that we
    // can distinguish it from the previous connection attempt.
    // This will cause us to tear everything down before we try again.
    mDesiredDevice = new WifiP2pDevice(mDesiredDevice);
    updateConnection();
}
Also used : WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice)

Example 80 with WifiP2pDevice

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

the class WifiP2pDeviceList method updateGroupCapability.

/** @hide */
public void updateGroupCapability(String deviceAddress, int groupCapab) {
    validateDeviceAddress(deviceAddress);
    WifiP2pDevice d = mDevices.get(deviceAddress);
    if (d != null) {
        d.groupCapability = groupCapab;
    }
}
Also used : WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice)

Aggregations

WifiP2pDevice (android.net.wifi.p2p.WifiP2pDevice)101 Test (org.junit.Test)18 WifiDisplay (android.hardware.display.WifiDisplay)12 ArrayList (java.util.ArrayList)8 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 RemoteDisplay (android.media.RemoteDisplay)3 StackTraceElement (java.lang.StackTraceElement)3 WifiP2pDeviceList (android.net.wifi.p2p.WifiP2pDeviceList)2