Loading core/java/android/net/DhcpStateMachine.java +2 −0 Original line number Diff line number Diff line Loading @@ -351,6 +351,8 @@ public class DhcpStateMachine extends StateMachine { DhcpInfoInternal dhcpInfoInternal = new DhcpInfoInternal(); if (dhcpAction == DhcpAction.START) { /* Stop any existing DHCP daemon before starting new */ NetworkUtils.stopDhcp(mInterfaceName); if (DBG) Log.d(TAG, "DHCP request on " + mInterfaceName); success = NetworkUtils.runDhcp(mInterfaceName, dhcpInfoInternal); mDhcpInfo = dhcpInfoInternal; Loading core/jni/android_net_wifi_Wifi.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -122,9 +122,9 @@ static jboolean android_net_wifi_startSupplicant(JNIEnv* env, jobject, jboolean return (jboolean)(::wifi_start_supplicant(p2pSupported) == 0); } static jboolean android_net_wifi_killSupplicant(JNIEnv* env, jobject) static jboolean android_net_wifi_killSupplicant(JNIEnv* env, jobject, jboolean p2pSupported) { return (jboolean)(::wifi_stop_supplicant() == 0); return (jboolean)(::wifi_stop_supplicant(p2pSupported) == 0); } static jboolean android_net_wifi_connectToSupplicant(JNIEnv* env, jobject, jstring jIface) Loading Loading @@ -204,7 +204,7 @@ static JNINativeMethod gWifiMethods[] = { { "isDriverLoaded", "()Z", (void *)android_net_wifi_isDriverLoaded }, { "unloadDriver", "()Z", (void *)android_net_wifi_unloadDriver }, { "startSupplicant", "(Z)Z", (void *)android_net_wifi_startSupplicant }, { "killSupplicant", "()Z", (void *)android_net_wifi_killSupplicant }, { "killSupplicant", "(Z)Z", (void *)android_net_wifi_killSupplicant }, { "connectToSupplicant", "(Ljava/lang/String;)Z", (void *)android_net_wifi_connectToSupplicant }, { "closeSupplicantConnection", "(Ljava/lang/String;)V", Loading wifi/java/android/net/wifi/WifiNative.java +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public class WifiNative { /* Sends a kill signal to supplicant. To be used when we have lost connection or when the supplicant is hung */ public native static boolean killSupplicant(); public native static boolean killSupplicant(boolean p2pSupported); private native boolean connectToSupplicant(String iface); Loading wifi/java/android/net/wifi/WifiStateMachine.java +12 −4 Original line number Diff line number Diff line Loading @@ -1944,6 +1944,7 @@ public class WifiStateMachine extends StateMachine { case CMD_STOP_DRIVER: case CMD_DELAYED_STOP_DRIVER: case CMD_DRIVER_START_TIMED_OUT: case CMD_CAPTIVE_CHECK_COMPLETE: case CMD_START_AP: case CMD_START_AP_SUCCESS: case CMD_START_AP_FAILURE: Loading Loading @@ -2189,6 +2190,13 @@ public class WifiStateMachine extends StateMachine { loge("Unable to change interface settings: " + ie); } /* Stop a running supplicant after a runtime restart * Avoids issues with drivers that do not handle interface down * on a running supplicant properly. */ if (DBG) log("Kill any running supplicant"); mWifiNative.killSupplicant(mP2pSupported); if(mWifiNative.startSupplicant(mP2pSupported)) { if (DBG) log("Supplicant start successful"); mWifiMonitor.startMonitoring(); Loading Loading @@ -2384,7 +2392,7 @@ public class WifiStateMachine extends StateMachine { case WifiMonitor.SUP_DISCONNECTION_EVENT: if (++mSupplicantRestartCount <= SUPPLICANT_RESTART_TRIES) { loge("Failed to setup control channel, restart supplicant"); mWifiNative.killSupplicant(); mWifiNative.killSupplicant(mP2pSupported); transitionTo(mDriverLoadedState); sendMessageDelayed(CMD_START_SUPPLICANT, SUPPLICANT_RESTART_INTERVAL_MSECS); } else { Loading Loading @@ -2451,7 +2459,7 @@ public class WifiStateMachine extends StateMachine { break; case WifiMonitor.SUP_DISCONNECTION_EVENT: /* Supplicant connection lost */ loge("Connection lost, restart supplicant"); mWifiNative.killSupplicant(); mWifiNative.killSupplicant(mP2pSupported); mWifiNative.closeSupplicantConnection(); mNetworkInfo.setIsAvailable(false); handleNetworkDisconnect(); Loading Loading @@ -2605,14 +2613,14 @@ public class WifiStateMachine extends StateMachine { /* Socket connection can be lost when we do a graceful shutdown * or when the driver is hung. Ensure supplicant is stopped here. */ mWifiNative.killSupplicant(); mWifiNative.killSupplicant(mP2pSupported); mWifiNative.closeSupplicantConnection(); transitionTo(mDriverLoadedState); break; case CMD_STOP_SUPPLICANT_FAILED: if (message.arg1 == mSupplicantStopFailureToken) { loge("Timed out on a supplicant stop, kill and proceed"); mWifiNative.killSupplicant(); mWifiNative.killSupplicant(mP2pSupported); mWifiNative.closeSupplicantConnection(); transitionTo(mDriverLoadedState); } Loading Loading
core/java/android/net/DhcpStateMachine.java +2 −0 Original line number Diff line number Diff line Loading @@ -351,6 +351,8 @@ public class DhcpStateMachine extends StateMachine { DhcpInfoInternal dhcpInfoInternal = new DhcpInfoInternal(); if (dhcpAction == DhcpAction.START) { /* Stop any existing DHCP daemon before starting new */ NetworkUtils.stopDhcp(mInterfaceName); if (DBG) Log.d(TAG, "DHCP request on " + mInterfaceName); success = NetworkUtils.runDhcp(mInterfaceName, dhcpInfoInternal); mDhcpInfo = dhcpInfoInternal; Loading
core/jni/android_net_wifi_Wifi.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -122,9 +122,9 @@ static jboolean android_net_wifi_startSupplicant(JNIEnv* env, jobject, jboolean return (jboolean)(::wifi_start_supplicant(p2pSupported) == 0); } static jboolean android_net_wifi_killSupplicant(JNIEnv* env, jobject) static jboolean android_net_wifi_killSupplicant(JNIEnv* env, jobject, jboolean p2pSupported) { return (jboolean)(::wifi_stop_supplicant() == 0); return (jboolean)(::wifi_stop_supplicant(p2pSupported) == 0); } static jboolean android_net_wifi_connectToSupplicant(JNIEnv* env, jobject, jstring jIface) Loading Loading @@ -204,7 +204,7 @@ static JNINativeMethod gWifiMethods[] = { { "isDriverLoaded", "()Z", (void *)android_net_wifi_isDriverLoaded }, { "unloadDriver", "()Z", (void *)android_net_wifi_unloadDriver }, { "startSupplicant", "(Z)Z", (void *)android_net_wifi_startSupplicant }, { "killSupplicant", "()Z", (void *)android_net_wifi_killSupplicant }, { "killSupplicant", "(Z)Z", (void *)android_net_wifi_killSupplicant }, { "connectToSupplicant", "(Ljava/lang/String;)Z", (void *)android_net_wifi_connectToSupplicant }, { "closeSupplicantConnection", "(Ljava/lang/String;)V", Loading
wifi/java/android/net/wifi/WifiNative.java +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public class WifiNative { /* Sends a kill signal to supplicant. To be used when we have lost connection or when the supplicant is hung */ public native static boolean killSupplicant(); public native static boolean killSupplicant(boolean p2pSupported); private native boolean connectToSupplicant(String iface); Loading
wifi/java/android/net/wifi/WifiStateMachine.java +12 −4 Original line number Diff line number Diff line Loading @@ -1944,6 +1944,7 @@ public class WifiStateMachine extends StateMachine { case CMD_STOP_DRIVER: case CMD_DELAYED_STOP_DRIVER: case CMD_DRIVER_START_TIMED_OUT: case CMD_CAPTIVE_CHECK_COMPLETE: case CMD_START_AP: case CMD_START_AP_SUCCESS: case CMD_START_AP_FAILURE: Loading Loading @@ -2189,6 +2190,13 @@ public class WifiStateMachine extends StateMachine { loge("Unable to change interface settings: " + ie); } /* Stop a running supplicant after a runtime restart * Avoids issues with drivers that do not handle interface down * on a running supplicant properly. */ if (DBG) log("Kill any running supplicant"); mWifiNative.killSupplicant(mP2pSupported); if(mWifiNative.startSupplicant(mP2pSupported)) { if (DBG) log("Supplicant start successful"); mWifiMonitor.startMonitoring(); Loading Loading @@ -2384,7 +2392,7 @@ public class WifiStateMachine extends StateMachine { case WifiMonitor.SUP_DISCONNECTION_EVENT: if (++mSupplicantRestartCount <= SUPPLICANT_RESTART_TRIES) { loge("Failed to setup control channel, restart supplicant"); mWifiNative.killSupplicant(); mWifiNative.killSupplicant(mP2pSupported); transitionTo(mDriverLoadedState); sendMessageDelayed(CMD_START_SUPPLICANT, SUPPLICANT_RESTART_INTERVAL_MSECS); } else { Loading Loading @@ -2451,7 +2459,7 @@ public class WifiStateMachine extends StateMachine { break; case WifiMonitor.SUP_DISCONNECTION_EVENT: /* Supplicant connection lost */ loge("Connection lost, restart supplicant"); mWifiNative.killSupplicant(); mWifiNative.killSupplicant(mP2pSupported); mWifiNative.closeSupplicantConnection(); mNetworkInfo.setIsAvailable(false); handleNetworkDisconnect(); Loading Loading @@ -2605,14 +2613,14 @@ public class WifiStateMachine extends StateMachine { /* Socket connection can be lost when we do a graceful shutdown * or when the driver is hung. Ensure supplicant is stopped here. */ mWifiNative.killSupplicant(); mWifiNative.killSupplicant(mP2pSupported); mWifiNative.closeSupplicantConnection(); transitionTo(mDriverLoadedState); break; case CMD_STOP_SUPPLICANT_FAILED: if (message.arg1 == mSupplicantStopFailureToken) { loge("Timed out on a supplicant stop, kill and proceed"); mWifiNative.killSupplicant(); mWifiNative.killSupplicant(mP2pSupported); mWifiNative.closeSupplicantConnection(); transitionTo(mDriverLoadedState); } Loading