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

Commit 2baa3998 authored by Tushar Janefalkar's avatar Tushar Janefalkar Committed by Steve Kondik
Browse files

Add support for BeiDou and Glonass

Add masks for BeiDou amd Glonass
to delete aiding data
CRs-fixed: 582614
Change-Id: I651adcf4f5486c827bea8487e3437f15cd6d8013
Conflicts:
services/core/java/com/android/server/location/GpsLocationProvider.java
parent 106b24a1
Loading
Loading
Loading
Loading
+44 −14
Original line number Diff line number Diff line
@@ -143,19 +143,34 @@ public class GpsLocationProvider implements LocationProviderInterface {
    private static final int LOCATION_HAS_ACCURACY = 16;

// IMPORTANT - the GPS_DELETE_* symbols here must match constants in gps.h
    private static final int GPS_DELETE_EPHEMERIS = 0x0001;
    private static final int GPS_DELETE_ALMANAC = 0x0002;
    private static final int GPS_DELETE_POSITION = 0x0004;
    private static final int GPS_DELETE_TIME = 0x0008;
    private static final int GPS_DELETE_IONO = 0x0010;
    private static final int GPS_DELETE_UTC = 0x0020;
    private static final int GPS_DELETE_HEALTH = 0x0040;
    private static final int GPS_DELETE_SVDIR = 0x0080;
    private static final int GPS_DELETE_SVSTEER = 0x0100;
    private static final int GPS_DELETE_SADATA = 0x0200;
    private static final int GPS_DELETE_RTI = 0x0400;
    private static final int GPS_DELETE_CELLDB_INFO = 0x8000;
    private static final int GPS_DELETE_ALL = 0xFFFF;
    private static final int GPS_DELETE_EPHEMERIS = 0x00000001;
    private static final int GPS_DELETE_ALMANAC = 0x00000002;
    private static final int GPS_DELETE_POSITION = 0x00000004;
    private static final int GPS_DELETE_TIME = 0x00000008;
    private static final int GPS_DELETE_IONO = 0x00000010;
    private static final int GPS_DELETE_UTC = 0x00000020;
    private static final int GPS_DELETE_HEALTH = 0x00000040;
    private static final int GPS_DELETE_SVDIR = 0x00000080;
    private static final int GPS_DELETE_SVSTEER = 0x00000100;
    private static final int GPS_DELETE_SADATA = 0x00000200;
    private static final int GPS_DELETE_RTI = 0x00000400;
    private static final int GPS_DELETE_CELLDB_INFO = 0x00000800;
    private static final int GPS_DELETE_ALMANAC_CORR = 0x00001000;
    private static final int GPS_DELETE_FREQ_BIAS_EST = 0x00002000;
    private static final int GLO_DELETE_EPHEMERIS = 0x00004000;
    private static final int GLO_DELETE_ALMANAC = 0x00008000;
    private static final int GLO_DELETE_SVDIR = 0x00010000;
    private static final int GLO_DELETE_SVSTEER = 0x00020000;
    private static final int GLO_DELETE_ALMANAC_CORR = 0x00040000;
    private static final int GPS_DELETE_TIME_GPS = 0x00080000;
    private static final int GLO_DELETE_TIME = 0x00100000;
    private static final int BDS_DELETE_SVDIR =  0X00200000;
    private static final int BDS_DELETE_SVSTEER = 0X00400000;
    private static final int BDS_DELETE_TIME = 0X00800000;
    private static final int BDS_DELETE_ALMANAC_CORR = 0X01000000;
    private static final int BDS_DELETE_EPHEMERIS = 0X02000000;
    private static final int BDS_DELETE_ALMANAC = 0X04000000;
    private static final int GPS_DELETE_ALL = 0xFFFFFFFF;

    // The GPS_CAPABILITY_* flags must match the values in gps.h
    private static final int GPS_CAPABILITY_SCHEDULING = 0x0000001;
@@ -1240,6 +1255,21 @@ public class GpsLocationProvider implements LocationProviderInterface {
            if (extras.getBoolean("sadata")) flags |= GPS_DELETE_SADATA;
            if (extras.getBoolean("rti")) flags |= GPS_DELETE_RTI;
            if (extras.getBoolean("celldb-info")) flags |= GPS_DELETE_CELLDB_INFO;
            if (extras.getBoolean("almanac-corr")) flags |= GPS_DELETE_ALMANAC_CORR;
            if (extras.getBoolean("freq-bias-est")) flags |= GPS_DELETE_FREQ_BIAS_EST;
            if (extras.getBoolean("ephemeris-GLO")) flags |= GLO_DELETE_EPHEMERIS;
            if (extras.getBoolean("almanac-GLO")) flags |= GLO_DELETE_ALMANAC;
            if (extras.getBoolean("svdir-GLO")) flags |= GLO_DELETE_SVDIR;
            if (extras.getBoolean("svsteer-GLO")) flags |= GLO_DELETE_SVSTEER;
            if (extras.getBoolean("almanac-corr-GLO")) flags |= GLO_DELETE_ALMANAC_CORR;
            if (extras.getBoolean("time-gps")) flags |= GPS_DELETE_TIME_GPS;
            if (extras.getBoolean("time-GLO")) flags |= GLO_DELETE_TIME;
            if (extras.getBoolean("ephemeris-BDS")) flags |= BDS_DELETE_EPHEMERIS;
            if (extras.getBoolean("almanac-BDS")) flags |= BDS_DELETE_ALMANAC;
            if (extras.getBoolean("svdir-BDS")) flags |= BDS_DELETE_SVDIR;
            if (extras.getBoolean("svsteer-BDS")) flags |= BDS_DELETE_SVSTEER;
            if (extras.getBoolean("almanac-corr-BDS")) flags |= BDS_DELETE_ALMANAC_CORR;
            if (extras.getBoolean("time-BDS")) flags |= BDS_DELETE_TIME;
            if (extras.getBoolean("all")) flags |= GPS_DELETE_ALL;
        }