Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 435c80fe authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix deadlock in reportMeasurement() and stop()" into sc-dev am: b56a2c1a

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

Change-Id: Ifa6e2d77e3948ac549efcb3dda35e0ecfb9ace4d
parents 523164fe b56a2c1a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ GnssHidlHal::GnssHidlHal(const std::shared_ptr<Gnss>& gnssAidl) : mGnssAidl(gnss

hidl_vec<GnssSvInfo> GnssHidlHal::filterBlocklistedSatellitesV2_1(
        hidl_vec<GnssSvInfo> gnssSvInfoList) {
    ALOGD("GnssHidlHal::filterBlocklistSatellitesV2_1");
    if (mGnssConfigurationAidl == nullptr) {
        ALOGE("Handle to AIDL GnssConfiguration is not available.");
        return gnssSvInfoList;
+9 −8
Original line number Diff line number Diff line
@@ -75,19 +75,20 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) {
void GnssMeasurementInterface::stop() {
    ALOGD("stop");
    mIsActive = false;
    if (mThread.joinable()) {
        mThread.join();
    }
}

void GnssMeasurementInterface::reportMeasurement(const GnssData& data) {
    ALOGD("reportMeasurement()");
    std::shared_ptr<IGnssMeasurementCallback> callbackCopy;
    {
        std::unique_lock<std::mutex> lock(mMutex);
        if (sCallback == nullptr) {
            ALOGE("%s: GnssMeasurement::sCallback is null.", __func__);
            return;
        }
    sCallback->gnssMeasurementCb(data);
        callbackCopy = sCallback;
    }
    callbackCopy->gnssMeasurementCb(data);
}

}  // namespace aidl::android::hardware::gnss