@@ -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