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

Commit dc24ef0f authored by Yipeng Cao's avatar Yipeng Cao Committed by Android (Google) Code Review
Browse files

Merge "Fixed the hasCarrierFrequency flag in GnssStatus(part 2)" into oc-dev

parents 5c604fc1 a36f51a1
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -129,16 +129,19 @@ void Gnss::gnssSvStatusCb(GnssSvStatus* status) {
        auto svInfo = status->gnss_sv_list[i];
        IGnssCallback::GnssSvInfo gnssSvInfo = {
            .svid = svInfo.svid,
            .constellation = static_cast<android::hardware::gnss::V1_0::GnssConstellationType>(
            .constellation = static_cast<
                android::hardware::gnss::V1_0::GnssConstellationType>(
                svInfo.constellation),
            .cN0Dbhz = svInfo.c_n0_dbhz,
            .elevationDegrees = svInfo.elevation,
            .azimuthDegrees = svInfo.azimuth,
            .svFlag = svInfo.flags,
            // Older chipsets do not provide carrier frequency, hence HAS_CARRIER_FREQUENCY flag
            // is not set and the carrierFrequencyHz field is set to zero
            .carrierFrequencyHz = 0
        };
            // Older chipsets do not provide carrier frequency, hence
            // HAS_CARRIER_FREQUENCY flag and the carrierFrequencyHz fields
            // are not set. So we are resetting both fields here.
            .svFlag = static_cast<uint8_t>(
                svInfo.flags &= ~(static_cast<uint8_t>(
                    IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY))),
            .carrierFrequencyHz = 0};
        svStatus.gnssSvList[i] = gnssSvInfo;
    }