[TSAM-7930] 1. Add incorrect method errors for setting_changed_cb 75/88675/2 accepted/tizen/3.0/common/20161114.105223 accepted/tizen/3.0/ivi/20161011.050503 accepted/tizen/3.0/mobile/20161015.032200 accepted/tizen/3.0/tv/20161016.003326 accepted/tizen/3.0/wearable/20161015.080321 accepted/tizen/common/20160928.163735 accepted/tizen/ivi/20160929.001806 accepted/tizen/mobile/20160929.001645 accepted/tizen/tv/20160929.001831 accepted/tizen/wearable/20160929.001755 submit/tizen/20160928.024352 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000004 submit/tizen_3.0_mobile/20161015.000000 submit/tizen_3.0_tv/20161015.000000 submit/tizen_3.0_wearable/20161015.000000
authorkj7.sung <kj7.sung@samsung.com>
Tue, 20 Sep 2016 07:49:35 +0000 (16:49 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Tue, 27 Sep 2016 04:18:24 +0000 (13:18 +0900)
2. Add description regarding batching period

Signed-off-by: kj7.sung <kj7.sung@samsung.com>
Change-Id: I0967da8a6f9bf708a34d73b569f2675200ad7bac

include/locations.h
src/locations.c

index 952e27f..ee5f870 100755 (executable)
@@ -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)
index b148c9a..9313bcf 100755 (executable)
@@ -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) {