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

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/17749651

Change-Id: Ib7718c8d04b50a4e2fe3bb790f7e332d57e61d98
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-04-22 04:38:53 +00:00
committed by Automerger Merge Worker
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) {