summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkj7.sung <kj7.sung@samsung.com>2016-09-20 16:49:35 +0900
committerkj7.sung <kj7.sung@samsung.com>2016-09-27 13:18:24 +0900
commit9bc92f359debf258a9ead2e050672d1771253ef4 (patch)
tree5e14580d76317a5cec5651a304d3862e7b30d423
parenta8eab71b77cdb2cd0f43ebfe2094ee3944ca610a (diff)
downloadlocation-manager-accepted/tizen/common/20160928.163735.tar.gz
location-manager-accepted/tizen/common/20160928.163735.tar.bz2
location-manager-accepted/tizen/common/20160928.163735.zip
2. Add description regarding batching period Signed-off-by: kj7.sung <kj7.sung@samsung.com> Change-Id: I0967da8a6f9bf708a34d73b569f2675200ad7bac
-rwxr-xr-xinclude/locations.h23
-rwxr-xr-xsrc/locations.c12
2 files changed, 23 insertions, 12 deletions
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) {