Remove unused code about test application
[platform/core/api/location-manager.git] / src / locations.c
index 0eb9de5..5fdab0d 100755 (executable)
 #include "locations.h"
 #include "location_internal.h"
 
-static location_setting_changed_s g_location_setting[LOCATIONS_METHOD_MOCK + 1];
+static location_setting_changed_s g_location_setting[LOCATIONS_METHOD_PASSIVE + 1];
 
 static location_method_e __convert_location_method_e(LocationMethod method)
 {
-       location_method_e _method = LOCATIONS_METHOD_NONE;
+       location_method_e _method = LOCATIONS_METHOD_NONE;      //LCOV_EXCL_LINE
        switch (method) {
        case LOCATION_METHOD_HYBRID:
                _method = LOCATIONS_METHOD_HYBRID;
@@ -56,8 +56,8 @@ static LocationMethod __convert_LocationMethod(location_method_e method)
        case LOCATIONS_METHOD_WPS:
                _method = LOCATION_METHOD_WPS;
                break;
-       case LOCATIONS_METHOD_MOCK:
-               _method = LOCATION_METHOD_MOCK;
+       case LOCATIONS_METHOD_PASSIVE:
+               _method = LOCATION_METHOD_PASSIVE;
                break;
        case LOCATIONS_METHOD_NONE:
        default:
@@ -69,26 +69,28 @@ static LocationMethod __convert_LocationMethod(location_method_e method)
 
 static void __cb_service_updated(GObject *self, guint type, gpointer data, gpointer velocity, gpointer accuracy, gpointer userdata)
 {
-       LOCATIONS_LOGD("Callback function has been invoked. ");
        location_manager_s *handle = (location_manager_s *) userdata;
 
        if (type == SATELLITE_UPDATED && handle->user_cb[_LOCATIONS_EVENT_TYPE_SATELLITE]) {
                LocationSatellite *sat = (LocationSatellite *)data;
-               LOCATIONS_LOGD("Current satellite information: timestamp : %d, number of active : %d, number of inview : %d",
+               LOCATIONS_LOGD("callback invoked[TYPE_SATELLITE] timestamp : %d, number of active : %d, number of inview : %d",
                                                sat->timestamp, sat->num_of_sat_used, sat->num_of_sat_inview);
                ((gps_status_satellite_updated_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_SATELLITE])(sat->num_of_sat_used, sat->num_of_sat_inview,
                                                                                        sat->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_SATELLITE]);
        } else if (type == DISTANCE_UPDATED && handle->user_cb[_LOCATIONS_EVENT_TYPE_DISTANCE]) {
                LocationPosition *pos = (LocationPosition *) data;
-               LocationVelocity *vel = (LocationVelocity *) velocity;  /* current velocity */
-               ((location_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_DISTANCE])(0, pos->latitude, pos->longitude, pos->altitude,
-                                                               vel->speed, vel->direction, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_DISTANCE]);
+               LocationVelocity *vel = (LocationVelocity *) velocity;
+               LocationAccuracy *acc = (LocationAccuracy *) accuracy;
+               ((location_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_DISTANCE])(pos->latitude, pos->longitude, pos->altitude,
+                                                               vel->speed, vel->direction, acc->horizontal_accuracy, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_DISTANCE]);
+               LOCATIONS_LOGD("callback invoked[TYPE_DISTANCE] timestamp : %d", pos->timestamp);
        } else {
 
                if (handle->user_cb[_LOCATIONS_EVENT_TYPE_POSITION] && (type & POSITION_UPDATED) != 0) {
                        LocationPosition *pos = (LocationPosition *) data;
                        ((location_position_updated_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_POSITION])(pos->latitude, pos->longitude, pos->altitude,
                                                                                        pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_POSITION]);
+                       LOCATIONS_LOGD("callback invoked[TYPE_POSITION] timestamp : %d", pos->timestamp);
                }
 
                if (handle->user_cb[_LOCATIONS_EVENT_TYPE_VELOCITY] && (type & VELOCITY_UPDATED) != 0) {
@@ -103,28 +105,46 @@ static void __cb_service_updated(GObject *self, guint type, gpointer data, gpoin
                        LocationAccuracy *acc = (LocationAccuracy *) accuracy;
                        ((location_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_POS_VEL])(pos->latitude, pos->longitude, pos->altitude,
                                                                        vel->speed, vel->direction, acc->horizontal_accuracy, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_POS_VEL]);
+                       LOCATIONS_LOGD("callback invoked[TYPE_POS_VEL] timestamp : %d", pos->timestamp);
                }
        }
 }
 
 static void __cb_location_updated(GObject *self, int error, gpointer position, gpointer velocity, gpointer accuracy, gpointer userdata)
 {
-       LOCATIONS_LOGD("Callback function has been invoked. ");
        int converted_err = __convert_error_code(error);
        location_manager_s *handle = (location_manager_s *) userdata;
        LocationPosition *pos = (LocationPosition *) position;
        LocationVelocity *vel = (LocationVelocity *) velocity;
 
-       LOCATIONS_LOGD("Current position: timestamp : %d", pos->timestamp);
+       LOCATIONS_LOGD("Callback function[TYPE_LOCATION: single]  timestamp : %d, error : %d", pos->timestamp, error);
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_LOCATION]) {
                ((location_updated_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_LOCATION])(converted_err, pos->latitude, pos->longitude, pos->altitude,
-                                                                                                                                                               pos->timestamp, vel->speed, vel->climb, vel->direction, handle->user_data[_LOCATIONS_EVENT_TYPE_LOCATION]);
+                                                               pos->timestamp, vel->speed, vel->direction, vel->climb, handle->user_data[_LOCATIONS_EVENT_TYPE_LOCATION]);
+       }
+
+       if (error != LOCATION_ERROR_NONE) {
+//LCOV_EXCL_START
+               location_position_free(pos);
+               location_velocity_free(vel);
+//LCOV_EXCL_STOP
        }
 }
 
