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