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

Commit 2d17b5ed authored by Yu-Han Yang's avatar Yu-Han Yang
Browse files

Fix ADR half cycle state bug for AIDL HAL

Bug: 183906450
Test: on device
Change-Id: I1d05293f7d2b470e81b8a11843887e3389b0f943
parent 6c48dabf
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -302,6 +302,10 @@ void GnssMeasurementCallbackAidl::translateSingleGnssMeasurement(JNIEnv* env,

    SET(Cn0DbHz, measurement.antennaCN0DbHz);
    SET(ConstellationType, static_cast<int32_t>(measurement.signalType.constellation));
    // Half cycle state is reported in the AIDL version of GnssMeasurement
    SET(AccumulatedDeltaRangeState,
        (static_cast<int32_t>(measurement.accumulatedDeltaRangeState) |
         ADR_STATE_HALF_CYCLE_REPORTED));

    if (measurement.flags & static_cast<uint32_t>(GnssMeasurement::HAS_CARRIER_FREQUENCY)) {
        SET(CarrierFrequencyHz, static_cast<float>(measurement.signalType.carrierFrequencyHz));
@@ -481,7 +485,7 @@ void GnssMeasurementCallbackHidl::translateSingleGnssMeasurement<
        JavaObject& object) {
    translateSingleGnssMeasurement(measurement_V1_1.v1_0, object);

    // Set the V1_1 flag, and mark that new field has valid information for Java Layer
    // Half cycle state is reported in HIDL v1.1 or newer.
    SET(AccumulatedDeltaRangeState,
        (static_cast<int32_t>(measurement_V1_1.accumulatedDeltaRangeState) |
         ADR_STATE_HALF_CYCLE_REPORTED));