diff options
author | Jongmun Woo <jongmun.woo@samsung.com> | 2016-03-28 04:39:42 -0700 |
---|---|---|
committer | Jongmun Woo <jongmun.woo@samsung.com> | 2016-03-28 04:39:42 -0700 |
commit | 69c977ca4e4d3ce2569cb16828cd9800266116c8 (patch) | |
tree | 06532b9405b75d0b3198ccb9599e7da2327cddc7 | |
parent | 0e94dece884b395b199ab658ec7cf307811e69d5 (diff) | |
download | geofence-server-69c977ca4e4d3ce2569cb16828cd9800266116c8.tar.gz geofence-server-69c977ca4e4d3ce2569cb16828cd9800266116c8.tar.bz2 geofence-server-69c977ca4e4d3ce2569cb16828cd9800266116c8.zip |
Revert "fix for permission deny of cynara"
This reverts commit 0e94dece884b395b199ab658ec7cf307811e69d5.
Change-Id: I6f517932abe805f2f7dcbf0fa86bb8be9399ab66
-rw-r--r-- | module/module_geofence_server.c | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/module/module_geofence_server.c b/module/module_geofence_server.c index 67678a2..0011ec9 100644 --- a/module/module_geofence_server.c +++ b/module/module_geofence_server.c @@ -53,14 +53,11 @@ EXPORT_API int add_geopoint(void *handle, int place_id, double latitude, double GeofenceManagerData *geofence_manager = (GeofenceManagerData *)handle; g_return_val_if_fail(geofence_manager, GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER); int new_fence_id = -1; - int error_code = GEOFENCE_MANAGER_ERROR_NONE; - new_fence_id = geo_client_add_geofence(geofence_manager->geofence_client, geofence_manager->app_id, place_id, GEOFENCE_TYPE_GEOPOINT, latitude, longitude, radius, address, "", "", &error_code); + new_fence_id = geo_client_add_geofence(geofence_manager->geofence_client, geofence_manager->app_id, place_id, GEOFENCE_TYPE_GEOPOINT, latitude, longitude, radius, address, "", ""); *fence_id = new_fence_id; - if (error_code != GEOFENCE_MANAGER_ERROR_NONE) - return error_code; - else if (new_fence_id == -1) + if (new_fence_id == -1) return GEOFENCE_CLIENT_ERROR_DBUS_CALL; return GEOFENCE_MANAGER_ERROR_NONE; @@ -72,14 +69,11 @@ EXPORT_API int add_bssid(void *handle, int place_id, const char *bssid, const ch GeofenceManagerData *geofence_manager = (GeofenceManagerData *)handle; g_return_val_if_fail(geofence_manager, GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER); int new_fence_id = -1; - int error_code = GEOFENCE_MANAGER_ERROR_NONE; - new_fence_id = geo_client_add_geofence(geofence_manager->geofence_client, geofence_manager->app_id, place_id, type, -1, -1, -1, "", bssid, ssid, &error_code); + new_fence_id = geo_client_add_geofence(geofence_manager->geofence_client, geofence_manager->app_id, place_id, type, -1, -1, -1, "", bssid, ssid); *fence_id = new_fence_id; - if (error_code != GEOFENCE_MANAGER_ERROR_NONE) - return error_code; - else if (new_fence_id == -1) + if (new_fence_id == -1) return GEOFENCE_CLIENT_ERROR_DBUS_CALL; return GEOFENCE_MANAGER_ERROR_NONE; @@ -91,14 +85,11 @@ EXPORT_API int add_place(void *handle, const char *place_name, int *place_id) GeofenceManagerData *geofence_manager = (GeofenceManagerData *)handle; g_return_val_if_fail(geofence_manager, GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER); int new_place_id = -1; - int error_code = GEOFENCE_MANAGER_ERROR_NONE; - new_place_id = geo_client_add_place(geofence_manager->geofence_client, geofence_manager->app_id, place_name, &error_code); + new_place_id = geo_client_add_place(geofence_manager->geofence_client, geofence_manager->app_id, place_name); *place_id = new_place_id; - if (error_code != GEOFENCE_MANAGER_ERROR_NONE) - return error_code; - else if (new_place_id == -1) + if (new_place_id == -1) return GEOFENCE_CLIENT_ERROR_DBUS_CALL; return GEOFENCE_MANAGER_ERROR_NONE; @@ -112,7 +103,7 @@ EXPORT_API int update_place(void *handle, int place_id, const char *place_name) int ret = geo_client_update_place(geofence_manager->geofence_client, geofence_manager->app_id, place_id, place_name); if (ret != GEOFENCE_CLIENT_ERROR_NONE) - return ret; + return GEOFENCE_CLIENT_ERROR_DBUS_CALL; return GEOFENCE_MANAGER_ERROR_NONE; } @@ -125,7 +116,7 @@ EXPORT_API int remove_geofence(void *handle, int fence_id) int ret = geo_client_delete_geofence(geofence_manager->geofence_client, geofence_manager->app_id, fence_id); if (ret != GEOFENCE_CLIENT_ERROR_NONE) - return ret; + return GEOFENCE_CLIENT_ERROR_DBUS_CALL; return GEOFENCE_MANAGER_ERROR_NONE; } @@ -138,7 +129,7 @@ EXPORT_API int remove_place(void *handle, int place_id) int ret = geo_client_delete_place(geofence_manager->geofence_client, geofence_manager->app_id, place_id); if (ret != GEOFENCE_CLIENT_ERROR_NONE) - return ret; + return GEOFENCE_CLIENT_ERROR_DBUS_CALL; return GEOFENCE_MANAGER_ERROR_NONE; } @@ -231,7 +222,7 @@ EXPORT_API int get_place_name(void *handle, int place_id, char **place_name) int error_code = GEOFENCE_MANAGER_ERROR_NONE; int ret = geo_client_get_place_name(geofence_manager->geofence_client, geofence_manager->app_id, place_id, place_name, &error_code); if (ret != GEOFENCE_CLIENT_ERROR_NONE) - return ret; + return GEOFENCE_CLIENT_ERROR_DBUS_CALL; return error_code; } @@ -256,10 +247,10 @@ EXPORT_API int get_geofences(void *handle, int place_id, int *fence_amount, int int error_code = GEOFENCE_MANAGER_ERROR_NONE; int ret = geo_client_get_geofences(geofence_manager->geofence_client, geofence_manager->app_id, place_id, &iter, &fence_cnt, &error_code); - if (ret != GEOFENCE_MANAGER_ERROR_NONE) - return ret; - else if (error_code != GEOFENCE_MANAGER_ERROR_NONE) + if (error_code != GEOFENCE_MANAGER_ERROR_NONE) return error_code; + else if (ret != GEOFENCE_MANAGER_ERROR_NONE) + return GEOFENCE_CLIENT_ERROR_DBUS_CALL; *fence_amount = fence_cnt; MOD_LOGD("Total fence count : %d", *fence_amount); @@ -319,12 +310,10 @@ EXPORT_API int get_places(void *handle, int *place_amount, int **place_ids, plac gchar *key; GVariant *value; int place_cnt = 0; - int error_code = GEOFENCE_MANAGER_ERROR_NONE; + int error_code = -1; /*Call the geofence_client api here....*/ - int ret = geo_client_get_places(geofence_manager->geofence_client, geofence_manager->app_id, &iter, &place_cnt, &error_code); - if (ret != GEOFENCE_MANAGER_ERROR_NONE) - return ret; + geo_client_get_places(geofence_manager->geofence_client, geofence_manager->app_id, &iter, &place_cnt, &error_code); if (error_code != GEOFENCE_MANAGER_ERROR_NONE) return error_code; @@ -385,7 +374,7 @@ EXPORT_API int start_geofence(void *handle, int fence_id) ret = geo_client_start_geofence(geofence_manager->geofence_client, geofence_manager->app_id, fence_id); if (ret != GEOFENCE_MANAGER_ERROR_NONE) { MOD_LOGE("Fail to start geofence_client_h. Error[%d]", ret); - return ret; + return GEOFENCE_CLIENT_ERROR_DBUS_CALL; } return GEOFENCE_MANAGER_ERROR_NONE; @@ -403,7 +392,7 @@ EXPORT_API int stop_geofence(void *handle, int fence_id) ret = geo_client_stop_geofence(geofence_manager->geofence_client, geofence_manager->app_id, fence_id); if (ret != GEOFENCE_MANAGER_ERROR_NONE) { MOD_LOGE("Fail to stop. Error[%d]", ret); - return ret; + return GEOFENCE_CLIENT_ERROR_DBUS_CALL; } return GEOFENCE_MANAGER_ERROR_NONE; |