+//LCOV_EXCL_START
+static void __cb_batch_updated(GObject *self, guint num_of_location, gpointer userdata)
+{
+       LOCATIONS_LOGD("Batch callback function has been invoked.");
+       location_manager_s *handle = (location_manager_s *) userdata;
+
+       if (handle->user_cb[_LOCATIONS_EVENT_TYPE_BATCH])
+               ((location_batch_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_BATCH])(num_of_location, handle->user_data[_LOCATIONS_EVENT_TYPE_BATCH]);
+}
+//LCOV_EXCL_STOP
+
 static void __cb_service_enabled(GObject *self, guint status, gpointer userdata)
 {
-       LOCATIONS_LOGD("Invoked. status = %d", status);
+       LOCATIONS_LOGD("Invoked[service_enabled]. status = %d", status);
        location_manager_s *handle = (location_manager_s *) userdata;
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]) {
                ((location_service_state_changed_cb)
@@ -134,7 +154,7 @@ static void __cb_service_enabled(GObject *self, guint status, gpointer userdata)
 
 static void __cb_service_disabled(GObject *self, guint status, gpointer userdata)
 {
-       LOCATIONS_LOGD("Invoked. status = %d", status);
+       LOCATIONS_LOGD("Invoked[service_disabled]. status = %d", status);
        location_manager_s *handle = (location_manager_s *) userdata;
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]) {
                ((location_service_state_changed_cb)
@@ -142,32 +162,12 @@ static void __cb_service_disabled(GObject *self, guint status, gpointer userdata
        }
 }
 
-#if 0
-static void __cb_service_status_changed(GObject *self, guint status, gpointer userdata)
-{
-       LOCATIONS_LOGD("Invoked. status = %u", status);
-       location_manager_s *handle = (location_manager_s *) userdata;
-
-       if (handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]) {
-               if (status == LOCATION_STATUS_2D_FIX || status == LOCATION_STATUS_3D_FIX)
-                       ((location_service_state_changed_cb)
-                        handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE])(LOCATIONS_SERVICE_ENABLED, handle->user_data[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]);
-               else if (status == LOCATION_STATUS_NO_FIX)
-                       ((location_service_state_changed_cb)
-                                handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE])(LOCATIONS_SERVICE_DISABLED, handle->user_data[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]);
-               else if (status == LOCATION_STATUS_MOCK_FAIL)
-                       ((location_service_state_changed_cb)
-                                handle->user_cb[_LOCATIONS_EVENT_TYPE_SERVICE_STATE])(LOCATIONS_SERVICE_ERROR, handle->user_data[_LOCATIONS_EVENT_TYPE_SERVICE_STATE]);
-       }
-}
-#endif
-
 static int __compare_position(gconstpointer a, gconstpointer b)
 {
        if (location_position_equal((LocationPosition *) a, (LocationPosition *)b) == TRUE)
                return 0;
 
-       return -1;
+       return -1;      //LCOV_EXCL_LINE
 }
 
 static int __boundary_compare(LocationBoundary *bound1, LocationBoundary *bound2)
@@ -245,10 +245,7 @@ static void __cb_zone_in(GObject *self, gpointer boundary, gpointer position, gp
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_BOUNDARY]) {
                LocationPosition *pos = (LocationPosition *) position;
                ((location_zone_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_BOUNDARY])(LOCATIONS_BOUNDARY_IN,
-                                                                                                                                                                       pos->latitude, pos->longitude,
-                                                                                                                                                                       pos->altitude, pos->timestamp,
-                                                                                                                                                                       handle->user_data
-                                                                                                                                                                       [_LOCATIONS_EVENT_TYPE_BOUNDARY]);
+                                               pos->latitude, pos->longitude, pos->altitude, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_BOUNDARY]);
        }
 
        location_bounds_s *bounds;
@@ -274,10 +271,7 @@ static void __cb_zone_out(GObject *self, gpointer boundary, gpointer position, g
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_BOUNDARY]) {
                LocationPosition *pos = (LocationPosition *) position;
                ((location_zone_changed_cb) handle->user_cb[_LOCATIONS_EVENT_TYPE_BOUNDARY])(LOCATIONS_BOUNDARY_OUT,
-                                                                                                                                                                       pos->latitude, pos->longitude,
-                                                                                                                                                                       pos->altitude, pos->timestamp,
-                                                                                                                                                                       handle->user_data
-                                                                                                                                                                       [_LOCATIONS_EVENT_TYPE_BOUNDARY]);
+                                               pos->latitude, pos->longitude, pos->altitude, pos->timestamp, handle->user_data[_LOCATIONS_EVENT_TYPE_BOUNDARY]);
        }
 
        location_bounds_s *bounds;
@@ -336,7 +330,7 @@ static void __foreach_boundary(LocationBoundary *boundary, void *user_data)
                }
 
                if (ret != LOCATIONS_ERROR_NONE) {
-                       LOCATIONS_LOGI("Failed to create location_bounds : (0x%08x) ", ret);
+                       LOCATIONS_LOGI("Failed to create location_bounds : (0x%08x) ", ret);    //LCOV_EXCL_LINE
                } else {
                        if (handle->is_continue_foreach_bounds) {
                                handle->is_continue_foreach_bounds =
@@ -348,10 +342,11 @@ static void __foreach_boundary(LocationBoundary *boundary, void *user_data)
                        location_bounds_destroy(bounds);
                }
        } else {
-               LOCATIONS_LOGD("__foreach_boundary() has been failed");
+               LOCATIONS_LOGD("__foreach_boundary() has been failed"); //LCOV_EXCL_LINE
        }
 }
 
