Removed WFD_DBUS_LAUNCH because now wifi-direct library takes care of wfd-manager... 82/176282/1 accepted/tizen/unified/20180425.062320 submit/tizen/20180424.084858
authorNishant Chaprana <n.chaprana@samsung.com>
Wed, 18 Apr 2018 04:53:50 +0000 (10:23 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Wed, 18 Apr 2018 04:53:50 +0000 (10:23 +0530)
Change-Id: I013e7718fe01aa2804baeafc381bb334d34d92a3
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/ug-setting-wifidirect-efl.spec
ug-wifidirect/include/wfd_ug.h
ug-wifidirect/src/wfd_client.c
ug-wifidirect/src/wfd_ug.c
ug-wifidirect/src/wfd_ug_main_view.c

index e0ca6da..deb264f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       ug-setting-wifidirect-efl
 Summary:    Wi-Fi Direct setting UI gadget
-Version:    1.11.86
+Version:    1.11.87
 Release:    1
 Group:      Applications/Network
 License:    Flora-1.1
index 489529c..2d1a31e 100644 (file)
@@ -351,11 +351,6 @@ struct ug_data {
        int wfd_discovery_status;
 
        bool is_paused;
-
-#ifdef WFD_DBUS_LAUNCH
-       GCancellable *dbus_cancellable;
-       GDBusConnection *conn;
-#endif
 };
 
 extern Elm_Gen_Item_Class device_name_title_itc;
index 4676e01..ce64950 100644 (file)
@@ -1387,81 +1387,6 @@ int init_wfd_client(void* data)
        return 0;
 }
 
-#ifdef WFD_DBUS_LAUNCH
-void wfd_gdbus_callback(GObject *source_object, GAsyncResult *result, gpointer user_data)
-{
-       __FUNC_ENTER__;
-       struct ug_data *ugd = (struct ug_data *)user_data;
-       WFD_RET_IF(ugd == NULL, "Incorrect parameter(NULL)\n");
-       int res = -1;
-
-       GError *error = NULL;
-       GVariant *return_data;
-
-       g_object_unref(ugd->dbus_cancellable);
-       ugd->dbus_cancellable = NULL;
-       ugd->conn = G_DBUS_CONNECTION(source_object);
-       return_data = g_dbus_connection_call_finish(ugd->conn, result, &error);
-
-       if (error != NULL) {
-               DBG(LOG_ERROR, "DBus action failed. Error Msg [%s]\n", error->message);
-               g_clear_error(&error);
-       } else {
-               DBG(LOG_INFO, "error msg is NULL\n");
-       }
-
-       if (return_data)
-               g_variant_unref(return_data);
-
-       if (ugd->conn) {
-               g_object_unref(ugd->conn);
-               ugd->conn = NULL;
-       }
-
-       res = init_wfd_client(ugd);
-       WFD_RET_IF(res != 0, "Failed to initialize WFD client library\n");
-
-       /* Activate WiFi Direct */
-       DBG(LOG_INFO, "Activating WiFi Direct...");
-       if (ugd->wfd_status <= WIFI_DIRECT_STATE_DEACTIVATING) {
-               res = wfd_client_switch_on(ugd);
-               WFD_RET_IF(res != 0, "Failed to activate WFD\n");
-       }
-
-       __FUNC_EXIT__;
-}
-
-int launch_wifi_direct_manager(void *data)
-{
-       __FUNC_ENTER__;
-
-       gchar *addr = NULL;
-       GError *error = NULL;
-
-       struct ug_data *ugd = (struct ug_data *)data;
-       WFD_RETV_IF(ugd == NULL, -1, "Incorrect parameter(NULL)\n");
-
-       ugd->dbus_cancellable = g_cancellable_new();
-
-       addr  = g_dbus_address_get_for_bus_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
-       WFD_RETV_IF(addr == NULL, -1, "Fail to get dbus addr.\n");
-
-       ugd->conn = g_dbus_connection_new_for_address_sync(addr, G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT |
-                       G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION, NULL, NULL, NULL);
-
-       if (ugd->conn == NULL) {
-               DBG(LOG_ERROR, "g_dbus_conn is NULL\n");
-               return -1;
-       } else {
-               g_dbus_connection_call(ugd->conn, "net.netconfig", "/net/netconfig/wifi", "net.netconfig.wifi",
-               "LaunchDirect", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, ugd->dbus_cancellable, wfd_gdbus_callback, data);
-       }
-
-       __FUNC_EXIT__;
-       return 0;
-}
-#endif
-
 void wfd_client_destroy_tethering(struct ug_data *ugd)
 {
        __FUNC_ENTER__;
index ee0ef80..b8a1691 100644 (file)
@@ -230,23 +230,8 @@ void wfd_destroy_ug(void *data)
        __FUNC_ENTER__;
        struct ug_data *ugd = (struct ug_data *) data;
 
-#ifdef WFD_DBUS_LAUNCH
-       if (ugd->dbus_cancellable != NULL) {
-               g_cancellable_cancel(ugd->dbus_cancellable);
-               g_object_unref(ugd->dbus_cancellable);
-               ugd->dbus_cancellable = NULL;
-               if (ugd->conn) {
-                       g_object_unref(ugd->conn);
-                       ugd->conn = NULL;
-               }
-               DBG(LOG_INFO, "Cancelled dbus call");
-               return;
-       } else
-#endif
-       {
-               DBG(LOG_INFO, "dbus_cancellable is NULL");
-               ug_destroy_me(ugd->ug);
-       }
+       DBG(LOG_INFO, "dbus_cancellable is NULL");
+       ug_destroy_me(ugd->ug);
 
        __FUNC_EXIT__;
        return;
@@ -269,33 +254,6 @@ static void wfd_ug_layout_del_cb(void *data , Evas *e, Evas_Object *obj, void *e
        __FUNC_EXIT__;
 }
 
-#ifdef WFD_DBUS_LAUNCH
-/**
- *     This function let the ug initialize wfd
- *     @return   void
- *     @param[in] data the pointer to the main data structure
- *     @param[in] evas the pointer to the evas canvas
- *     @param[in] obj the pointer to the evas object
- *     @param[in] event_info the pointer to the event information
- */
-static void _wfd_init_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
-{
-       __FUNC_ENTER__;
-       int res = -1;
-       struct ug_data *ugd = (struct ug_data *)data;
-       WFD_RET_IF(ugd == NULL || ugd->base == NULL, "Incorrect parameter(NULL)\n");
-
-       evas_object_event_callback_del(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb);
-
-       res = launch_wifi_direct_manager(ugd);
-       if (res != 0)
-               DBG(LOG_ERROR, "Failed to launch wifi direct manager\n");
-
-       __FUNC_EXIT__;
-       return;
-}
-#endif
-
 static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, void *priv)
 {
        __FUNC_ENTER__;
@@ -469,9 +427,6 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control,
        } else {
                ugd->wfd_status = WIFI_DIRECT_STATE_DEACTIVATED;
 
-#ifdef WFD_DBUS_LAUNCH
-               evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb, ugd);
-#else
                ret = init_wfd_client(ugd);
                WFD_RETV_IF(ret != 0, NULL,  "Failed to initialize WFD client library\n");
 
