Fix ADR half cycle state bug for AIDL HAL

Bug: 183906450
Test: on device
Change-Id: I1d05293f7d2b470e81b8a11843887e3389b0f943
This commit is contained in:
Yu-Han Yang
2021-04-01 11:02:26 -07:00
parent 6c48dabfa5
commit 2d17b5ed90

View File

@@ -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));