use of android.net.wifi.p2p.WifiP2pWfdInfo in project android_frameworks_base by ParanoidAndroid.
the class WifiDisplayController method updateWfdEnableState.
private void updateWfdEnableState() {
if (mWifiDisplayOnSetting && mWifiP2pEnabled) {
// WFD should be enabled.
if (!mWfdEnabled && !mWfdEnabling) {
mWfdEnabling = true;
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(true);
wfdInfo.setDeviceType(WifiP2pWfdInfo.WFD_SOURCE);
wfdInfo.setSessionAvailable(true);
wfdInfo.setControlPort(DEFAULT_CONTROL_PORT);
wfdInfo.setMaxThroughput(MAX_THROUGHPUT);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
if (mWfdEnabling) {
mWfdEnabling = false;
mWfdEnabled = true;
reportFeatureState();
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
mWfdEnabling = false;
}
});
}
} else {
// WFD should be disabled.
mWfdEnabling = false;
mWfdEnabled = false;
reportFeatureState();
disconnect();
}
}
use of android.net.wifi.p2p.WifiP2pWfdInfo in project platform_frameworks_base by android.
the class WifiDisplayController method updateWfdEnableState.
private void updateWfdEnableState() {
if (mWifiDisplayOnSetting && mWifiP2pEnabled) {
// WFD should be enabled.
if (!mWfdEnabled && !mWfdEnabling) {
mWfdEnabling = true;
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(true);
wfdInfo.setDeviceType(WifiP2pWfdInfo.WFD_SOURCE);
wfdInfo.setSessionAvailable(true);
wfdInfo.setControlPort(DEFAULT_CONTROL_PORT);
wfdInfo.setMaxThroughput(MAX_THROUGHPUT);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
if (mWfdEnabling) {
mWfdEnabling = false;
mWfdEnabled = true;
reportFeatureState();
updateScanState();
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
mWfdEnabling = false;
}
});
}
} else {
// WFD should be disabled.
if (mWfdEnabled || mWfdEnabling) {
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(false);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
}
});
}
mWfdEnabling = false;
mWfdEnabled = false;
reportFeatureState();
updateScanState();
disconnect();
}
}
use of android.net.wifi.p2p.WifiP2pWfdInfo in project android_frameworks_base by AOSPA.
the class WifiDisplayController method updateWfdEnableState.
private void updateWfdEnableState() {
if (mWifiDisplayOnSetting && mWifiP2pEnabled) {
// WFD should be enabled.
if (!mWfdEnabled && !mWfdEnabling) {
mWfdEnabling = true;
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(true);
wfdInfo.setDeviceType(WifiP2pWfdInfo.WFD_SOURCE);
wfdInfo.setSessionAvailable(true);
wfdInfo.setControlPort(DEFAULT_CONTROL_PORT);
wfdInfo.setMaxThroughput(MAX_THROUGHPUT);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
if (mWfdEnabling) {
mWfdEnabling = false;
mWfdEnabled = true;
reportFeatureState();
updateScanState();
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
mWfdEnabling = false;
}
});
}
} else {
// WFD should be disabled.
if (mWfdEnabled || mWfdEnabling) {
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(false);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
}
});
}
mWfdEnabling = false;
mWfdEnabled = false;
reportFeatureState();
updateScanState();
disconnect();
}
}
use of android.net.wifi.p2p.WifiP2pWfdInfo in project android_frameworks_base by ResurrectionRemix.
the class WifiDisplayController method updateWfdEnableState.
private void updateWfdEnableState() {
if (mWifiDisplayOnSetting && mWifiP2pEnabled) {
// WFD should be enabled.
if (!mWfdEnabled && !mWfdEnabling) {
mWfdEnabling = true;
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(true);
wfdInfo.setDeviceType(WifiP2pWfdInfo.WFD_SOURCE);
wfdInfo.setSessionAvailable(true);
wfdInfo.setControlPort(DEFAULT_CONTROL_PORT);
wfdInfo.setMaxThroughput(MAX_THROUGHPUT);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
if (mWfdEnabling) {
mWfdEnabling = false;
mWfdEnabled = true;
reportFeatureState();
updateScanState();
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
mWfdEnabling = false;
}
});
}
} else {
// WFD should be disabled.
if (mWfdEnabled || mWfdEnabling) {
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(false);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
}
});
}
mWfdEnabling = false;
mWfdEnabled = false;
reportFeatureState();
updateScanState();
disconnect();
}
}
use of android.net.wifi.p2p.WifiP2pWfdInfo in project android_frameworks_base by DirtyUnicorns.
the class WifiDisplayController method updateWfdEnableState.
private void updateWfdEnableState() {
if (mWifiDisplayOnSetting && mWifiP2pEnabled) {
// WFD should be enabled.
if (!mWfdEnabled && !mWfdEnabling) {
mWfdEnabling = true;
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(true);
wfdInfo.setDeviceType(WifiP2pWfdInfo.WFD_SOURCE);
wfdInfo.setSessionAvailable(true);
wfdInfo.setControlPort(DEFAULT_CONTROL_PORT);
wfdInfo.setMaxThroughput(MAX_THROUGHPUT);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
if (mWfdEnabling) {
mWfdEnabling = false;
mWfdEnabled = true;
reportFeatureState();
updateScanState();
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
mWfdEnabling = false;
}
});
}
} else {
// WFD should be disabled.
if (mWfdEnabled || mWfdEnabling) {
WifiP2pWfdInfo wfdInfo = new WifiP2pWfdInfo();
wfdInfo.setWfdEnabled(false);
mWifiP2pManager.setWFDInfo(mWifiP2pChannel, wfdInfo, new ActionListener() {
@Override
public void onSuccess() {
if (DEBUG) {
Slog.d(TAG, "Successfully set WFD info.");
}
}
@Override
public void onFailure(int reason) {
if (DEBUG) {
Slog.d(TAG, "Failed to set WFD info with reason " + reason + ".");
}
}
});
}
mWfdEnabling = false;
mWfdEnabled = false;
reportFeatureState();
updateScanState();
disconnect();
}
}
Aggregations