[frameworks/opt/net/wifi] add for wfd function
This commit is contained in:
@ -8295,7 +8295,7 @@ public class WifiStateMachine extends StateMachine {
|
||||
// not be processed) and restart the scan
|
||||
int period = mDisconnectedScanPeriodMs;
|
||||
if (mP2pConnected.get()) {
|
||||
long defaultInterval = 1800000;
|
||||
long defaultInterval = 4800000;
|
||||
period = (int)Settings.Global.getLong(mContext.getContentResolver(),
|
||||
Settings.Global.WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS,
|
||||
defaultInterval);
|
||||
|
||||
@ -187,6 +187,7 @@ public final class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
|
||||
private final boolean mP2pSupported;
|
||||
|
||||
private WifiP2pDevice mThisDevice = new WifiP2pDevice();
|
||||
private WifiP2pDevice mConnectedDevice;
|
||||
|
||||
/* When a group has been explicitly created by an app, we persist the group
|
||||
* even after all clients have been disconnected until an explicit remove
|
||||
@ -1665,7 +1666,8 @@ public final class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
|
||||
WifiP2pDevice groupOwner = mGroup.getOwner();
|
||||
WifiP2pDevice peer = mPeers.get(groupOwner.deviceAddress);
|
||||
if (peer != null) {
|
||||
// update group owner details with peer details found at discovery
|
||||
mConnectedDevice = groupOwner;
|
||||
// update group owner details with peer details found at discovery
|
||||
groupOwner.updateSupplicantDetails(peer);
|
||||
mPeers.updateStatus(groupOwner.deviceAddress, WifiP2pDevice.CONNECTED);
|
||||
sendPeersChangedBroadcast();
|
||||
@ -1869,7 +1871,8 @@ public final class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
|
||||
}
|
||||
mPeers.updateStatus(deviceAddress, WifiP2pDevice.CONNECTED);
|
||||
if (DBG) logd(getName() + " ap sta connected");
|
||||
sendPeersChangedBroadcast();
|
||||
mConnectedDevice = device;
|
||||
sendPeersChangedBroadcast();
|
||||
} else {
|
||||
loge("Connect on null device address, ignore");
|
||||
}
|
||||
@ -2196,7 +2199,8 @@ public final class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
|
||||
intent.putExtra(WifiP2pManager.EXTRA_WIFI_P2P_INFO, new WifiP2pInfo(mWifiP2pInfo));
|
||||
intent.putExtra(WifiP2pManager.EXTRA_NETWORK_INFO, new NetworkInfo(mNetworkInfo));
|
||||
intent.putExtra(WifiP2pManager.EXTRA_WIFI_P2P_GROUP, new WifiP2pGroup(mGroup));
|
||||
mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
|
||||
intent.putExtra(WifiP2pManager.EXTRA_WIFI_P2P_DEVICE, new WifiP2pDevice(mConnectedDevice));
|
||||
mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
|
||||
mWifiChannel.sendMessage(WifiP2pServiceImpl.P2P_CONNECTION_CHANGED,
|
||||
new NetworkInfo(mNetworkInfo));
|
||||
}
|
||||
@ -2711,7 +2715,7 @@ public final class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
|
||||
mWifiNative.setDeviceType(mThisDevice.primaryDeviceType);
|
||||
// Supplicant defaults to using virtual display with display
|
||||
// which refers to a remote display. Use physical_display
|
||||
mWifiNative.setConfigMethods("virtual_push_button physical_display keypad");
|
||||
mWifiNative.setConfigMethods("virtual_push_button");
|
||||
// STA has higher priority over P2P
|
||||
mWifiNative.setConcurrencyPriority("sta");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user