Remove tracking redundanty and assure min interval
A tracking interval should not be less than 100ms If tracking interval or power mode is updated to the same value, then start tracking should not be sent to the modem again. Fix some issues with multiplex with powerMode Change-Id: I91e5d0577569b96179a5337af0fc91641dc126db CRs-fixed: 2190953
This commit is contained in:
parent
d31be64700
commit
e22619060b
2 changed files with 13 additions and 0 deletions
|
@ -34,6 +34,8 @@
|
|||
#include <LocationAPI.h>
|
||||
#include <map>
|
||||
|
||||
#define MIN_TRACKING_INTERVAL (100) // 100 msec
|
||||
|
||||
typedef struct LocationSessionKey {
|
||||
LocationAPI* client;
|
||||
uint32_t id;
|
||||
|
|
|
@ -2303,6 +2303,9 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, TrackingOptions& options)
|
|||
mTrackingOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS);
|
||||
mTrackingOptions.powerMode = GNSS_POWER_MODE_M2;
|
||||
}
|
||||
if (mTrackingOptions.minInterval < MIN_TRACKING_INTERVAL) {
|
||||
mTrackingOptions.minInterval = MIN_TRACKING_INTERVAL;
|
||||
}
|
||||
// Api doesn't support multiple clients for time based tracking, so mutiplex
|
||||
bool reportToClientWithNoWait =
|
||||
mAdapter.startTrackingMultiplex(mClient, mSessionId, mTrackingOptions);
|
||||
|
@ -2361,6 +2364,7 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId,
|
|||
}
|
||||
if (updateOptions) {
|
||||
// restart time based tracking with the newly updated options
|
||||
|
||||
startTracking(client, sessionId, multiplexedOptions);
|
||||
// need to wait for QMI callback
|
||||
reportToClientWithNoWait = false;
|
||||
|
@ -2375,6 +2379,10 @@ void
|
|||
GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId,
|
||||
const TrackingOptions& trackingOptions)
|
||||
{
|
||||
LOC_LOGd("minInterval %u minDistance %u mode %u powermode %u tbm %u",
|
||||
trackingOptions.minInterval, trackingOptions.minDistance,
|
||||
trackingOptions.mode, trackingOptions.powerMode, trackingOptions.tbm);
|
||||
|
||||
LocPosMode locPosMode = {};
|
||||
convertOptions(locPosMode, trackingOptions);
|
||||
|
||||
|
@ -2487,6 +2495,9 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id,
|
|||
mTrackingOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS);
|
||||
mTrackingOptions.powerMode = GNSS_POWER_MODE_M2;
|
||||
}
|
||||
if (mTrackingOptions.minInterval < MIN_TRACKING_INTERVAL) {
|
||||
mTrackingOptions.minInterval = MIN_TRACKING_INTERVAL;
|
||||
}
|
||||
// Api doesn't support multiple clients for time based tracking, so mutiplex
|
||||
bool reportToClientWithNoWait =
|
||||
mAdapter.updateTrackingMultiplex(mClient, mSessionId, mTrackingOptions);
|
||||
|
|
Loading…
Reference in a new issue