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

Commit 585fdc34 authored by Wyatt Riley's avatar Wyatt Riley Committed by android-build-merger
Browse files

Merge "Adding SBAS offset to Gps/Gnss SvStatus converter" into nyc-dev

am: 0f6363e8

* commit '0f6363e8':
  Adding SBAS offset to Gps/Gnss SvStatus converter

Change-Id: Ia562243b80467aebab070ab327e83007936bfc63
parents 674262b7 0f6363e8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ public final class GpsStatus {
    private static final int NUM_SATELLITES = 255;
    private static final int GLONASS_SVID_OFFSET = 64;
    private static final int BEIDOU_SVID_OFFSET = 200;
    private static final int SBAS_SVID_OFFSET = -87;

    /* These package private values are modified by the LocationManager class */
    private int mTimeToFirstFix;
@@ -166,9 +167,10 @@ public final class GpsStatus {
                prn += GLONASS_SVID_OFFSET;
            } else if (constellationType == GnssStatus.CONSTELLATION_BEIDOU) {
                prn += BEIDOU_SVID_OFFSET;
            } else if (constellationType == GnssStatus.CONSTELLATION_SBAS) {
                prn += SBAS_SVID_OFFSET;
            } else if ((constellationType != GnssStatus.CONSTELLATION_GPS) &&
                    (constellationType != GnssStatus.CONSTELLATION_QZSS) &&
                    (constellationType != GnssStatus.CONSTELLATION_SBAS)) {
                    (constellationType != GnssStatus.CONSTELLATION_QZSS)) {
                continue;
            }
            if (prn > 0 && prn <= NUM_SATELLITES) {
+7 −3
Original line number Diff line number Diff line
@@ -72,15 +72,18 @@ static const GnssConfigurationInterface* sGnssConfigurationInterface = NULL;
#define GPS_MAX_SATELLITE_COUNT 32
#define GNSS_MAX_SATELLITE_COUNT 64

// Let these through, with ID remapped by offset
// Let these through, with ID remapped down to 1, 2... by offset
#define GLONASS_SVID_OFFSET 64
#define GLONASS_SVID_COUNT 24
#define BEIDOU_SVID_OFFSET 200
#define BEIDOU_SVID_COUNT 35

// Let these through, with ID remapped up (33->120 ... 64->151, etc.)
#define SBAS_SVID_MIN 33
#define SBAS_SVID_MAX 64
#define SBAS_SVID_ADD 87

// Let these through, with no ID remapping
#define SBAS_SVID_MIN 120
#define SBAS_SVID_MAX 151
#define QZSS_SVID_MIN 193
#define QZSS_SVID_MAX 200

@@ -159,6 +162,7 @@ static void sv_status_callback(GpsSvStatus* sv_status)
            info.svid -= BEIDOU_SVID_OFFSET;
        } else if (info.svid >= SBAS_SVID_MIN && info.svid <= SBAS_SVID_MAX) {
            info.constellation = GNSS_CONSTELLATION_SBAS;
            info.svid += SBAS_SVID_ADD;
        } else if (info.svid >= QZSS_SVID_MIN && info.svid <= QZSS_SVID_MAX) {
            info.constellation = GNSS_CONSTELLATION_QZSS;
        } else {