Gnss adapter: do not send out empty sv measurement to Android

Do not send out empty sv measurement to Android

Change-Id: I4ab807d647be8b44f3f48a3ad5e5ca7f33ac2485
CRs-fixed: 2439716
This commit is contained in:
Wei Chen 2019-06-12 12:09:18 -07:00
parent 3bbb89aee1
commit de13fc3868

View file

@ -3769,26 +3769,28 @@ GnssAdapter::reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurement
{ {
LOC_LOGD("%s]: msInWeek=%d", __func__, msInWeek); LOC_LOGD("%s]: msInWeek=%d", __func__, msInWeek);
struct MsgReportGnssMeasurementData : public LocMsg { if (0 != gnssMeasurements.gnssMeasNotification.count) {
GnssAdapter& mAdapter; struct MsgReportGnssMeasurementData : public LocMsg {
GnssMeasurements mGnssMeasurements; GnssAdapter& mAdapter;
GnssMeasurementsNotification mMeasurementsNotify; GnssMeasurements mGnssMeasurements;
inline MsgReportGnssMeasurementData(GnssAdapter& adapter, GnssMeasurementsNotification mMeasurementsNotify;
const GnssMeasurements& gnssMeasurements, inline MsgReportGnssMeasurementData(GnssAdapter& adapter,
int msInWeek) : const GnssMeasurements& gnssMeasurements,
LocMsg(), int msInWeek) :
mAdapter(adapter), LocMsg(),
mMeasurementsNotify(gnssMeasurements.gnssMeasNotification) { mAdapter(adapter),
if (-1 != msInWeek) { mMeasurementsNotify(gnssMeasurements.gnssMeasNotification) {
mAdapter.getAgcInformation(mMeasurementsNotify, msInWeek); if (-1 != msInWeek) {
mAdapter.getAgcInformation(mMeasurementsNotify, msInWeek);
}
} }
} inline virtual void proc() const {
inline virtual void proc() const { mAdapter.reportGnssMeasurementData(mMeasurementsNotify);
mAdapter.reportGnssMeasurementData(mMeasurementsNotify); }
} };
};
sendMsg(new MsgReportGnssMeasurementData(*this, gnssMeasurements, msInWeek)); sendMsg(new MsgReportGnssMeasurementData(*this, gnssMeasurements, msInWeek));
}
mEngHubProxy->gnssReportSvMeasurement(gnssMeasurements.gnssSvMeasurementSet); mEngHubProxy->gnssReportSvMeasurement(gnssMeasurements.gnssSvMeasurementSet);
} }