Skip to content

Commit e0c28d5

Browse files
committed
WFD fixes
- Specificy max GO intent for WFD - Increase GO idle time out to 20s and use it for GO and client - Fix connection broadcast Change-Id: Ia0e28bc9eb3e23d2830a6c814c5a537ca0bcd5db
1 parent 61e8180 commit e0c28d5

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

services/java/com/android/server/display/WifiDisplayController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ private void next() {
483483
mConnectingDevice = mDesiredDevice;
484484
WifiP2pConfig config = new WifiP2pConfig();
485485
config.deviceAddress = mConnectingDevice.deviceAddress;
486+
// Helps with STA & P2P concurrency
487+
config.groupOwnerIntent = WifiP2pConfig.MAX_GROUP_OWNER_INTENT;
486488

487489
final WifiDisplay display = createWifiDisplay(mConnectingDevice);
488490
mHandler.post(new Runnable() {

wifi/java/android/net/wifi/p2p/WifiP2pConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public class WifiP2pConfig implements Parcelable {
3737
*/
3838
public WpsInfo wps;
3939

40+
/** @hide */
41+
public static final int MAX_GROUP_OWNER_INTENT = 15;
42+
4043
/**
4144
* This is an integer value between 0 and 15 where 0 indicates the least
4245
* inclination to be a group owner and 15 indicates the highest inclination

wifi/java/android/net/wifi/p2p/WifiP2pService.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
135135
private static final int DISCOVER_TIMEOUT_S = 120;
136136

137137
/* Idle time after a peer is gone when the group is torn down */
138-
private static final int GROUP_IDLE_TIME_S = 5;
138+
private static final int GROUP_IDLE_TIME_S = 20;
139139

140140
/**
141141
* Delay between restarts upon failure to setup connection with supplicant
@@ -1221,13 +1221,10 @@ public boolean processMessage(Message message) {
12211221
mGroup.getNetworkName()));
12221222
}
12231223

1224+
mWifiNative.setP2pGroupIdle(mGroup.getInterface(), GROUP_IDLE_TIME_S);
12241225
if (mGroup.isGroupOwner()) {
12251226
startDhcpServer(mGroup.getInterface());
12261227
} else {
1227-
// Set group idle only for a client on the group interface to speed up
1228-
// disconnect when GO is gone. Setting group idle time for a group owner
1229-
// causes connectivity issues for new clients
1230-
mWifiNative.setP2pGroupIdle(mGroup.getInterface(), GROUP_IDLE_TIME_S);
12311228
mDhcpStateMachine = DhcpStateMachine.makeDhcpStateMachine(mContext,
12321229
P2pStateMachine.this, mGroup.getInterface());
12331230
mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP);
@@ -1292,7 +1289,6 @@ public void enter() {
12921289
//DHCP server has already been started if I am a group owner
12931290
if (mGroup.isGroupOwner()) {
12941291
setWifiP2pInfoOnGroupFormation(SERVER_ADDRESS);
1295-
sendP2pConnectionChangedBroadcast();
12961292
}
12971293
}
12981294

@@ -1315,6 +1311,7 @@ public boolean processMessage(Message message) {
13151311
} else {
13161312
loge("Connect on null device address, ignore");
13171313
}
1314+
sendP2pConnectionChangedBroadcast();
13181315
break;
13191316
case WifiMonitor.AP_STA_DISCONNECTED_EVENT:
13201317
device = (WifiP2pDevice) message.obj;

0 commit comments

Comments
 (0)