__connman_device_disconnect(network->device);
#if defined TIZEN_EXT
DBG("ConnMan, Connect Request [%s]", network->name);
+ struct connman_service *service = connman_service_lookup_from_network(network);
+ connman_service_set_disconnection_requested(service, false);
#endif
err = network->driver->connect(network);
if (err < 0) {
network->connecting = false;
#if defined TIZEN_EXT
DBG("ConnMan, Disconnect request");
+ struct connman_service *service = connman_service_lookup_from_network(network);
+ connman_service_set_disconnection_requested(service, true);
#endif
if (network->driver->disconnect)
err = network->driver->disconnect(network);
* Only for EAP-FAST
*/
char *phase1;
-#endif
-#ifdef TIZEN_EXT
+ /*
+ * Description: To indicate that disconnection triggered by user.
+ */
+ bool disconnection_requested;
+
enum connman_dnsconfig_method dns_config_method_ipv4;
enum connman_dnsconfig_method dns_config_method_ipv6;
#endif
DBUS_TYPE_STRING, &str);
}
+#if defined TIZEN_EXT
+static void connect_reason_changed(struct connman_service *service)
+{
+ if (!service->path)
+ return;
+
+ if (!allow_property_changed(service))
+ return;
+
+ connman_dbus_property_changed_basic(service->path,
+ CONNMAN_SERVICE_INTERFACE,
+ "ConnectReason",
+ DBUS_TYPE_INT32,
+ &service->connect_reason);
+}
+
+static void disconnection_requested_changed(struct connman_service *service)
+{
+ dbus_bool_t disconnection_requested;
+
+ if (!service->path)
+ return;
+
+ if (!allow_property_changed(service))
+ return;
+
+ disconnection_requested = service->disconnection_requested;
+ connman_dbus_property_changed_basic(service->path,
+ CONNMAN_SERVICE_INTERFACE,
+ "DisconnectionRequested",
+ DBUS_TYPE_BOOLEAN,
+ &disconnection_requested);
+}
+
+void connman_service_set_disconnection_requested(struct connman_service *service,
+ bool disconnection_requested)
+{
+ if (service == NULL)
+ return;
+
+ service->disconnection_requested = disconnection_requested;
+ disconnection_requested_changed(service);
+}
+#endif
+
static void strength_changed(struct connman_service *service)
{
if (service->strength == 0)
/*Reset the association status code while issue connect request*/
service->assoc_status_code = 0;
+
+ /* Reset the disconnection_requested while issue connect request*/
+ connman_service_set_disconnection_requested(service, false);
#endif
if (service->pending)
service->wps = false;
#if defined TIZEN_EXT
+ service->disconnection_requested = false;
service->storage_reload = false;
/*
* Description: TIZEN implements system global connection management.
DBG("service %p err %d", service, err);
service->connect_reason = reason;
+#if defined TIZEN_EXT
+ connect_reason_changed(service);
+#endif
if (err >= 0)
return 0;