[HAM] move the function for gps setting change after location_manager_create()
authortaekeun.kang <taekeun.kang@samsung.com>
Tue, 26 Apr 2016 00:00:01 +0000 (09:00 +0900)
committertaekeun.kang <taekeun.kang@samsung.com>
Tue, 26 Apr 2016 00:00:01 +0000 (09:00 +0900)
Change-Id: I46507b553887a094cc02aaf1a411cc61f72e5765
Signed-off-by: taekeun.kang <taekeun.kang@samsung.com>
src/humanactivitymonitor/humanactivitymonitor_manager.cc

index 79e38cf1d6b70c5aed7af88e85aa290b8dfeb53a..23024e4cc29cf662470c9d20430d038a684dbbe6 100755 (executable)
@@ -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<int>(args.get(kCallbackInterval).get<double>() / 1000);