Merge "Fix use-after-free in GnssMesaurementInterface" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-04-22 04:04:48 +00:00
committed by Android (Google) Code Review
3 changed files with 6 additions and 3 deletions

View File

@@ -153,7 +153,6 @@ void Gnss::reportSvStatus(const std::vector<GnssSvInfo>& svInfoList) const {
std::vector<GnssSvInfo> Gnss::filterBlocklistedSatellites(
std::vector<GnssSvInfo> gnssSvInfoList) const {
ALOGD("filterBlocklistedSatellites");
for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) {
if (mGnssConfiguration->isBlocklisted(gnssSvInfoList[i])) {
gnssSvInfoList[i].svFlag &= ~(uint32_t)IGnssCallback::GnssSvFlags::USED_IN_FIX;

View File

@@ -106,12 +106,14 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) {
std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis));
}
});
mThread.detach();
}
void GnssMeasurementInterface::stop() {
ALOGD("stop");
mIsActive = false;
if (mThread.joinable()) {
mThread.join();
}
}
void GnssMeasurementInterface::reportMeasurement(const GnssData& data) {

View File

@@ -69,12 +69,14 @@ void GnssNavigationMessageInterface::start() {
std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis));
}
});
mThread.detach();
}
void GnssNavigationMessageInterface::stop() {
ALOGD("stop");
mIsActive = false;
if (mThread.joinable()) {
mThread.join();
}
}
void GnssNavigationMessageInterface::reportMessage(const GnssNavigationMessage& message) {