summaryrefslogtreecommitdiffstats
path: root/gnss
diff options
context:
space:
mode:
authorYipeng Cao <tccyp@google.com>2017-04-27 18:29:25 -0700
committerYipeng Cao <tccyp@google.com>2017-04-28 21:35:58 +0000
commita36f51a1272cb6170484061ba6fec30149019f37 (patch)
tree77b9137ec7ce8107280fe4657efb41127aa7e975 /gnss
parent02b745ff4039c92def8e3049017a209787bf88e0 (diff)
downloadandroid_hardware_interfaces-a36f51a1272cb6170484061ba6fec30149019f37.tar.gz
android_hardware_interfaces-a36f51a1272cb6170484061ba6fec30149019f37.tar.bz2
android_hardware_interfaces-a36f51a1272cb6170484061ba6fec30149019f37.zip
Fixed the hasCarrierFrequency flag in GnssStatus(part 2)
Bug: 37757180 Fixes: 37757180 Test: cts-tradefed run cts -m CtsLocationTestCases --test android.location.cts.GnssStatusTest Change-Id: I817931ee2c19d0a770c4d7cedfbd69bc85db6978 Chang-Id: Icf4240ccad7ff367d96001973c0be36308ffd9b3
Diffstat (limited to 'gnss')
-rw-r--r--gnss/1.0/default/Gnss.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index afb659c66..cfcee243b 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -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>(
- svInfo.constellation),
+ .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;
}