summaryrefslogtreecommitdiff
path: root/gnss
diff options
context:
space:
mode:
Diffstat (limited to 'gnss')
-rw-r--r--gnss/GnssAdapter.cpp31
-rw-r--r--gnss/location_gnss.cpp10
2 files changed, 19 insertions, 22 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index 535f6de..16d5f9d 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -720,10 +720,7 @@ GnssAdapter::setConfigCommand()
GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT |
GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT |
GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
- gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
- if (0 == adapter.getAfwControlId() || NULL != adapter.mNfwCb) {
- gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK;
- }
+ gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK;
if (gpsConf.AGPS_CONFIG_INJECT) {
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT |
@@ -1075,10 +1072,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
if (GNSS_CONFIG_GPS_LOCK_NONE == newGpsLock) {
newGpsLock = GNSS_CONFIG_GPS_LOCK_MO;
}
- if (newGpsLock == ContextBase::mGps_conf.GPS_LOCK ||
- 0 != mAdapter.getAfwControlId() || NULL != adapter.mNfwCb) {
- gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT);
- }
+ gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT);
ContextBase::mGps_conf.GPS_LOCK = newGpsLock;
index++;
}
@@ -1636,9 +1630,10 @@ GnssAdapter::gnssSvTypeConfigUpdate(const GnssSvTypeConfig& config)
void
GnssAdapter::gnssSvTypeConfigUpdate(bool sendReset)
{
- LOC_LOGd("constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64 ", sendReset %d",
- mGnssSvTypeConfig.blacklistedSvTypesMask, mGnssSvTypeConfig.enabledSvTypesMask,
- sendReset);
+ LOC_LOGd("size %" PRIu32" constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64
+ ", sendReset %d",
+ mGnssSvTypeConfig.size, mGnssSvTypeConfig.blacklistedSvTypesMask,
+ mGnssSvTypeConfig.enabledSvTypesMask, sendReset);
if (mGnssSvTypeConfig.size == sizeof(mGnssSvTypeConfig)) {
@@ -1674,8 +1669,6 @@ GnssAdapter::gnssSvTypeConfigUpdate(bool sendReset)
svTypeConfig.enabledSvTypesMask = mGnssSvTypeConfig.enabledSvTypesMask;
mLocApi->setConstellationControl(svTypeConfig);
}
- } else {
- LOC_LOGE("Invalid GnssSvTypeConfig size");
}
}
@@ -2977,10 +2970,8 @@ GnssAdapter::enableCommand(LocationTechnologyType techType)
mAdapter.setAfwControlId(mSessionId);
GnssConfigGpsLock gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
- if (NULL != mAdapter.mNfwCb) {
- ContextBase::mGps_conf.GPS_LOCK &= GNSS_CONFIG_GPS_LOCK_NI;
- gpsLock = ContextBase::mGps_conf.GPS_LOCK;
- }
+ ContextBase::mGps_conf.GPS_LOCK &= GNSS_CONFIG_GPS_LOCK_NI;
+ gpsLock = ContextBase::mGps_conf.GPS_LOCK;
mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() {
mApi.setGpsLockSync(gpsLock);
}));
@@ -3027,10 +3018,8 @@ GnssAdapter::disableCommand(uint32_t id)
mContext.modemPowerVote(false);
mAdapter.setAfwControlId(0);
- if (NULL != mAdapter.mNfwCb) {
- /* We need to disable MO (AFW) */
- ContextBase::mGps_conf.GPS_LOCK |= GNSS_CONFIG_GPS_LOCK_MO;
- }
+ /* We need to disable MO (AFW) */
+ ContextBase::mGps_conf.GPS_LOCK |= GNSS_CONFIG_GPS_LOCK_MO;
GnssConfigGpsLock gpsLock = ContextBase::mGps_conf.GPS_LOCK;
mApi.sendMsg(new LocApiMsg([&mApi = mApi,gpsLock] () {
mApi.setGpsLockSync(gpsLock);
diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp
index 88fa15d..76839b6 100644
--- a/gnss/location_gnss.cpp
+++ b/gnss/location_gnss.cpp
@@ -78,6 +78,7 @@ static void odcpiInject(const Location& location);
static void blockCPI(double latitude, double longitude, float accuracy,
int blockDurationMsec, double latLonDiffThreshold);
+static void updateBatteryStatus(bool charging);
static const GnssInterface gGnssInterface = {
sizeof(GnssInterface),
@@ -115,7 +116,8 @@ static const GnssInterface gGnssInterface = {
enableNfwLocationAccess,
nfwInit,
getPowerStateChanges,
- injectLocationExt
+ injectLocationExt,
+ updateBatteryStatus
};
#ifndef DEBUG_X86
@@ -382,3 +384,9 @@ static void injectLocationExt(const GnssLocationInfoNotification &locationInfo)
gGnssAdapter->injectLocationExtCommand(locationInfo);
}
}
+
+static void updateBatteryStatus(bool charging) {
+ if (NULL != gGnssAdapter) {
+ gGnssAdapter->getSystemStatus()->updatePowerConnectState(charging);
+ }
+}