@@ -481,7 +436,6 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control,
                        ret = wfd_client_switch_on(ugd);
                        WFD_RETV_IF(ret != 0, NULL, "Failed to activate WFD\n");
                }
-#endif
        }
        ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVICE_NAME_STR,
                        __wfd_main_vconf_change_cb, ugd);
@@ -626,11 +580,6 @@ static void on_destroy(ui_gadget_h ug, app_control_h control, void *priv)
        WFD_IF_FREE_MEM(ugd->view_type);
 
        WFD_IF_DEL_OBJ(ugd->bg);
-
-#ifdef WFD_DBUS_LAUNCH
-       if (ugd->base)
-               evas_object_event_callback_del(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb);
-#endif
        WFD_IF_DEL_OBJ(ugd->base);
        DBG(LOG_INFO, "WFD client deregistered");
 
index 826e4ca..517392f 100755 (executable)
@@ -75,19 +75,6 @@ Eina_Bool _back_btn_cb(void *data, Elm_Object_Item *it)
        bool owner = FALSE;
        app_control_h control = NULL;
 
-#ifdef WFD_DBUS_LAUNCH
-       if (ugd->dbus_cancellable != NULL) {
-               g_cancellable_cancel(ugd->dbus_cancellable);
-               g_object_unref(ugd->dbus_cancellable);
-               ugd->dbus_cancellable = NULL;
-               if (ugd->conn) {
-                       g_object_unref(ugd->conn);
-                       ugd->conn = NULL;
-               }
-               DBG(LOG_INFO, "Cancel dbus call");
-       }
-#endif
-
        wfd_refresh_wifi_direct_state(ugd);
        if (ugd->wfd_status <= WIFI_DIRECT_STATE_DEACTIVATING) {
                DBG(LOG_INFO, "WiFi direct is already deactivated\n");
@@ -157,19 +144,6 @@ void _smart_back_btn_cb(void *data, Evas_Object *obj, void *event_info)
                return;
        }
 
-#ifdef WFD_DBUS_LAUNCH
-       if (ugd->dbus_cancellable != NULL) {
-               g_cancellable_cancel(ugd->dbus_cancellable);
-               g_object_unref(ugd->dbus_cancellable);
-               ugd->dbus_cancellable = NULL;
-               if (ugd->conn) {
-                       g_object_unref(ugd->conn);
-                       ugd->conn = NULL;
-               }
-               DBG(LOG_INFO, "Cancel dbus call");
-       }
-#endif
-
        wfd_refresh_wifi_direct_state(ugd);
        if (ugd->wfd_status <= WIFI_DIRECT_STATE_DEACTIVATING) {
                DBG(LOG_INFO, "WiFi direct is already deactivated\n");