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();
}
}
}
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();
}
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;
}
}
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();
}
Aggregations