+//LCOV_EXCL_START
 static void __setting_changed_cb(LocationMethod method, gboolean enable, void *user_data)
 {
        LOCATIONS_LOGD("method: [%d]", method);
@@ -365,6 +360,7 @@ static void __setting_changed_cb(LocationMethod method, gboolean enable, void *u
        if (_setting_changed[_method].callback != NULL)
                _setting_changed[_method].callback(_method, enable, _setting_changed[_method].user_data);
 }
+//LCOV_EXCL_STOP
 
 /*/////////////////////////////////////// */
 /* Location Manager */
@@ -374,14 +370,14 @@ EXPORT_API bool location_manager_is_supported_method(location_method_e method)
 {
        LOCATIONS_LOGD("location_manager_is_supported_method %d", method);
        if (__is_location_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
-               set_last_result(LOCATIONS_ERROR_NOT_SUPPORTED);
-               return false;
+               set_last_result(LOCATIONS_ERROR_NOT_SUPPORTED); //LCOV_EXCL_LINE
+               return false;   //LCOV_EXCL_LINE
        }
 
        if (method == LOCATIONS_METHOD_GPS) {
                if (__is_gps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
-                       set_last_result(LOCATIONS_ERROR_NOT_SUPPORTED);
-                       return false;
+                       set_last_result(LOCATIONS_ERROR_NOT_SUPPORTED); //LCOV_EXCL_LINE
+                       return false;   //LCOV_EXCL_LINE
                }
        } else if (method == LOCATIONS_METHOD_WPS) {
                if (__is_wps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
@@ -397,15 +393,21 @@ EXPORT_API bool location_manager_is_supported_method(location_method_e method)
                return false;
        }
 
-       set_last_result(LOCATIONS_ERROR_NONE);
-       return location_is_supported_method(_method);
+       gboolean ret =  location_is_supported_method(_method);
+       if (ret) {
+               set_last_result(LOCATIONS_ERROR_NONE);
+               return true;
+       } else {
+               set_last_result(LOCATIONS_ERROR_NOT_SUPPORTED);
+               return false;
+       }
 }
 
 EXPORT_API int location_manager_is_enabled_method(location_method_e method, bool *enable)
 {
        LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
 
-       if (method < LOCATIONS_METHOD_HYBRID || method > LOCATIONS_METHOD_MOCK) {
+       if (method < LOCATIONS_METHOD_HYBRID || method > LOCATIONS_METHOD_WPS) {
                LOCATIONS_LOGE("Not supported method [%d]", method);
                return LOCATIONS_ERROR_INCORRECT_METHOD;
        }
@@ -416,10 +418,15 @@ EXPORT_API int location_manager_is_enabled_method(location_method_e method, bool
        LocationMethod _method = __convert_LocationMethod(method);
        int ret = location_is_enabled_method(_method, &is_enabled_val);
        if (ret != LOCATION_ERROR_NONE) {
-               if (ret == LOCATION_ERROR_NOT_SUPPORTED)
+               //LCOV_EXCL_START
+               if (ret == LOCATION_ERROR_NOT_SUPPORTED) {
+                       LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD");
                        return LOCATIONS_ERROR_INCORRECT_METHOD;
+               }
                return __convert_error_code(ret);
+               //LCOV_EXCL_STOP
        }
+
        if (is_enabled_val == -1)
                return TIZEN_ERROR_PERMISSION_DENIED;
 
@@ -427,11 +434,12 @@ EXPORT_API int location_manager_is_enabled_method(location_method_e method, bool
        return LOCATIONS_ERROR_NONE;
 }
 
+//LCOV_EXCL_START
 EXPORT_API int location_manager_enable_method(const location_method_e method, const bool enable)
 {
        LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
 
-       if (method < LOCATIONS_METHOD_HYBRID || method > LOCATIONS_METHOD_MOCK) {
+       if (method < LOCATIONS_METHOD_HYBRID || method > LOCATIONS_METHOD_WPS) {
                LOCATIONS_LOGE("Not supported method [%d]", method);
                return LOCATIONS_ERROR_INCORRECT_METHOD;
        }
@@ -450,9 +458,6 @@ EXPORT_API int location_manager_enable_method(const location_method_e method, co
                }
                return LOCATIONS_ERROR_NONE;
 
-       } else if (LOCATIONS_METHOD_MOCK == method) {
-               ret = location_enable_mock(LOCATION_METHOD_MOCK, enable);
-               return __convert_error_code(ret);
        } else  {
                if ((LOCATIONS_METHOD_GPS == method) && (__is_gps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED)) {
                        LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x)", LOCATIONS_ERROR_NOT_SUPPORTED);
@@ -469,29 +474,20 @@ EXPORT_API int location_manager_enable_method(const location_method_e method, co
                return __convert_error_code(ret);
        }
 }
+//LCOV_EXCL_STOP
 
 EXPORT_API int location_manager_create(location_method_e method, location_manager_h *manager)
 {
        LOCATIONS_LOGD("location_manager_create (method : %d)", method);
 
-       if (method == LOCATIONS_METHOD_HYBRID) {
+       if (method == LOCATIONS_METHOD_HYBRID)
+               LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
+       else if (method == LOCATIONS_METHOD_GPS)
+               LOCATIONS_NOT_SUPPORTED_CHECK(__is_gps_supported());
+       else if (method == LOCATIONS_METHOD_WPS)
+               LOCATIONS_NOT_SUPPORTED_CHECK(__is_wps_supported());
+       else if (method == LOCATIONS_METHOD_PASSIVE)
                LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
-       } else if (method == LOCATIONS_METHOD_GPS) {
-               if (__is_gps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
-                       LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x) : fail to location feature", LOCATIONS_ERROR_NOT_SUPPORTED);
-                       return LOCATIONS_ERROR_NOT_SUPPORTED;
-               }
-       } else if (method == LOCATIONS_METHOD_WPS) {
-               if (__is_wps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
-                       LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x) : fail to location feature", LOCATIONS_ERROR_NOT_SUPPORTED);
-                       return LOCATIONS_ERROR_NOT_SUPPORTED;
-               }
-       } else if (method == LOCATIONS_METHOD_MOCK) {
-               if (__is_gps_supported() == LOCATIONS_ERROR_NOT_SUPPORTED) {
-                       LOCATIONS_LOGE("LOCATIONS_ERROR_NOT_SUPPORTED(0x%08x) : fail to location feature", LOCATIONS_ERROR_NOT_SUPPORTED);
-                       return LOCATIONS_ERROR_NOT_SUPPORTED;
-               }
-       }
 
        LocationMethod _method = __convert_LocationMethod(method);
        if (_method == LOCATION_METHOD_NONE) {
@@ -508,23 +504,25 @@ EXPORT_API int location_manager_create(location_method_e method, location_manage
        LOCATIONS_NULL_ARG_CHECK(manager);
 
        if (location_init() != LOCATION_ERROR_NONE) {
-               LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : fail to location_init", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE);
-               return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
+               LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : fail to location_init", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE); //LCOV_EXCL_LINE
+               return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;   //LCOV_EXCL_LINE
        }
 
        location_manager_s *handle = (location_manager_s *) malloc(sizeof(location_manager_s));
        if (handle == NULL) {
-               LOCATIONS_LOGE("OUT_OF_MEMORY(0x%08x)", LOCATIONS_ERROR_OUT_OF_MEMORY);
-               return LOCATIONS_ERROR_OUT_OF_MEMORY;
+               LOCATIONS_LOGE("OUT_OF_MEMORY(0x%08x)", LOCATIONS_ERROR_OUT_OF_MEMORY); //LCOV_EXCL_LINE
+               return LOCATIONS_ERROR_OUT_OF_MEMORY;   //LCOV_EXCL_LINE
        }
 
        memset(handle, 0, sizeof(location_manager_s));
 
        handle->object = location_new(_method);
        if (handle->object == NULL) {
+               //LCOV_EXCL_START
                LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : fail to location_new", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE);
                free(handle);
                return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
+               //LCOV_EXCL_STOP
        }
        handle->method = method;
        handle->is_continue_foreach_bounds = TRUE;
@@ -536,11 +534,6 @@ EXPORT_API int location_manager_create(location_method_e method, location_manage
        if (!handle->sig_id[_LOCATION_SIGNAL_SERVICE_DISABLED])
                handle->sig_id[_LOCATION_SIGNAL_SERVICE_DISABLED] = g_signal_connect(handle->object, "service-disabled", G_CALLBACK(__cb_service_disabled), handle);
 
-#if 0
-       if (!handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED])
-               handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED] = g_signal_connect(handle->object, "status-changed", G_CALLBACK(__cb_service_status_changed), handle);
-#endif
-
        *manager = (location_manager_h) handle;
        return LOCATIONS_ERROR_NONE;
 }
@@ -552,7 +545,6 @@ EXPORT_API int location_manager_destroy(location_manager_h manager)
        LOCATIONS_NULL_ARG_CHECK(manager);
        location_manager_s *handle = (location_manager_s *) manager;
 
-
        if (handle->sig_id[_LOCATION_SIGNAL_SERVICE_ENABLED]) {
                g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_SERVICE_ENABLED]);
                handle->sig_id[_LOCATION_SIGNAL_SERVICE_ENABLED] = 0;
@@ -563,21 +555,14 @@ EXPORT_API int location_manager_destroy(location_manager_h manager)
                handle->sig_id[_LOCATION_SIGNAL_SERVICE_DISABLED] = 0;
        }
 
-#if 0
-       if (handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED]) {
-               g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED]);
-               handle->sig_id[_LOCATION_SIGNAL_STATUS_CHANGED] = 0;
-       }
-#endif
-
        if (handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED]) {
-               g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED]);
-               handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED] = 0;
+               g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED]);    //LCOV_EXCL_LINE
+               handle->sig_id[_LOCATION_SIGNAL_ERROR_EMITTED] = 0;     //LCOV_EXCL_LINE
        }
 
        int ret = location_free(handle->object);
        if (ret != LOCATIONS_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        free(handle);
        return LOCATIONS_ERROR_NONE;
@@ -593,14 +578,14 @@ EXPORT_API int location_manager_start(location_manager_h manager)
        if (!handle->sig_id[_LOCATION_SIGNAL_SERVICE_UPDATED])
                handle->sig_id[_LOCATION_SIGNAL_SERVICE_UPDATED] = g_signal_connect(handle->object, "service-updated", G_CALLBACK(__cb_service_updated), handle);
 
-       if (handle->method >= LOCATIONS_METHOD_HYBRID && handle->method <= LOCATIONS_METHOD_MOCK) {
+       if (handle->method >= LOCATIONS_METHOD_HYBRID && handle->method <= LOCATIONS_METHOD_PASSIVE) {
                if (!handle->sig_id[_LOCATION_SIGNAL_ZONE_IN])
                        handle->sig_id[_LOCATION_SIGNAL_ZONE_IN] = g_signal_connect(handle->object, "zone-in", G_CALLBACK(__cb_zone_in), handle);
 
                if (!handle->sig_id[_LOCATION_SIGNAL_ZONE_OUT])
                        handle->sig_id[_LOCATION_SIGNAL_ZONE_OUT] = g_signal_connect(handle->object, "zone-out", G_CALLBACK(__cb_zone_out), handle);
        } else {
-               LOCATIONS_LOGI("This method [%d] is not supported zone-in, zone-out signal.", handle->method);
+               LOCATIONS_LOGI("This method [%d] is not supported zone-in, zone-out signal.", handle->method);  //LCOV_EXCL_LINE
        }
 
        if (handle->user_cb[_LOCATIONS_EVENT_TYPE_SATELLITE] != NULL) {
@@ -610,7 +595,7 @@ EXPORT_API int location_manager_start(location_manager_h manager)
 
        int ret = location_start(handle->object);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        return LOCATIONS_ERROR_NONE;
 }
@@ -637,8 +622,15 @@ EXPORT_API int location_manager_request_single_location(location_manager_h manag
                return ret;
 
        ret = location_request_single_location(handle->object, timeout);
-       if (ret != LOCATION_ERROR_NONE)
+       if (ret != LOCATION_ERROR_NONE) {
+               //LCOV_EXCL_START
+               if (ret == LOCATION_ERROR_NOT_SUPPORTED) {
+                       LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD : method - %d", handle->method);
+                       return LOCATIONS_ERROR_INCORRECT_METHOD;
+               }
                return __convert_error_code(ret);
+               //LCOV_EXCL_STOP
+       }
 
        return LOCATIONS_ERROR_NONE;
 }
@@ -656,7 +648,7 @@ EXPORT_API int location_manager_stop(location_manager_h manager)
                handle->sig_id[_LOCATION_SIGNAL_SERVICE_UPDATED] = 0;
        }
 
-       if (handle->method >= LOCATIONS_METHOD_HYBRID && handle->method <= LOCATIONS_METHOD_MOCK) {
+       if (handle->method >= LOCATIONS_METHOD_HYBRID && handle->method <= LOCATIONS_METHOD_PASSIVE) {
                if (handle->sig_id[_LOCATION_SIGNAL_ZONE_IN]) {
                        g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_ZONE_IN]);
                        handle->sig_id[_LOCATION_SIGNAL_ZONE_IN] = 0;
@@ -670,7 +662,7 @@ EXPORT_API int location_manager_stop(location_manager_h manager)
 
        int ret = location_stop(handle->object);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        return LOCATIONS_ERROR_NONE;
 }
@@ -686,7 +678,7 @@ EXPORT_API int location_manager_add_boundary(location_manager_h manager, locatio
        location_bounds_s *bound_handle = (location_bounds_s *) bounds;
        int ret = location_boundary_add(handle->object, bound_handle->boundary);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        bound_handle->is_added = TRUE;
        handle->bounds_list = g_list_append(handle->bounds_list, bound_handle);
@@ -704,7 +696,7 @@ EXPORT_API int location_manager_remove_boundary(location_manager_h manager, loca
        location_bounds_s *bound_handle = (location_bounds_s *) bounds;
        int ret = location_boundary_remove(handle->object, bound_handle->boundary);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        handle->bounds_list = g_list_remove(handle->bounds_list, bound_handle);
        bound_handle->is_added = FALSE;
@@ -724,14 +716,14 @@ EXPORT_API int location_manager_foreach_boundary(location_manager_h manager, loc
        handle->is_continue_foreach_bounds = TRUE;
        int ret = location_boundary_foreach(handle->object, __foreach_boundary, handle);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        return LOCATIONS_ERROR_NONE;
 }
 
 EXPORT_API int location_manager_get_method(location_manager_h manager, location_method_e *method)
 {
-       LOCATIONS_LOGD("location_manager_get_method %d", method);
+       LOCATIONS_LOGD("location_manager_get_method");
        LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
        LOCATIONS_NULL_ARG_CHECK(manager);
        LOCATIONS_NULL_ARG_CHECK(method);
@@ -750,14 +742,14 @@ EXPORT_API int location_manager_get_method(location_manager_h manager, location_
                *method = LOCATIONS_METHOD_GPS;
                break;
        case LOCATION_METHOD_WPS:
-               *method = LOCATIONS_METHOD_WPS;
-               break;
-       case LOCATION_METHOD_MOCK:
-               *method = LOCATIONS_METHOD_MOCK;
+               *method = LOCATIONS_METHOD_WPS; //LCOV_EXCL_LINE
+               break;                                                  //LCOV_EXCL_LINE
+       case LOCATION_METHOD_PASSIVE:
+               *method = LOCATIONS_METHOD_PASSIVE;
                break;
        default: {
-               LOCATIONS_LOGE("[LOCATIONS_ERROR_INVALID_PARAMETER] method : %d ", method);
-                       return LOCATIONS_ERROR_INVALID_PARAMETER;
+               LOCATIONS_LOGE("[LOCATIONS_ERROR_INVALID_PARAMETER] invalid method");   //LCOV_EXCL_LINE
+                       return LOCATIONS_ERROR_INVALID_PARAMETER;                                                       //LCOV_EXCL_LINE
                }
        }
        return LOCATIONS_ERROR_NONE;
@@ -775,15 +767,14 @@ EXPORT_API int location_manager_get_position(location_manager_h manager, double
        LOCATIONS_NULL_ARG_CHECK(timestamp);
 
        location_manager_s *handle = (location_manager_s *) manager;
-       int ret;
        LocationPosition *pos = NULL;
        LocationAccuracy *acc = NULL;
-       ret = location_get_position(handle->object, &pos, &acc);
+       int ret = location_get_position(handle->object, &pos, &acc);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        if (pos->status == LOCATION_STATUS_NO_FIX) {
-               return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
+               return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;   //LCOV_EXCL_LINE
        } else {
                *latitude = pos->latitude;
                *longitude = pos->longitude;
@@ -812,16 +803,15 @@ EXPORT_API int location_manager_get_location(location_manager_h manager, double
        LOCATIONS_NULL_ARG_CHECK(timestamp);
 
        location_manager_s *handle = (location_manager_s *) manager;
-       int ret;
        LocationPosition *pos = NULL;
        LocationVelocity *vel = NULL;
        LocationAccuracy *acc = NULL;
-       ret = location_get_position_ext(handle->object, &pos, &vel, &acc);
+       int ret = location_get_position_ext(handle->object, &pos, &vel, &acc);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        if (pos->status == LOCATION_STATUS_NO_FIX) {
-               return __convert_error_code(LOCATION_ERROR_NOT_AVAILABLE);
+               return __convert_error_code(LOCATION_ERROR_NOT_AVAILABLE);      //LCOV_EXCL_LINE
        } else {
                *latitude = pos->latitude;
                *longitude = pos->longitude;
@@ -852,12 +842,12 @@ EXPORT_API int location_manager_get_velocity(location_manager_h manager, double
        LOCATIONS_NULL_ARG_CHECK(timestamp);
 
        location_manager_s *handle = (location_manager_s *) manager;
-       int ret;
        LocationVelocity *vel = NULL;
        LocationAccuracy *acc = NULL;
-       ret = location_get_velocity(handle->object, &vel, &acc);
+
+       int ret = location_get_velocity(handle->object, &vel, &acc);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        *climb = vel->climb;
        *direction = vel->direction;
@@ -884,10 +874,10 @@ EXPORT_API int location_manager_get_accuracy(location_manager_h manager, locatio
        LocationAccuracy *acc = NULL;
        ret = location_get_position(handle->object, &pos, &acc);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        if (acc == NULL)
-               return __convert_error_code(LOCATION_ERROR_NOT_AVAILABLE);
+               return __convert_error_code(LOCATION_ERROR_NOT_AVAILABLE);      //LCOV_EXCL_LINE
 
        *level = acc->level;
        *horizontal = acc->horizontal_accuracy;
@@ -914,7 +904,7 @@ EXPORT_API int location_manager_get_last_position(location_manager_h manager, do
        LocationAccuracy *last_acc = NULL;
        ret = location_get_last_position(handle->object, &last_pos, &last_acc);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        if (last_pos->status == LOCATION_STATUS_NO_FIX) {
                return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
@@ -953,7 +943,7 @@ EXPORT_API int location_manager_get_last_location(location_manager_h manager, do
        LocationAccuracy *last_acc = NULL;
        ret = location_get_last_position_ext(handle->object, &last_pos, &last_vel, &last_acc);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        if (last_pos->status == LOCATION_STATUS_NO_FIX) {
                return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
@@ -992,7 +982,7 @@ EXPORT_API int location_manager_get_last_velocity(location_manager_h manager, do
        LocationAccuracy *last_acc = NULL;
        ret = location_get_last_velocity(handle->object, &last_vel, &last_acc);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        *climb = last_vel->climb;
        *direction = last_vel->direction;
@@ -1018,7 +1008,7 @@ EXPORT_API int location_manager_get_last_accuracy(location_manager_h manager, lo
        LocationAccuracy *last_acc = NULL;
        ret = location_get_last_position(handle->object, &last_pos, &last_acc);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        *level = last_acc->level;
        *horizontal = last_acc->horizontal_accuracy;
@@ -1030,6 +1020,7 @@ EXPORT_API int location_manager_get_last_accuracy(location_manager_h manager, lo
 
 EXPORT_API int location_manager_get_accessibility_state(location_accessibility_state_e *state)
 {
+       dlog_print(DLOG_WARN, LOG_TAG, "DEPRECATION WARNING: location_manager_get_accessibility_state() is deprecated and will be removed from next release.");
        LOCATIONS_LOGD("location_manager_get_accessibility_state");
        LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
        LOCATIONS_NULL_ARG_CHECK(state);
@@ -1038,11 +1029,12 @@ EXPORT_API int location_manager_get_accessibility_state(location_accessibility_s
        LocationAccessState auth = LOCATION_ACCESS_NONE;
        ret = location_get_accessibility_state(&auth);
        if (ret != LOCATION_ERROR_NONE) {
-               *state = LOCATIONS_ACCESS_STATE_NONE;
-               return __convert_error_code(ret);
+               *state = LOCATIONS_ACCESS_STATE_NONE;   //LCOV_EXCL_LINE
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
        }
 
        switch (auth) {
+       //LCOV_EXCL_START
        case LOCATION_ACCESS_DENIED:
                *state = LOCATIONS_ACCESS_STATE_DENIED;
                break;
@@ -1053,6 +1045,7 @@ EXPORT_API int location_manager_get_accessibility_state(location_accessibility_s
        default:
                *state = LOCATIONS_ACCESS_STATE_NONE;
                break;
+       //LCOV_EXCL_STOP
        }
 
        return LOCATIONS_ERROR_NONE;
@@ -1076,9 +1069,6 @@ EXPORT_API int location_manager_unset_distance_based_location_changed_cb(locatio
        LOCATIONS_LOGD("location_manager_unset_distance_updated_cb");
        LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
        LOCATIONS_NULL_ARG_CHECK(manager);
-       location_manager_s *handle = (location_manager_s *) manager;
-       g_object_set(handle->object, "min-interval", 0, NULL);
-       g_object_set(handle->object, "min-distance", 0, NULL);
        return __unset_callback(_LOCATIONS_EVENT_TYPE_DISTANCE, manager);
 }
 
@@ -1174,15 +1164,19 @@ 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");     //LCOV_EXCL_LINE
+               return LOCATIONS_ERROR_INCORRECT_METHOD;        //LCOV_EXCL_LINE
+       }
 
        g_location_setting[_method].callback = callback;
        g_location_setting[_method].user_data = user_data;
 
        ret = location_add_setting_notify(_method, __setting_changed_cb, &g_location_setting);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        return LOCATIONS_ERROR_NONE;
 }
@@ -1194,13 +1188,17 @@ 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");     //LCOV_EXCL_LINE
+               return LOCATIONS_ERROR_INCORRECT_METHOD;        //LCOV_EXCL_LINE
+       }
 
        ret = location_ignore_setting_notify(_method, __setting_changed_cb);
        if (ret != LOCATION_ERROR_NONE) {
-               LOCATIONS_LOGE("Fail to ignore notify. Error[%d]", ret);
-               ret = __convert_error_code(ret);
+               LOCATIONS_LOGE("Fail to ignore notify. Error[%d]", ret);        //LCOV_EXCL_LINE
+               ret = __convert_error_code(ret);        //LCOV_EXCL_LINE
        }
 
        g_location_setting[method].callback = NULL;
@@ -1227,7 +1225,7 @@ EXPORT_API int location_manager_get_distance(double start_latitude, double start
 
        ret = location_get_distance(start, end, &u_distance);
        if (ret != LOCATION_ERROR_NONE)
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        *distance = (double)u_distance;
 
@@ -1249,6 +1247,7 @@ EXPORT_API int gps_status_get_nmea(location_manager_h manager, char **nmea)
 
        int ret = location_get_nmea(handle->object, &nmea_data);
        if (ret != LOCATION_ERROR_NONE || nmea == NULL) {
+               //LCOV_EXCL_START
                if (ret == LOCATION_ERROR_NOT_ALLOWED) {
                        LOCATIONS_LOGE("LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED");
                        return LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED;
@@ -1256,6 +1255,7 @@ EXPORT_API int gps_status_get_nmea(location_manager_h manager, char **nmea)
 
                LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : NMEA is NULL ", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE);
                return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
+               //LCOV_EXCL_STOP
        }
 
        *nmea = g_strdup(nmea_data);
@@ -1276,6 +1276,7 @@ EXPORT_API int gps_status_get_satellite(location_manager_h manager, int *num_of_
        LocationSatellite *sat = NULL;
        int ret = location_get_satellite(handle->object, &sat);
        if (ret != LOCATION_ERROR_NONE || sat == NULL) {
+               //LCOV_EXCL_START
                if (ret == LOCATION_ERROR_NOT_ALLOWED) {
                        LOCATIONS_LOGE("LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED");
                        return LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED;
@@ -1283,6 +1284,7 @@ EXPORT_API int gps_status_get_satellite(location_manager_h manager, int *num_of_
 
                LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : satellite is NULL ", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE);
                return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
+               //LCOV_EXCL_STOP
        }
 
        *num_of_active = sat->num_of_sat_used;
@@ -1304,11 +1306,13 @@ EXPORT_API int gps_status_set_satellite_updated_cb(location_manager_h manager, g
        location_manager_s *handle = (location_manager_s *) manager;
        int ret = location_set_option(handle->object, "USE_SV");
        if (ret != LOCATION_ERROR_NONE) {
+               //LCOV_EXCL_START
                if (ret == LOCATION_ERROR_NOT_ALLOWED) {
                        LOCATIONS_LOGE("LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED");
                        return LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED;
                }
                return ret;
+               //LCOV_EXCL_STOP
        }
        g_object_set(handle->object, "sat-interval", interval, NULL);
        return __set_callback(_LOCATIONS_EVENT_TYPE_SATELLITE, manager, callback, user_data);
@@ -1331,6 +1335,7 @@ EXPORT_API int gps_status_foreach_satellites_in_view(location_manager_h manager,
        location_manager_s *handle = (location_manager_s *) manager;
        LocationSatellite *sat = NULL;
        int ret = location_get_satellite(handle->object, &sat);
+       //LCOV_EXCL_START
        if (ret != LOCATION_ERROR_NONE || sat == NULL) {
                if (ret == LOCATION_ERROR_NOT_SUPPORTED) {
                        LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD(0x%08x) : method - %d", LOCATIONS_ERROR_INCORRECT_METHOD, handle->method);
@@ -1343,6 +1348,7 @@ EXPORT_API int gps_status_foreach_satellites_in_view(location_manager_h manager,
                LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : satellite is NULL ", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE);
                return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
        }
+       //LCOV_EXCL_STOP
 
        int i;
        for (i = 0; i < sat->num_of_sat_inview; i++) {
@@ -1374,6 +1380,7 @@ EXPORT_API int gps_status_get_last_satellite(location_manager_h manager, int *nu
        LocationSatellite *last_sat = NULL;
        ret = location_get_last_satellite(handle->object, &last_sat);
        if (ret != LOCATION_ERROR_NONE || last_sat == NULL) {
+               //LCOV_EXCL_START
                if (ret == LOCATION_ERROR_NOT_SUPPORTED) {
                        LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD(0x%08x) : method - %d", LOCATIONS_ERROR_INCORRECT_METHOD, handle->method);
                        return LOCATIONS_ERROR_INCORRECT_METHOD;
@@ -1384,6 +1391,7 @@ EXPORT_API int gps_status_get_last_satellite(location_manager_h manager, int *nu
 
                LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : satellite is NULL ", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE);
                return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
+               //LCOV_EXCL_STOP
        }
 
        *num_of_active = last_sat->num_of_sat_used;
@@ -1405,6 +1413,7 @@ EXPORT_API int gps_status_foreach_last_satellites_in_view(location_manager_h man
 
        ret = location_get_last_satellite(handle->object, &last_sat);
        if (ret != LOCATION_ERROR_NONE || last_sat == NULL) {
+               //LCOV_EXCL_START
                if (ret == LOCATION_ERROR_NOT_SUPPORTED) {
                        LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD(0x%08x) : method - %d", LOCATIONS_ERROR_INCORRECT_METHOD, handle->method);
                        return LOCATIONS_ERROR_INCORRECT_METHOD;
@@ -1412,6 +1421,7 @@ EXPORT_API int gps_status_foreach_last_satellites_in_view(location_manager_h man
 
                LOCATIONS_LOGE("LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE(0x%08x) : satellite is NULL ", LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE);
                return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
+               //LCOV_EXCL_STOP
        }
 
        int i;
@@ -1433,13 +1443,148 @@ EXPORT_API int gps_status_foreach_last_satellites_in_view(location_manager_h man
 /**
  * Tizen 3.0
  */
+EXPORT_API int location_manager_set_location_batch_cb(location_manager_h manager, location_batch_cb callback, int batch_interval, int batch_period, void *user_data)
+{
+       LOCATIONS_LOGD("location_manager_set_location_batch_cb");
+       LOCATIONS_NOT_SUPPORTED_CHECK(__is_batch_supported());
+
+//LCOV_EXCL_START
+       LOCATIONS_CHECK_CONDITION(batch_interval >= 1 && batch_interval <= 255, LOCATIONS_ERROR_INVALID_PARAMETER, "LOCATIONS_ERROR_INVALID_PARAMETER");
+       LOCATIONS_CHECK_CONDITION(batch_period >= 1 && batch_period <= 60000, LOCATIONS_ERROR_INVALID_PARAMETER, "LOCATIONS_ERROR_INVALID_PARAMETER");
+       LOCATIONS_CHECK_CONDITION(batch_interval <= batch_period, LOCATIONS_ERROR_INVALID_PARAMETER, "LOCATIONS_ERROR_INVALID_PARAMETER");
+       LOCATIONS_NULL_ARG_CHECK(manager);
+       LOCATIONS_NULL_ARG_CHECK(callback);
+       location_manager_s *handle = (location_manager_s *) manager;
+       g_object_set(handle->object, "batch-period", batch_period, NULL);
+       g_object_set(handle->object, "batch-interval", batch_interval, NULL);
+       return __set_callback(_LOCATIONS_EVENT_TYPE_BATCH, manager, callback, user_data);
+//LCOV_EXCL_STOP
+}
+
+EXPORT_API int location_manager_unset_location_batch_cb(location_manager_h manager)
+{
+       LOCATIONS_LOGD("location_manager_unset_location_batch_cb");
+       LOCATIONS_NOT_SUPPORTED_CHECK(__is_batch_supported());
+       return __unset_callback(_LOCATIONS_EVENT_TYPE_BATCH, manager);  //LCOV_EXCL_LINE
+}
+
+EXPORT_API int location_manager_start_batch(location_manager_h manager)
+{
+       LOCATIONS_LOGD("location_manager_start_batch");
+       LOCATIONS_NOT_SUPPORTED_CHECK(__is_batch_supported());
+
+//LCOV_EXCL_START
+       LOCATIONS_NULL_ARG_CHECK(manager);
+       location_manager_s *handle = (location_manager_s *) manager;
+
+       if (LOCATIONS_METHOD_GPS == handle->method) {
+               if (!handle->sig_id[_LOCATION_SIGNAL_BATCH_UPDATED])
+                       handle->sig_id[_LOCATION_SIGNAL_BATCH_UPDATED] = g_signal_connect(handle->object, "batch-updated", G_CALLBACK(__cb_batch_updated), handle);
+       } else {
+               LOCATIONS_LOGE("method is not GPS [LOCATIONS_ERROR_INCORRECT_METHOD]");
+               return LOCATIONS_ERROR_INCORRECT_METHOD;
+       }
+
+       if (handle->user_cb[_LOCATIONS_EVENT_TYPE_BATCH] != NULL)
+               LOCATIONS_LOGD("batch status set : Start");
+
+       int ret = location_start_batch(handle->object);
+       if (ret != LOCATION_ERROR_NONE)
+               return __convert_error_code(ret);
+
+       return LOCATIONS_ERROR_NONE;
+//LCOV_EXCL_STOP
+}
+
+EXPORT_API int location_manager_stop_batch(location_manager_h manager)
+{
+       LOCATIONS_LOGD("location_manager_stop_batch");
+       LOCATIONS_NOT_SUPPORTED_CHECK(__is_batch_supported());
+
+//LCOV_EXCL_START
+       LOCATIONS_NULL_ARG_CHECK(manager);
+       location_manager_s *handle = (location_manager_s *) manager;
+
+       if (LOCATIONS_METHOD_GPS == handle->method) {
+               if (handle->sig_id[_LOCATION_SIGNAL_BATCH_UPDATED]) {
+                       g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_BATCH_UPDATED]);
+                       handle->sig_id[_LOCATION_SIGNAL_BATCH_UPDATED] = 0;
+               }
+       }
+
+       int ret = location_stop_batch(handle->object);
+       if (ret != LOCATION_ERROR_NONE)
+               return __convert_error_code(ret);
+
+       return LOCATIONS_ERROR_NONE;
+//LCOV_EXCL_STOP
+}
+
+EXPORT_API int location_manager_foreach_location_batch(location_manager_h manager, location_batch_get_location_cb callback, void *user_data)
+{
+       LOCATIONS_LOGD("location_manager_foreach_location_batch");
+       LOCATIONS_NOT_SUPPORTED_CHECK(__is_batch_supported());
+//LCOV_EXCL_START
+       LOCATIONS_NULL_ARG_CHECK(manager);
+       LOCATIONS_NULL_ARG_CHECK(callback);
+       location_manager_s *handle = (location_manager_s *) manager;
+       LocationBatch *batch = NULL;
+
+       int ret = location_get_batch(handle->object, &batch);
+       if (ret != LOCATION_ERROR_NONE || batch == NULL) {
+               if (ret == LOCATION_ERROR_NOT_ALLOWED) {
+                       LOCATIONS_LOGE("LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED");
+                       return LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED;
+               }
+
+               LOCATIONS_LOGE("Batch is NULL [LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE]");
+               return LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE;
+       }
+
+       int i;
+       for (i = 0; i < batch->num_of_location; i++) {
+               gdouble latitude;
+               gdouble longitude;
+               gdouble altitude;
+               gdouble speed;
+               gdouble direction;
+               gdouble h_accuracy;
+               gdouble v_accuracy;
+               guint timestamp;
+
+               location_get_batch_details(batch, i, &latitude, &longitude, &altitude, &speed, &direction, &h_accuracy, &v_accuracy, &timestamp);
+               if (callback(latitude, longitude, altitude, speed, direction, h_accuracy, v_accuracy, timestamp, user_data) != TRUE)
+                       break;
+       }
+       location_batch_free(batch);
+       batch = NULL;
+       return LOCATIONS_ERROR_NONE;
+//LCOV_EXCL_STOP
+}
+
+EXPORT_API int location_manager_is_enabled_mock_location(bool *enabled)
+{
+       LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
+       LOCATIONS_NULL_ARG_CHECK(enabled);
+       int is_enabled_val = -1;
+       int ret = location_is_enabled_method(INTERNAL_METHOD_MOCK, &is_enabled_val);
+       if (ret != LOCATION_ERROR_NONE)
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
+
+       if (is_enabled_val == -1)
+               return TIZEN_ERROR_PERMISSION_DENIED;   //LCOV_EXCL_LINE
+
+       *enabled = (is_enabled_val == 0) ? FALSE : TRUE;
+       return LOCATIONS_ERROR_NONE;
+}
+
 EXPORT_API int location_manager_enable_mock_location(const bool enable)
 {
        LOCATIONS_LOGD("enable: %d", enable);
        LOCATIONS_NOT_SUPPORTED_CHECK(__is_location_supported());
        int ret = LOCATION_ERROR_NONE;
 
-       ret = location_enable_mock(LOCATION_METHOD_MOCK, enable);
+       ret = location_enable_mock(enable);
        return __convert_error_code(ret);
 }
 
@@ -1460,43 +1605,50 @@ EXPORT_API int location_manager_set_mock_location(location_manager_h manager, co
        LocationVelocity *vel = NULL;
        LocationAccuracy *acc = NULL;
 
-       ret = location_is_enabled_method(LOCATION_METHOD_MOCK, &enabled);
+       ret = location_is_enabled_method(INTERNAL_METHOD_MOCK, &enabled);
        LOCATIONS_LOGD("enable: %d, ret: %d", enabled, ret);
        if (ret == LOCATIONS_ERROR_NONE) {
                if (enabled == 0)
                        return __convert_error_code(LOCATION_ERROR_SETTING_OFF);
        } else {
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
        }
 
        pos = location_position_new(0, latitude, longitude, 0, LOCATION_STATUS_3D_FIX);
        if (!pos) {
-               LOCATIONS_LOGE("Failed to create position");
-               return LOCATIONS_ERROR_OUT_OF_MEMORY;
+               LOCATIONS_LOGE("Failed to create position");    //LCOV_EXCL_LINE
+               return LOCATIONS_ERROR_OUT_OF_MEMORY;   //LCOV_EXCL_LINE
        }
        vel = location_velocity_new(0, speed, direction, 0);
        if (!vel) {
-               LOCATIONS_LOGE("Failed to create volocity");
+               //LCOV_EXCL_START
+               LOCATIONS_LOGE("Failed to create velocity");
                location_position_free(pos);
                return LOCATIONS_ERROR_OUT_OF_MEMORY;
+               //LCOV_EXCL_STOP
        }
 
        acc = location_accuracy_new(LOCATION_ACCURACY_LEVEL_DETAILED, accuracy, -1);
        if (!acc) {
+               //LCOV_EXCL_START
                LOCATIONS_LOGE("Failed to create accuracy");
                location_position_free(pos);
                location_velocity_free(vel);
                return LOCATIONS_ERROR_OUT_OF_MEMORY;
+               //LCOV_EXCL_STOP
        }
 
        ret = location_set_mock_location(handle->object, pos, vel, acc);
+       if (ret == LOCATION_ERROR_NOT_SUPPORTED) {
+               LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD");
+               return LOCATIONS_ERROR_INCORRECT_METHOD;
+       }
 
        location_position_free(pos);
        location_velocity_free(vel);
        location_accuracy_free(acc);
 
        return __convert_error_code(ret);
-
 }
 
 EXPORT_API int location_manager_clear_mock_location(location_manager_h manager)
@@ -1505,17 +1657,22 @@ EXPORT_API int location_manager_clear_mock_location(location_manager_h manager)
        LOCATIONS_NULL_ARG_CHECK(manager);
 
        location_manager_s *handle = (location_manager_s *) manager;
-       int ret = LOCATION_ERROR_NONE;
        int enabled;
 
-       ret = location_is_enabled_method(LOCATION_METHOD_MOCK, &enabled);
+       int ret = location_is_enabled_method(INTERNAL_METHOD_MOCK, &enabled);
+       LOCATIONS_LOGD("enable: %d, ret: %d", enabled, ret);
        if (ret == LOCATIONS_ERROR_NONE) {
                if (enabled == 0)
                        return __convert_error_code(LOCATION_ERROR_SETTING_OFF);
        } else {
-               return __convert_error_code(ret);
+               return __convert_error_code(ret);       //LCOV_EXCL_LINE
        }
 
        ret = location_clear_mock_location(handle->object);
+       if (ret == LOCATION_ERROR_NOT_SUPPORTED) {
+               LOCATIONS_LOGE("LOCATIONS_ERROR_INCORRECT_METHOD");
+               return LOCATIONS_ERROR_INCORRECT_METHOD;
+       }
+
        return __convert_error_code(ret);
 }