From: taekeun.kang Date: Tue, 26 Apr 2016 00:00:01 +0000 (+0900) Subject: [HAM] move the function for gps setting change after location_manager_create() X-Git-Tag: submit/tizen/20160426.030601^2~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e66d1006e25fa39dbdb8fea97de5627d4f1cb5c9;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [HAM] move the function for gps setting change after location_manager_create() Change-Id: I46507b553887a094cc02aaf1a411cc61f72e5765 Signed-off-by: taekeun.kang --- diff --git a/src/humanactivitymonitor/humanactivitymonitor_manager.cc b/src/humanactivitymonitor/humanactivitymonitor_manager.cc index 79e38cf1..23024e4c 100755 --- a/src/humanactivitymonitor/humanactivitymonitor_manager.cc +++ b/src/humanactivitymonitor/humanactivitymonitor_manager.cc @@ -576,14 +576,6 @@ class HumanActivityMonitorManager::Monitor::GpsMonitor : public HumanActivityMon "Failed to create location manager", ("Failed to create location manager, error: %d (%s)", ret, get_error_message(ret))); } - } else { - ret = location_manager_stop_batch(handle_); - if (LOCATIONS_ERROR_NONE != ret) { - return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, - "Failed to stop location manager", - ("Failed to stop location manager, error: %d (%s)", ret, get_error_message(ret))); - } - ret = location_manager_set_setting_changed_cb(LOCATIONS_METHOD_GPS, OnGpsSettingEvent, @@ -593,6 +585,13 @@ class HumanActivityMonitorManager::Monitor::GpsMonitor : public HumanActivityMon "Failed to set setting listener", ("Failed to set setting listener, error: %d (%s)", ret, get_error_message(ret))); } + } else { + ret = location_manager_stop_batch(handle_); + if (LOCATIONS_ERROR_NONE != ret) { + return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, + "Failed to stop location manager", + ("Failed to stop location manager, error: %d (%s)", ret, get_error_message(ret))); + } } int callback_interval = static_cast(args.get(kCallbackInterval).get() / 1000);