summaryrefslogtreecommitdiff
path: root/android/2.0/location_api/LocationUtil.cpp
diff options
context:
space:
mode:
authorHoss Zhou <zhouh@codeaurora.org>2020-12-18 08:35:03 +0800
committerHoss Zhou <zhouh@codeaurora.org>2021-01-11 09:29:21 +0800
commitf1b174d9fda90194fc2c854a22f95b3f7e4b605c (patch)
treece8e95d06285971fd97e3a5df0ce857d2030e4a5 /android/2.0/location_api/LocationUtil.cpp
parent5c0b4cdce579822ba1b9cee31eca8a14e0a0124d (diff)
fix Glonass SVID 255 not reported in SV info
If Glonass orbital slot number is unknown, report frequency channel number Change-Id: If9746f6998f09b7412c0b23cbf45754b459e04bc CRs-Fixed: 2839783
Diffstat (limited to 'android/2.0/location_api/LocationUtil.cpp')
-rw-r--r--android/2.0/location_api/LocationUtil.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/android/2.0/location_api/LocationUtil.cpp b/android/2.0/location_api/LocationUtil.cpp
index 0742f27..961b7b1 100644
--- a/android/2.0/location_api/LocationUtil.cpp
+++ b/android/2.0/location_api/LocationUtil.cpp
@@ -217,7 +217,11 @@ void convertGnssSvid(GnssSv& in, int16_t& out)
out = in.svId;
break;
case GNSS_SV_TYPE_GLONASS:
- out = in.svId - GLO_SV_PRN_MIN + 1;
+ if (!isGloSlotUnknown(in.svId)) { // OSN is known
+ out = in.svId - GLO_SV_PRN_MIN + 1;
+ } else { // OSN is not known, report FCN
+ out = in.gloFrequency + 92;
+ }
break;
case GNSS_SV_TYPE_QZSS:
out = in.svId;
@@ -229,8 +233,6 @@ void convertGnssSvid(GnssSv& in, int16_t& out)
out = in.svId - GAL_SV_PRN_MIN + 1;
break;
case GNSS_SV_TYPE_NAVIC:
- /*Android doesn't define Navic svid range yet, use Naviv svid [1, 14] now
- will update this once Android give Navic svid definiitons */
out = in.svId - NAVIC_SV_PRN_MIN + 1;
break;
default:
@@ -249,7 +251,7 @@ void convertGnssSvid(GnssMeasurementsData& in, int16_t& out)
out = in.svId;
break;
case GNSS_SV_TYPE_GLONASS:
- if (in.svId != 255) { // OSN is known
+ if (!isGloSlotUnknown(in.svId)) { // OSN is known
out = in.svId - GLO_SV_PRN_MIN + 1;
} else { // OSN is not known, report FCN
out = in.gloFrequency + 92;
@@ -265,8 +267,6 @@ void convertGnssSvid(GnssMeasurementsData& in, int16_t& out)
out = in.svId - GAL_SV_PRN_MIN + 1;
break;
case GNSS_SV_TYPE_NAVIC:
- /*Android doesn't define Navic svid range yet, use Naviv svid [1, 14] now
- will update this once Android give Navic svid definiitons */
out = in.svId - NAVIC_SV_PRN_MIN + 1;
break;
default: