Remove dependancy on appman
authorJune Kim <sena06.kim@samsung.com>
Tue, 9 Apr 2013 10:45:49 +0000 (19:45 +0900)
committerJune Kim <sena06.kim@samsung.com>
Tue, 9 Apr 2013 10:45:49 +0000 (19:45 +0900)
configure.ac
location.pc.in
location/manager/location-common-util.c
packaging/libslp-location.spec

index 3189dae..803905b 100755 (executable)
@@ -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)
 
index a9a8641..bf901e0 100644 (file)
@@ -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
index 36b723a..a96362c 100644 (file)
@@ -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"
 
 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(&timestamp);
-               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)
index 9f8babf..14fda51 100755 (executable)
@@ -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)