diff options
-rwxr-xr-x | configure.ac | 2 | ||||
-rw-r--r-- | location.pc.in | 2 | ||||
-rw-r--r-- | location/manager/location-common-util.c | 127 | ||||
-rwxr-xr-x | packaging/libslp-location.spec | 3 |
4 files changed, 5 insertions, 129 deletions
diff --git a/configure.ac b/configure.ac index 3189dae..803905b 100755 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,7 @@ AC_COMPILE_IFELSE( AC_MSG_RESULT($has_visibility) # Check dependencies -PKG_CHECK_MODULES(LOCATION, [glib-2.0 gobject-2.0 dbus-glib-1 gmodule-2.0 vconf vconf-internal-keys location-appman]) +PKG_CHECK_MODULES(LOCATION, [glib-2.0 gobject-2.0 dbus-glib-1 gmodule-2.0 vconf vconf-internal-keys]) AC_SUBST(LOCATION_LIBS) AC_SUBST(LOCATION_CFLAGS) diff --git a/location.pc.in b/location.pc.in index a9a8641..bf901e0 100644 --- a/location.pc.in +++ b/location.pc.in @@ -7,7 +7,7 @@ datadir=@datadir@ Name: location Description: SLP Location FW -Requires: glib-2.0 gobject-2.0 gmodule-2.0 vconf location-appman +Requires: glib-2.0 gobject-2.0 gmodule-2.0 vconf Version: @VERSION@ Libs: -L${libdir} -lSLP-location Cflags: -I${includedir} -I${includedir}/location diff --git a/location/manager/location-common-util.c b/location/manager/location-common-util.c index 36b723a..a96362c 100644 --- a/location/manager/location-common-util.c +++ b/location/manager/location-common-util.c @@ -26,7 +26,6 @@ #include <stdio.h> #include <sys/types.h> #include <unistd.h> -#include <location-appman.h> #include "location.h" #include "location-common-util.h" @@ -35,144 +34,22 @@ int location_application_get_authority (void) { - pid_t pid = getpid(); - location_appman_s *appman; - int enabled; - int found; - - if (location_appman_get_package_by_pid(pid, &appman) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to location_appman_get_package_by_pid"); - return LOCATION_APP_NOT_FOUND; - } - - if (location_appman_find_package(appman->package, &found) != LOCATION_APPMAN_ERROR_NONE || found == LOCATION_APPMAN_PACKAGE_NOTFOUND) { - LOCATION_LOGE("Cannot find package [%s]", appman->package); - return LOCATION_APP_NOT_FOUND; - } - - if (location_appman_is_enabled(appman->package, &enabled) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to location_appman_is_enabled"); - return LOCATION_APP_NOT_FOUND; - } - - if (enabled) { - return LOCATION_APP_ON; - } - else { - return LOCATION_APP_OFF; - - } - - return LOCATION_APP_NOT_FOUND; + return LOCATION_APP_ON; } int location_application_set_authority (int auth) { - pid_t pid = getpid(); - location_appman_s *appman; - int enabled; - int found; - - if (location_appman_get_package_by_pid(pid, &appman) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to location_appman_get_package_by_pid"); - return LOCATION_ERROR_UNKNOWN; - } - - if (location_appman_find_package(appman->package, &found) != LOCATION_APPMAN_ERROR_NONE || found == LOCATION_APPMAN_PACKAGE_NOTFOUND) { - LOCATION_LOGE("Cannot find package [%s]", appman->package); - return LOCATION_ERROR_UNKNOWN; - } - - if (location_appman_set_on(appman->package, auth) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to location_appman_is_enabled"); - return LOCATION_ERROR_UNKNOWN; - } - return LOCATION_ERROR_NONE; } int location_application_add_app_to_applist (void) { - pid_t pid = getpid(); - location_appman_s *appman; - int found; - time_t timestamp; - - if (location_appman_get_package_by_pid(pid, &appman) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to location_appman_get_package_by_pid"); - return FALSE; - } - - if (location_appman_find_package(appman->package, &found) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Cannot find package [%s]", appman->package); - if (appman) g_free(appman); - return FALSE; - } - - if (found == LOCATION_APPMAN_PACKAGE_NOTFOUND) { - LOCATION_LOGD("First time to use location [%s]", appman->package); - if (location_appman_register_package(appman) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to register [%s]", appman->package); - if (appman) g_free(appman); - return FALSE; - } - } else { - LOCATION_LOGD("[%s] is already registered. Update recently used time", appman->package); - if (appman) g_free(appman); - return FALSE; - } - - if (appman) g_free(appman); return TRUE; } int location_application_enabled (void) { - pid_t pid = getpid(); - location_appman_s *appman; - int enabled; - int found; - time_t timestamp; - - if (TRUE == location_appman_check_developer_mode()) { - LOCATION_LOGE("Location is Enabled"); - return TRUE; - } - - if (location_appman_get_package_by_pid(pid, &appman) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to location_appman_get_package_by_pid"); - return FALSE; - } - - if (location_appman_find_package(appman->package, &found) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Cannot find package [%s]", appman->package); - if (appman) g_free(appman); - return FALSE; - } - - if (found == LOCATION_APPMAN_PACKAGE_NOTFOUND) { - LOCATION_LOGD("First time to use location [%s]", appman->package); - if (location_appman_register_package(appman) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to register [%s]", appman->package); - if (appman) g_free(appman); - return FALSE; - } - } else { - LOCATION_LOGD("[%s] is already registered. Update recently used time", appman->package); - time(×tamp); - if (location_appman_set_recently_used(appman->package, timestamp) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGD("Cannot update recently used time"); - } - } - - if (location_appman_is_enabled(appman->package, &enabled) != LOCATION_APPMAN_ERROR_NONE) { - LOCATION_LOGE("Fail to location_appman_is_enabled"); - if (appman) g_free(appman); - return FALSE; - } - - if (appman) g_free(appman); - return enabled; + return TRUE; } static gint compare_position (gconstpointer a, gconstpointer b) diff --git a/packaging/libslp-location.spec b/packaging/libslp-location.spec index 9f8babf..14fda51 100755 --- a/packaging/libslp-location.spec +++ b/packaging/libslp-location.spec @@ -1,6 +1,6 @@ Name: libslp-location Summary: Location Based Service -Version: 0.4.6 +Version: 0.4.7 Release: 1 Group: System/Libraries License: Apache Licensc, Version 2.0 @@ -14,7 +14,6 @@ BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(gmodule-2.0) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(vconf) -BuildRequires: pkgconfig(location-appman) BuildRequires: pkgconfig(json-glib-1.0) |