Loading core/jni/android_net_wifi_Wifi.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -121,6 +121,11 @@ static jboolean android_net_wifi_startSupplicant(JNIEnv* env, jobject clazz) return (jboolean)(::wifi_start_supplicant() == 0); } static jboolean android_net_wifi_stopSupplicant(JNIEnv* env, jobject clazz) { return doBooleanCommand("TERMINATE", "OK"); } static jboolean android_net_wifi_killSupplicant(JNIEnv* env, jobject clazz) { return (jboolean)(::wifi_stop_supplicant() == 0); Loading Loading @@ -533,11 +538,6 @@ static jboolean android_net_wifi_reloadConfigCommand(JNIEnv* env, jobject clazz) return doBooleanCommand("RECONFIGURE", "OK"); } static jboolean android_net_wifi_terminateCommand(JNIEnv* env, jobject clazz) { return doBooleanCommand("TERMINATE", "OK"); } static jboolean android_net_wifi_setScanResultHandlingCommand(JNIEnv* env, jobject clazz, jint mode) { char cmdstr[BUF_SIZE]; Loading Loading @@ -610,6 +610,7 @@ static JNINativeMethod gWifiMethods[] = { { "isDriverLoaded", "()Z", (void *)android_net_wifi_isDriverLoaded}, { "unloadDriver", "()Z", (void *)android_net_wifi_unloadDriver }, { "startSupplicant", "()Z", (void *)android_net_wifi_startSupplicant }, { "stopSupplicant", "()Z", (void*) android_net_wifi_stopSupplicant }, { "killSupplicant", "()Z", (void *)android_net_wifi_killSupplicant }, { "connectToSupplicant", "()Z", (void *)android_net_wifi_connectToSupplicant }, { "closeSupplicantConnection", "()V", (void *)android_net_wifi_closeSupplicantConnection }, Loading Loading @@ -652,7 +653,6 @@ static JNINativeMethod gWifiMethods[] = { { "getMacAddressCommand", "()Ljava/lang/String;", (void*) android_net_wifi_getMacAddressCommand }, { "saveConfigCommand", "()Z", (void*) android_net_wifi_saveConfigCommand }, { "reloadConfigCommand", "()Z", (void*) android_net_wifi_reloadConfigCommand }, { "terminateCommand", "()Z", (void*) android_net_wifi_terminateCommand }, { "setScanResultHandlingCommand", "(I)Z", (void*) android_net_wifi_setScanResultHandlingCommand }, { "addToBlacklistCommand", "(Ljava/lang/String;)Z", (void*) android_net_wifi_addToBlacklistCommand }, { "clearBlacklistCommand", "()Z", (void*) android_net_wifi_clearBlacklistCommand }, Loading wifi/java/android/net/wifi/WifiNative.java +17 −9 Original line number Diff line number Diff line Loading @@ -48,6 +48,16 @@ public class WifiNative { public native static boolean startSupplicant(); /* Does a graceful shutdown of supplicant. * * Note that underneath we use a harsh-sounding "terminate" supplicant command * for a graceful stop and a mild-sounding "stop" interface * to kill the process */ public native static boolean stopSupplicant(); /* 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 connectToSupplicant(); Loading Loading @@ -80,8 +90,6 @@ public class WifiNative { public native static boolean disconnectCommand(); public native static boolean terminateCommand(); public native static String statusCommand(); public native static int getRssiCommand(); Loading wifi/java/android/net/wifi/WifiStateMachine.java +3 −3 Original line number Diff line number Diff line Loading @@ -1989,9 +1989,9 @@ public class WifiStateMachine extends HierarchicalStateMachine { switch(message.what) { case CMD_STOP_SUPPLICANT: /* Supplicant stopped by user */ EventLog.writeEvent(EVENTLOG_WIFI_EVENT_HANDLED, message.what); Log.d(TAG, "send terminate command to supplicant"); if (!WifiNative.terminateCommand()) { Log.e(TAG, "Failed to terminate cleanly, issue kill"); Log.d(TAG, "stopping supplicant"); if (!WifiNative.stopSupplicant()) { Log.e(TAG, "Failed to stop supplicant, issue kill"); WifiNative.killSupplicant(); } handleNetworkDisconnect(); Loading Loading
core/jni/android_net_wifi_Wifi.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -121,6 +121,11 @@ static jboolean android_net_wifi_startSupplicant(JNIEnv* env, jobject clazz) return (jboolean)(::wifi_start_supplicant() == 0); } static jboolean android_net_wifi_stopSupplicant(JNIEnv* env, jobject clazz) { return doBooleanCommand("TERMINATE", "OK"); } static jboolean android_net_wifi_killSupplicant(JNIEnv* env, jobject clazz) { return (jboolean)(::wifi_stop_supplicant() == 0); Loading Loading @@ -533,11 +538,6 @@ static jboolean android_net_wifi_reloadConfigCommand(JNIEnv* env, jobject clazz) return doBooleanCommand("RECONFIGURE", "OK"); } static jboolean android_net_wifi_terminateCommand(JNIEnv* env, jobject clazz) { return doBooleanCommand("TERMINATE", "OK"); } static jboolean android_net_wifi_setScanResultHandlingCommand(JNIEnv* env, jobject clazz, jint mode) { char cmdstr[BUF_SIZE]; Loading Loading @@ -610,6 +610,7 @@ static JNINativeMethod gWifiMethods[] = { { "isDriverLoaded", "()Z", (void *)android_net_wifi_isDriverLoaded}, { "unloadDriver", "()Z", (void *)android_net_wifi_unloadDriver }, { "startSupplicant", "()Z", (void *)android_net_wifi_startSupplicant }, { "stopSupplicant", "()Z", (void*) android_net_wifi_stopSupplicant }, { "killSupplicant", "()Z", (void *)android_net_wifi_killSupplicant }, { "connectToSupplicant", "()Z", (void *)android_net_wifi_connectToSupplicant }, { "closeSupplicantConnection", "()V", (void *)android_net_wifi_closeSupplicantConnection }, Loading Loading @@ -652,7 +653,6 @@ static JNINativeMethod gWifiMethods[] = { { "getMacAddressCommand", "()Ljava/lang/String;", (void*) android_net_wifi_getMacAddressCommand }, { "saveConfigCommand", "()Z", (void*) android_net_wifi_saveConfigCommand }, { "reloadConfigCommand", "()Z", (void*) android_net_wifi_reloadConfigCommand }, { "terminateCommand", "()Z", (void*) android_net_wifi_terminateCommand }, { "setScanResultHandlingCommand", "(I)Z", (void*) android_net_wifi_setScanResultHandlingCommand }, { "addToBlacklistCommand", "(Ljava/lang/String;)Z", (void*) android_net_wifi_addToBlacklistCommand }, { "clearBlacklistCommand", "()Z", (void*) android_net_wifi_clearBlacklistCommand }, Loading
wifi/java/android/net/wifi/WifiNative.java +17 −9 Original line number Diff line number Diff line Loading @@ -48,6 +48,16 @@ public class WifiNative { public native static boolean startSupplicant(); /* Does a graceful shutdown of supplicant. * * Note that underneath we use a harsh-sounding "terminate" supplicant command * for a graceful stop and a mild-sounding "stop" interface * to kill the process */ public native static boolean stopSupplicant(); /* 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 connectToSupplicant(); Loading Loading @@ -80,8 +90,6 @@ public class WifiNative { public native static boolean disconnectCommand(); public native static boolean terminateCommand(); public native static String statusCommand(); public native static int getRssiCommand(); Loading
wifi/java/android/net/wifi/WifiStateMachine.java +3 −3 Original line number Diff line number Diff line Loading @@ -1989,9 +1989,9 @@ public class WifiStateMachine extends HierarchicalStateMachine { switch(message.what) { case CMD_STOP_SUPPLICANT: /* Supplicant stopped by user */ EventLog.writeEvent(EVENTLOG_WIFI_EVENT_HANDLED, message.what); Log.d(TAG, "send terminate command to supplicant"); if (!WifiNative.terminateCommand()) { Log.e(TAG, "Failed to terminate cleanly, issue kill"); Log.d(TAG, "stopping supplicant"); if (!WifiNative.stopSupplicant()) { Log.e(TAG, "Failed to stop supplicant, issue kill"); WifiNative.killSupplicant(); } handleNetworkDisconnect(); Loading