diff options
author | Baili Feng <bailif@codeaurora.org> | 2018-06-27 15:44:49 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-07-03 15:41:52 -0700 |
commit | ffbe00b52bf0310ca2f68cb0b0283d9adfbe3fb6 (patch) | |
tree | e58ddf253c08c55ee66c7a3b4f6175227a705ddd /android | |
parent | 889d1eed233d4875e7b265eaa81d589e922f17be (diff) | |
download | gps-ffbe00b52bf0310ca2f68cb0b0283d9adfbe3fb6.tar.gz |
Set interval to large value for all MSA cases
If position mode is MSA, set interval to 590 hours
Change-Id: I552e0da679bf5b817bdc2463b32c8159c98b6e87
CRs-Fixed: 2268571
Diffstat (limited to 'android')
-rw-r--r-- | android/location_api/GnssAPIClient.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 6141212..a6e941e 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -29,6 +29,7 @@ #define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_GnssAPIClient" +#define SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC (590 * 60 * 60 * 1000) // 590 hours #include <log_util.h> #include <loc_cfg.h> @@ -166,9 +167,12 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); mTrackingOptions.size = sizeof(TrackingOptions); mTrackingOptions.minInterval = minIntervalMs; - if (IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) { - mTrackingOptions.minInterval = - std::numeric_limits<decltype(mTrackingOptions.minInterval)>::max(); + if (IGnss::GnssPositionMode::MS_ASSISTED == mode || + IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) { + // 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; if (mode == IGnss::GnssPositionMode::STANDALONE) |