Merge "Set interval to large value for all MSA cases"
This commit is contained in:
commit
b658d82b1a
1 changed files with 7 additions and 3 deletions
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#define LOG_NDEBUG 0
|
#define LOG_NDEBUG 0
|
||||||
#define LOG_TAG "LocSvc_GnssAPIClient"
|
#define LOG_TAG "LocSvc_GnssAPIClient"
|
||||||
|
#define SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC (590 * 60 * 60 * 1000) // 590 hours
|
||||||
|
|
||||||
#include <log_util.h>
|
#include <log_util.h>
|
||||||
#include <loc_cfg.h>
|
#include <loc_cfg.h>
|
||||||
|
@ -166,9 +167,12 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode,
|
||||||
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
|
memset(&mTrackingOptions, 0, sizeof(TrackingOptions));
|
||||||
mTrackingOptions.size = sizeof(TrackingOptions);
|
mTrackingOptions.size = sizeof(TrackingOptions);
|
||||||
mTrackingOptions.minInterval = minIntervalMs;
|
mTrackingOptions.minInterval = minIntervalMs;
|
||||||
if (IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) {
|
if (IGnss::GnssPositionMode::MS_ASSISTED == mode ||
|
||||||
mTrackingOptions.minInterval =
|
IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) {
|
||||||
std::numeric_limits<decltype(mTrackingOptions.minInterval)>::max();
|
// We set a very large interval to simulate SINGLE mode. Once we report a fix,
|
||||||
|
// the caller should take the responsibility to stop the session.
|
||||||
|
// For MSA, we always treat it as SINGLE mode.
|
||||||
|
mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC;
|
||||||
}
|
}
|
||||||
mTrackingOptions.minDistance = preferredAccuracyMeters;
|
mTrackingOptions.minDistance = preferredAccuracyMeters;
|
||||||
if (mode == IGnss::GnssPositionMode::STANDALONE)
|
if (mode == IGnss::GnssPositionMode::STANDALONE)
|
||||||
|
|
Loading…
Reference in a new issue