[TSAM-7930] 1. Add incorrect method errors for setting_changed_cb
[platform/core/api/location-manager.git] / src / locations.c
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) {