Skip to content

Commit 24ed276

Browse files
isheriffAndroid (Google) Code Review
authored andcommitted
Merge "WFD fixes" into jb-mr1-dev
2 parents 00bc4c0 + e0c28d5 commit 24ed276

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
@@ -485,6 +485,8 @@ private void next() {
485485
mConnectingDevice = mDesiredDevice;
486486
WifiP2pConfig config = new WifiP2pConfig();
487487
config.deviceAddress = mConnectingDevice.deviceAddress;
488+
// Helps with STA & P2P concurrency
489+
config.groupOwnerIntent = WifiP2pConfig.MAX_GROUP_OWNER_INTENT;
488490

489491
final WifiDisplay display = createWifiDisplay(mConnectingDevice);
490492
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
private static final int BASE = Protocol.BASE_WIFI_P2P_SERVICE;
141141

@@ -1212,13 +1212,10 @@ public boolean processMessage(Message message) {
12121212
mGroup.getNetworkName()));
12131213
}
12141214

1215+
mWifiNative.setP2pGroupIdle(mGroup.getInterface(), GROUP_IDLE_TIME_S);
12151216
if (mGroup.isGroupOwner()) {
12161217
startDhcpServer(mGroup.getInterface());
12171218
} else {
1218-
// Set group idle only for a client on the group interface to speed up
1219-
// disconnect when GO is gone. Setting group idle time for a group owner
1220-
// causes connectivity issues for new clients
1221-
mWifiNative.setP2pGroupIdle(mGroup.getInterface(), GROUP_IDLE_TIME_S);
12221219
mDhcpStateMachine = DhcpStateMachine.makeDhcpStateMachine(mContext,
12231220
P2pStateMachine.this, mGroup.getInterface());
12241221
mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP);
@@ -1283,7 +1280,6 @@ public void enter() {
12831280
//DHCP server has already been started if I am a group owner
12841281
if (mGroup.isGroupOwner()) {
12851282
setWifiP2pInfoOnGroupFormation(SERVER_ADDRESS);
1286-
sendP2pConnectionChangedBroadcast();
12871283
}
12881284
}
12891285

@@ -1306,6 +1302,7 @@ public boolean processMessage(Message message) {
13061302
} else {
13071303
loge("Connect on null device address, ignore");
13081304
}
1305+
sendP2pConnectionChangedBroadcast();
13091306
break;
13101307
case WifiMonitor.AP_STA_DISCONNECTED_EVENT:
13111308
device = (WifiP2pDevice) message.obj;

0 commit comments

Comments
 (0)