Tizen 2.4 SDK Rev6 Release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20160530.220526 submit/tizen_2.4/20160530.023240
authorJaekyu Park <jk7744.park@samsung.com>
Fri, 27 May 2016 08:04:47 +0000 (17:04 +0900)
committerJaekyu Park <jk7744.park@samsung.com>
Fri, 27 May 2016 08:04:47 +0000 (17:04 +0900)
include/geofence_manager.h
src/geofence_manager.c

index 8ca12fb..6b58226 100644 (file)
@@ -437,6 +437,7 @@ int geofence_manager_get_place_name(geofence_manager_h manager, int place_id, ch
  * @return 0 on success, otherwise a negative error value
  * @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
  * @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
  * @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
  * @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
  * @see geofence_create_bluetooth()
@@ -458,6 +459,7 @@ int geofence_create_geopoint(int place_id, double latitude, double longitude, in
  * @return 0 on success, otherwise a negative error value
  * @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
  * @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
  * @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
  * @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
  * @see geofence_create_geopoint()
@@ -479,6 +481,7 @@ int geofence_create_bluetooth(int place_id, const char *bssid, const char *ssid,
  * @return 0 on success, otherwise a negative error value
  * @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
  * @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
  * @retval #GEOFENCE_MANAGER_ERROR_EXCEPTION Exception occurred
  * @retval #GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED Access to specified place is denied
  * @see geofence_create_geopoint()
@@ -496,6 +499,7 @@ int geofence_create_wifi(int place_id, const char *bssid, const char *ssid, geof
  * @return 0 on success, otherwise a negative error value
  * @retval #GEOFENCE_MANAGER_ERROR_NONE Successful
  * @retval #GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER Illegal argument
+ * @retval #GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
  * @see geofence_create_geopoint()
  * @see geofence_create_bluetooth()
  * @see geofence_create_wifi()
index df28874..d72aad0 100644 (file)
@@ -794,6 +794,13 @@ EXPORT_API int geofence_create_geopoint(int place_id, double latitude, double lo
        if (__is_geofence_feature_enabled() == false)
                        return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
 
+       int ret = GEOFENCE_MANAGER_ERROR_NONE;
+       ret = geofence_get_privacy();
+       if (ret != GEOFENCE_MANAGER_ERROR_NONE) {
+               GEOFENCE_LOGE("Cannot use geofence service for privacy[%d]", ret);
+               return __print_error_code(GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED);
+       }
+
        GEOFENCE_NULL_ARG_CHECK(fence);
        GEOFENCE_NULL_ARG_CHECK(address);
        GEOFENCE_CHECK_CONDITION(place_id > 0, GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER, "GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER");
@@ -812,6 +819,13 @@ EXPORT_API int geofence_create_bluetooth(int place_id, const char *bssid, const
        if (__is_geofence_feature_enabled() == false)
                        return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
 
+       int ret = GEOFENCE_MANAGER_ERROR_NONE;
+       ret = geofence_get_privacy();
+       if (ret != GEOFENCE_MANAGER_ERROR_NONE) {
+               GEOFENCE_LOGE("Cannot use geofence service for privacy[%d]", ret);
+               return __print_error_code(GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED);
+       }
+
        GEOFENCE_NULL_ARG_CHECK(fence);
        GEOFENCE_NULL_ARG_CHECK(bssid);
        GEOFENCE_NULL_ARG_CHECK(ssid);
@@ -828,6 +842,13 @@ EXPORT_API int geofence_create_wifi(int place_id, const char *bssid, const char
        if (__is_geofence_feature_enabled() == false)
                        return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
 
+       int ret = GEOFENCE_MANAGER_ERROR_NONE;
+       ret = geofence_get_privacy();
+       if (ret != GEOFENCE_MANAGER_ERROR_NONE) {
+               GEOFENCE_LOGE("Cannot use geofence service for privacy[%d]", ret);
+               return __print_error_code(GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED);
+       }
+
        GEOFENCE_NULL_ARG_CHECK(fence);
        GEOFENCE_NULL_ARG_CHECK(bssid);
        GEOFENCE_NULL_ARG_CHECK(ssid);
@@ -842,6 +863,13 @@ EXPORT_API int geofence_destroy(geofence_h fence)
        if (__is_geofence_feature_enabled() == false)
                        return GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED;
 
+       int ret = GEOFENCE_MANAGER_ERROR_NONE;
+       ret = geofence_get_privacy();
+       if (ret != GEOFENCE_MANAGER_ERROR_NONE) {
+               GEOFENCE_LOGE("Cannot use geofence service for privacy[%d]", ret);
+               return __print_error_code(GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED);
+       }
+
        GEOFENCE_NULL_ARG_CHECK(fence);
        geofence_parameter_free((geofence_s *)fence);
        return GEOFENCE_MANAGER_ERROR_NONE;