if (old_state == new_state)
return Error;
+#if defined TIZEN_DA
+ /*
+ * Send connection state callback to upper layer.
+ * This problem is that the target does not send the connection state callback to upper layer if its usb module is reattaced.
+ * Ignore configuration state when disconnection with AP.
+ */
+ if ((old_state == NET_STATE_TYPE_READY || old_state == NET_STATE_TYPE_ONLINE)
+ && new_state == NET_STATE_TYPE_CONFIGURATION)
+ return Error;
+#endif /* TIZEN_DA */
+
network_info->service_state = new_state;
switch (new_state) {
last_prof_info.bssid_list = NULL;
}
+#if defined TIZEN_DA
+ /*
+ * Fix connection callback issue.
+ * It ignore configuration state after disconnection state in connection_state_changed_cb.
+ */
+ static wifi_manager_connection_state_e last_state = WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED;
+
+ if (last_state == WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED && state == WIFI_MANAGER_CONNECTION_STATE_CONFIGURATION) {
+ WIFI_LOG(WIFI_INFO, "Previous state is disconnected, so ignore the configuration state.");
+ return;
+ }
+
+ last_state = state;
+#endif /* TIZEN_DA */
+
WIFI_LOG(WIFI_INFO, "%s state changed : %s", profile_name, __convert_ap_state_to_string(state));
if (wifi_handle->connection_state_cb) {
if ((_wifi_check_profile_name_validity(event_cb->ProfileName) !=
true) && (event_cb->Error !=
NET_ERR_CONNECTION_CONNECT_FAILED) &&
+#if defined TIZEN_DA
+ /*
+ * Send the connection callback to upper layer when specific failure case.
+ * It has the problem that does not connection callback to wifi-manager
+ * when it received the failure event from net-config before it gets the service state from connman.
+ */
+ (event_cb->Error !=
+ NET_ERR_INVALID_OPERATION) &&
+#endif /* TIZEN_DA */
(event_cb->Error !=
NET_ERR_CONNECTION_WPS_TIMEOUT) &&
(event_cb->Error !=