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

Commit bfb3bdb9 authored by destradaa's avatar destradaa
Browse files

Update use of A-GPS modes in GpsLocationProvider

b/20664846

This change reflects the documentation changes made in gps.h for the
upcoming Android release.

Change-Id: Id3e04492febdabd42e91a12e221d1192947b8061
parent edcaf7c9
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -952,13 +952,18 @@ public class GpsLocationProvider implements LocationProviderInterface {
                    return GPS_POSITION_MODE_STANDALONE;
                }
            }
            // MS-Based is the preferred mode for Assisted-GPS position computation, so we favor
            // such mode when it is available
            if (hasCapability(GPS_CAPABILITY_MSB) && (suplMode & AGPS_SUPL_MODE_MSB) != 0) {
                return GPS_POSITION_MODE_MS_BASED;
            }
            // for now, just as the legacy code did, we fallback to MS-Assisted if it is available,
            // do fallback only for single-shot requests, because it is too expensive to do for
            // periodic requests as well
            if (singleShot
                    && hasCapability(GPS_CAPABILITY_MSA)
                    && (suplMode & AGPS_SUPL_MODE_MSA) != 0) {
                return GPS_POSITION_MODE_MS_ASSISTED;
            } else if (hasCapability(GPS_CAPABILITY_MSB)
                    && (suplMode & AGPS_SUPL_MODE_MSB) != 0) {
                return GPS_POSITION_MODE_MS_BASED;
            }
        }
        return GPS_POSITION_MODE_STANDALONE;