diff options
Diffstat (limited to 'gps/gnss/GnssAdapter.cpp')
-rw-r--r-- | gps/gnss/GnssAdapter.cpp | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/gps/gnss/GnssAdapter.cpp b/gps/gnss/GnssAdapter.cpp index 751c148..6df8e12 100644 --- a/gps/gnss/GnssAdapter.cpp +++ b/gps/gnss/GnssAdapter.cpp @@ -766,8 +766,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = mApi.setGpsLock(mConfig.gpsLock); } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { uint32_t newSuplVersion = mAdapter.convertSuplVersion(mConfig.suplVersion); @@ -779,8 +780,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { @@ -808,8 +810,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_INVALID_PARAMETER; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { uint32_t newLppProfile = mAdapter.convertLppProfile(mConfig.lppProfile); @@ -821,8 +824,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { uint32_t newLppeControlPlaneMask = @@ -834,8 +838,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { uint32_t newLppeUserPlaneMask = @@ -847,8 +852,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { uint32_t newAGloProtMask = @@ -861,8 +867,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { uint32_t newEP4ES = mAdapter.convertEP4ES(mConfig.emergencyPdnForEmergencySupl); @@ -871,8 +878,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } err = LOCATION_ERROR_SUCCESS; if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { uint32_t newSuplEs = mAdapter.convertSuplEs(mConfig.suplEmergencyServices); @@ -881,8 +889,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } err = LOCATION_ERROR_SUCCESS; if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { uint32_t newSuplMode = mAdapter.convertSuplMode(mConfig.suplModeMask); @@ -894,8 +903,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } err = LOCATION_ERROR_SUCCESS; if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } mAdapter.reportResponse(index, errs, mIds); @@ -1957,7 +1967,6 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) } else if (powerVoteId > 0) { err = LOCATION_ERROR_ALREADY_STARTED; } else { - mContext.modemPowerVote(true); mAdapter.setPowerVoteId(mSessionId); mApi.setGpsLock(GNSS_CONFIG_GPS_LOCK_NONE); mAdapter.mXtraObserver.updateLockStatus( @@ -1969,6 +1978,7 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) if (mContext != NULL) { sendMsg(new MsgEnableGnss(*this, *mLocApi, *mContext, sessionId, techType)); + mContext->modemPowerVote(true); } else { LOC_LOGE("%s]: Context is NULL", __func__); } @@ -2001,7 +2011,6 @@ GnssAdapter::disableCommand(uint32_t id) if (powerVoteId != mSessionId) { err = LOCATION_ERROR_ID_UNKNOWN; } else { - mContext.modemPowerVote(false); mAdapter.setPowerVoteId(0); mApi.setGpsLock(mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); mAdapter.mXtraObserver.updateLockStatus( @@ -2013,6 +2022,7 @@ GnssAdapter::disableCommand(uint32_t id) if (mContext != NULL) { sendMsg(new MsgDisableGnss(*this, *mLocApi, *mContext, id)); + mContext->modemPowerVote(false); } } |