@@ -1944,6 +1944,7 @@ public boolean processMessage(Message message) {
19441944 case CMD_STOP_DRIVER :
19451945 case CMD_DELAYED_STOP_DRIVER :
19461946 case CMD_DRIVER_START_TIMED_OUT :
1947+ case CMD_CAPTIVE_CHECK_COMPLETE :
19471948 case CMD_START_AP :
19481949 case CMD_START_AP_SUCCESS :
19491950 case CMD_START_AP_FAILURE :
@@ -2189,6 +2190,13 @@ public boolean processMessage(Message message) {
21892190 loge ("Unable to change interface settings: " + ie );
21902191 }
21912192
2193+ /* Stop a running supplicant after a runtime restart
2194+ * Avoids issues with drivers that do not handle interface down
2195+ * on a running supplicant properly.
2196+ */
2197+ if (DBG ) log ("Kill any running supplicant" );
2198+ mWifiNative .killSupplicant (mP2pSupported );
2199+
21922200 if (mWifiNative .startSupplicant (mP2pSupported )) {
21932201 if (DBG ) log ("Supplicant start successful" );
21942202 mWifiMonitor .startMonitoring ();
@@ -2384,7 +2392,7 @@ public boolean processMessage(Message message) {
23842392 case WifiMonitor .SUP_DISCONNECTION_EVENT :
23852393 if (++mSupplicantRestartCount <= SUPPLICANT_RESTART_TRIES ) {
23862394 loge ("Failed to setup control channel, restart supplicant" );
2387- mWifiNative .killSupplicant ();
2395+ mWifiNative .killSupplicant (mP2pSupported );
23882396 transitionTo (mDriverLoadedState );
23892397 sendMessageDelayed (CMD_START_SUPPLICANT , SUPPLICANT_RESTART_INTERVAL_MSECS );
23902398 } else {
@@ -2451,7 +2459,7 @@ public boolean processMessage(Message message) {
24512459 break ;
24522460 case WifiMonitor .SUP_DISCONNECTION_EVENT : /* Supplicant connection lost */
24532461 loge ("Connection lost, restart supplicant" );
2454- mWifiNative .killSupplicant ();
2462+ mWifiNative .killSupplicant (mP2pSupported );
24552463 mWifiNative .closeSupplicantConnection ();
24562464 mNetworkInfo .setIsAvailable (false );
24572465 handleNetworkDisconnect ();
@@ -2605,14 +2613,14 @@ public boolean processMessage(Message message) {
26052613 /* Socket connection can be lost when we do a graceful shutdown
26062614 * or when the driver is hung. Ensure supplicant is stopped here.
26072615 */
2608- mWifiNative .killSupplicant ();
2616+ mWifiNative .killSupplicant (mP2pSupported );
26092617 mWifiNative .closeSupplicantConnection ();
26102618 transitionTo (mDriverLoadedState );
26112619 break ;
26122620 case CMD_STOP_SUPPLICANT_FAILED :
26132621 if (message .arg1 == mSupplicantStopFailureToken ) {
26142622 loge ("Timed out on a supplicant stop, kill and proceed" );
2615- mWifiNative .killSupplicant ();
2623+ mWifiNative .killSupplicant (mP2pSupported );
26162624 mWifiNative .closeSupplicantConnection ();
26172625 transitionTo (mDriverLoadedState );
26182626 }
0 commit comments