From: kj7.sung Date: Tue, 20 Sep 2016 07:49:35 +0000 (+0900) Subject: [TSAM-7930] 1. Add incorrect method errors for setting_changed_cb X-Git-Tag: accepted/tizen/3.0/common/20161114.105223^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fapi%2Flocation-manager.git;a=commitdiff_plain;h=9bc92f359debf258a9ead2e050672d1771253ef4 [TSAM-7930] 1. Add incorrect method errors for setting_changed_cb 2. Add description regarding batching period Signed-off-by: kj7.sung Change-Id: I0967da8a6f9bf708a34d73b569f2675200ad7bac --- diff --git a/include/locations.h b/include/locations.h index 952e27f..ee5f870 100755 --- a/include/locations.h +++ b/include/locations.h @@ -688,7 +688,7 @@ int location_manager_get_accessibility_state(location_accessibility_state_e *sta * @return @c 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @post location_position_updated_cb() will be invoked * @see location_manager_unset_position_updated_cb() * @see location_position_updated_cb() @@ -702,7 +702,7 @@ int location_manager_set_position_updated_cb(location_manager_h manager, locatio * @return @c 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @see location_manager_set_position_updated_cb() */ int location_manager_unset_position_updated_cb(location_manager_h manager); @@ -717,7 +717,7 @@ int location_manager_unset_position_updated_cb(location_manager_h manager); * @return @c 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @post location_velocity_updated_cb() will be invoked * @see location_manager_unset_velocity_updated_cb() * @see location_velocity_updated_cb() @@ -731,7 +731,7 @@ int location_manager_set_velocity_updated_cb(location_manager_h manager, locatio * @return @c 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @see location_manager_set_velocity_updated_cb() */ int location_manager_unset_velocity_updated_cb(location_manager_h manager); @@ -745,7 +745,7 @@ int location_manager_unset_velocity_updated_cb(location_manager_h manager); * @return @c 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @post location_service_state_changed_cb() will be invoked * @see location_manager_unset_service_state_changed_cb() * @see location_service_state_changed_cb() @@ -762,7 +762,7 @@ int location_manager_set_service_state_changed_cb(location_manager_h manager, lo * @return @c 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @see location_manager_set_service_state_changed_cb() */ int location_manager_unset_service_state_changed_cb(location_manager_h manager); @@ -777,7 +777,7 @@ int location_manager_unset_service_state_changed_cb(location_manager_h manager); * @return @c 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @pre location_manager_add_boundary() is called before. * @post location_zone_changed_cb() will be invoked * @see location_manager_unset_zone_changed_cb() @@ -792,7 +792,7 @@ int location_manager_set_zone_changed_cb(location_manager_h manager, location_zo * @return 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @see location_manager_set_zone_changed_cb() */ int location_manager_unset_zone_changed_cb(location_manager_h manager); @@ -806,7 +806,8 @@ int location_manager_unset_zone_changed_cb(location_manager_h manager); * @return 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @post location_setting_changed_cb() will be invoked * @see location_manager_unset_setting_changed_cb() * @see location_setting_changed_cb() @@ -820,7 +821,8 @@ int location_manager_set_setting_changed_cb(location_method_e method, location_s * @return 0 on success, otherwise a negative error value * @retval #LOCATIONS_ERROR_NONE Successful * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported + * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method + * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported * @see location_manager_set_setting_changed_cb() */ int location_manager_unset_setting_changed_cb(location_method_e method); @@ -903,6 +905,7 @@ int location_manager_unset_location_changed_cb(location_manager_h manager); * @brief Registers a callback function to be invoked when batch_period is expired. * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif * @remarks The batch_period should be greater than or equal to the batch_interval. + * In addition, sometimes the period may not work as you intended, the maximum permissible value for batch_period is device specific. * @param[in] manager The location manager handle * @param[in] callback The callback function to register * @param[in] batch_interval The batch sampling interval [1 ~ 255] (seconds) diff --git a/src/locations.c b/src/locations.c index b148c9a..9313bcf 100755 --- a/src/locations.c +++ b/src/locations.c @@ -1184,8 +1184,12 @@ EXPORT_API int location_manager_set_setting_changed_cb(location_method_e method, LocationMethod _method = __convert_LocationMethod(method); int ret = LOCATION_ERROR_NONE; - if (_method == LOCATION_METHOD_NONE) + if (_method == LOCATION_METHOD_NONE) { return __convert_error_code(LOCATION_ERROR_PARAMETER); + } else if (_method == LOCATION_METHOD_PASSIVE) { + LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD"); + return LOCATIONS_ERROR_INCORRECT_METHOD; + } g_location_setting[_method].callback = callback; g_location_setting[_method].user_data = user_data; @@ -1204,8 +1208,12 @@ EXPORT_API int location_manager_unset_setting_changed_cb(location_method_e metho LocationMethod _method = __convert_LocationMethod(method); int ret = LOCATION_ERROR_NONE; - if (_method == LOCATION_METHOD_NONE) + if (_method == LOCATION_METHOD_NONE) { return __convert_error_code(LOCATION_ERROR_PARAMETER); + } else if (_method == LOCATION_METHOD_PASSIVE) { + LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD"); + return LOCATIONS_ERROR_INCORRECT_METHOD; + } ret = location_ignore_setting_notify(_method, __setting_changed_cb); if (ret != LOCATION_ERROR_NONE) {