From: david Date: Fri, 5 Dec 2014 01:45:58 +0000 (+0800) Subject: Remove dependency to vconf X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2063079ae6477b94eed83d5e7e28a9312b0e48e7;p=platform%2Fcore%2Fapi%2Ftethering.git Remove dependency to vconf Change-Id: Ifd2ec9376d132d1716a564e654ca2aacf00492ef --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 32e6bdb..dc4ac03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) -SET(dependents "dlog glib-2.0 capi-base-common vconf connman-lib winet-lib") +SET(dependents "dlog glib-2.0 capi-base-common connman-lib winet-lib") IF("${CMAKE_BUILD_TYPE}" STREQUAL "") SET(CMAKE_BUILD_TYPE "Release") diff --git a/packaging/capi-network-tethering.spec b/packaging/capi-network-tethering.spec index 222bfd3..b839f1c 100644 --- a/packaging/capi-network-tethering.spec +++ b/packaging/capi-network-tethering.spec @@ -12,7 +12,6 @@ BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(connman-lib) BuildRequires: pkgconfig(winet-lib) BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(vconf) BuildRequires: cmake %description diff --git a/src/tethering.c b/src/tethering.c index 31240ed..da78c17 100644 --- a/src/tethering.c +++ b/src/tethering.c @@ -24,7 +24,7 @@ #include #include -#include +/*#include */ #include "winet-tether.h" #include "connman-lib.h" @@ -1562,24 +1562,36 @@ API int tethering_disable(tethering_h tethering, tethering_type_e type) */ API bool tethering_is_enabled(tethering_h tethering, tethering_type_e type) { - int is_on = 0; +/* int is_on = 0; int vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE; if (vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE, &is_on) != 0) { return FALSE; } +*/ + bool is_on = false; + struct connman_technology *technology; switch (type) { case TETHERING_TYPE_USB: - vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_USB; + /*vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_USB;*/ + technology = connman_get_technology(TECH_TYPE_GADGET); + if (technology != NULL) + is_on = connman_get_technology_tethering(technology); break; case TETHERING_TYPE_WIFI: - vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI; + /*vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI;*/ + technology = connman_get_technology(TECH_TYPE_WIFI); + if (technology != NULL) + is_on = connman_get_technology_tethering(technology); break; case TETHERING_TYPE_BT: - vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_BT; + /*vconf_type = VCONFKEY_MOBILE_HOTSPOT_MODE_BT;*/ + technology = connman_get_technology(TECH_TYPE_BLUETOOTH); + if (technology != NULL) + is_on = connman_get_technology_tethering(technology); break; default: @@ -1587,7 +1599,7 @@ API bool tethering_is_enabled(tethering_h tethering, tethering_type_e type) break; } - return is_on & vconf_type ? true : false; + return is_on; } /** diff --git a/test/tethering_test.c b/test/tethering_test.c index d4d1181..f11faa2 100644 --- a/test/tethering_test.c +++ b/test/tethering_test.c @@ -24,8 +24,6 @@ #include #include -#include - #include "tethering.h" #define INPUT_BUF_LEN 128