Search in sources :

Example 66 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 67 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 68 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)

Example 69 with WifiP2pDevice

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

the class WifiP2pDeviceList method isGroupOwner.

/** @hide */
public boolean isGroupOwner(String deviceAddress) {
    validateDeviceAddress(deviceAddress);
    WifiP2pDevice device = mDevices.get(deviceAddress);
    if (device == null) {
        throw new IllegalArgumentException("Device not found " + deviceAddress);
    }
    return device.isGroupOwner();
}
Also used : WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice)

Aggregations

WifiP2pDevice (android.net.wifi.p2p.WifiP2pDevice)69 WifiDisplay (android.hardware.display.WifiDisplay)12 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 Activity (android.app.Activity)1 DialogInterface (android.content.DialogInterface)1 OnClickListener (android.content.DialogInterface.OnClickListener)1 Preference (android.support.v7.preference.Preference)1 PreferenceCategory (android.support.v7.preference.PreferenceCategory)1