Enhance LocationAPI structs to hold full position

Match the output of izat_remote_api clients with LocationAPI clients.
Fill GnssLocationInfoNotification with missing fields from
GpsLocationExtended and Location structure. And allow one single
callback to report complete position info. Meanwhile, remove fields
from UlpLocation that are no longer used.

CRs-fixed: 2169738
Change-Id: Ib5bd3dd9c065c4b3d6cad32b23167546ad950d06
diff --git a/sdm845/core/LocApiBase.cpp b/sdm845/core/LocApiBase.cpp
index c317d59..b653656 100644
--- a/sdm845/core/LocApiBase.cpp
+++ b/sdm845/core/LocApiBase.cpp
@@ -273,7 +273,7 @@
     // print the location info before delivering
     LOC_LOGD("flags: %d\n  source: %d\n  latitude: %f\n  longitude: %f\n  "
              "altitude: %f\n  speed: %f\n  bearing: %f\n  accuracy: %f\n  "
-             "timestamp: %" PRId64 "\n  rawDataSize: %d\n  rawData: %p\n  "
+             "timestamp: %" PRId64 "\n"
              "Session status: %d\n Technology mask: %u\n "
              "SV used in fix (gps/glo/bds/gal/qzss) : \
              (%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")",
@@ -281,8 +281,7 @@
              location.gpsLocation.latitude, location.gpsLocation.longitude,
              location.gpsLocation.altitude, location.gpsLocation.speed,
              location.gpsLocation.bearing, location.gpsLocation.accuracy,
-             location.gpsLocation.timestamp, location.rawDataSize,
-             location.rawData, status, loc_technology_mask,
+             location.gpsLocation.timestamp, status, loc_technology_mask,
              locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask,
              locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask,
              locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask,
@@ -322,7 +321,7 @@
             sizeof(constellationString) / sizeof(constellationString[0]) - 1) {
             svNotify.gnssSvs[i].type = GNSS_SV_TYPE_UNKNOWN;
         }
-        LOC_LOGV("   %03zu: %*s  %02d    %f    %f    %f    %f    0x%02X",
+        LOC_LOGV("   %03zu: %*s  %02d    %f    %f    %f    0x%02X",
             i,
             13,
             constellationString[svNotify.gnssSvs[i].type],
@@ -330,7 +329,6 @@
             svNotify.gnssSvs[i].cN0Dbhz,
             svNotify.gnssSvs[i].elevation,
             svNotify.gnssSvs[i].azimuth,
-            svNotify.gnssSvs[i].carrierFrequencyHz,
             svNotify.gnssSvs[i].gnssSvOptionsMask);
     }
     // loop through adapters, and deliver to all adapters.
diff --git a/sdm845/gnss/GnssAdapter.cpp b/sdm845/gnss/GnssAdapter.cpp
index 22832d5..9c91dbf 100644
--- a/sdm845/gnss/GnssAdapter.cpp
+++ b/sdm845/gnss/GnssAdapter.cpp
@@ -196,32 +196,32 @@
 }
 
 void
-GnssAdapter::convertLocation(Location& out, const LocGpsLocation& locGpsLocation,
+GnssAdapter::convertLocation(Location& out, const UlpLocation& ulpLocation,
                              const GpsLocationExtended& locationExtended,
                              const LocPosTechMask techMask)
 {
     memset(&out, 0, sizeof(Location));
     out.size = sizeof(Location);
-    if (LOC_GPS_LOCATION_HAS_LAT_LONG & locGpsLocation.flags) {
+    if (LOC_GPS_LOCATION_HAS_LAT_LONG & ulpLocation.gpsLocation.flags) {
         out.flags |= LOCATION_HAS_LAT_LONG_BIT;
-        out.latitude = locGpsLocation.latitude;
-        out.longitude = locGpsLocation.longitude;
+        out.latitude = ulpLocation.gpsLocation.latitude;
+        out.longitude = ulpLocation.gpsLocation.longitude;
     }
-    if (LOC_GPS_LOCATION_HAS_ALTITUDE & locGpsLocation.flags) {
+    if (LOC_GPS_LOCATION_HAS_ALTITUDE & ulpLocation.gpsLocation.flags) {
         out.flags |= LOCATION_HAS_ALTITUDE_BIT;
-        out.altitude = locGpsLocation.altitude;
+        out.altitude = ulpLocation.gpsLocation.altitude;
     }
-    if (LOC_GPS_LOCATION_HAS_SPEED & locGpsLocation.flags) {
+    if (LOC_GPS_LOCATION_HAS_SPEED & ulpLocation.gpsLocation.flags) {
         out.flags |= LOCATION_HAS_SPEED_BIT;
-        out.speed = locGpsLocation.speed;
+        out.speed = ulpLocation.gpsLocation.speed;
     }
-    if (LOC_GPS_LOCATION_HAS_BEARING & locGpsLocation.flags) {
+    if (LOC_GPS_LOCATION_HAS_BEARING & ulpLocation.gpsLocation.flags) {
         out.flags |= LOCATION_HAS_BEARING_BIT;
-        out.bearing = locGpsLocation.bearing;
+        out.bearing = ulpLocation.gpsLocation.bearing;
     }
-    if (LOC_GPS_LOCATION_HAS_ACCURACY & locGpsLocation.flags) {
+    if (LOC_GPS_LOCATION_HAS_ACCURACY & ulpLocation.gpsLocation.flags) {
         out.flags |= LOCATION_HAS_ACCURACY_BIT;
-        out.accuracy = locGpsLocation.accuracy;
+        out.accuracy = ulpLocation.gpsLocation.accuracy;
     }
     if (GPS_LOCATION_EXTENDED_HAS_VERT_UNC & locationExtended.flags) {
         out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT;
@@ -235,7 +235,7 @@
         out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT;
         out.bearingAccuracy = locationExtended.bearing_unc;
     }
-    out.timestamp = locGpsLocation.timestamp;
+    out.timestamp = ulpLocation.gpsLocation.timestamp;
     if (LOC_POS_TECH_MASK_SATELLITE & techMask) {
         out.techMask |= LOCATION_TECHNOLOGY_GNSS_BIT;
     }
@@ -265,6 +265,11 @@
         out.hdop = locationExtended.hdop;
         out.vdop = locationExtended.vdop;
     }
+    if (GPS_LOCATION_EXTENDED_HAS_EXT_DOP & locationExtended.flags) {
+        out.flags |= GNSS_LOCATION_INFO_EXT_DOP_BIT;
+        out.gdop = locationExtended.extDOP.GDOP;
+        out.tdop = locationExtended.extDOP.TDOP;
+    }
     if (GPS_LOCATION_EXTENDED_HAS_MAG_DEV & locationExtended.flags) {
         out.flags |= GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT;
         out.magneticDeviation = locationExtended.magneticDeviation;
@@ -321,6 +326,53 @@
         out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT;
         out.horUncEllipseOrientAzimuth = locationExtended.horUncEllipseOrientAzimuth;
     }
+    if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) {
+        out.flags |= GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT;
+        out.svUsedInPosition.gpsSvUsedIdsMask =
+                locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask;
+        out.svUsedInPosition.gloSvUsedIdsMask =
+                locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask;
+        out.svUsedInPosition.galSvUsedIdsMask =
+                locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask;
+        out.svUsedInPosition.bdsSvUsedIdsMask =
+                locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask;
+        out.svUsedInPosition.qzssSvUsedIdsMask =
+                locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask;
+    }
+    if (GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK & locationExtended.flags) {
+        out.flags |= GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT;
+        out.navSolutionMask = locationExtended.navSolutionMask;
+    }
+    if (GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK & locationExtended.flags) {
+        out.flags |= GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK;
+        out.posTechMask = locationExtended.tech_mask;
+    }
+    if (GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA & locationExtended.flags) {
+        out.flags |= GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA;
+        if (locationExtended.bodyFrameData.bodyFrameDatamask &
+                LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT) {
+            out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT;
+        }
+        if (locationExtended.bodyFrameData.bodyFrameDatamask &
+                LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT) {
+            out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT;
+        }
+        if (locationExtended.bodyFrameData.bodyFrameDatamask &
+                LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT) {
+            out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT;
+        }
+        if (locationExtended.bodyFrameData.bodyFrameDatamask & LOCATION_NAV_DATA_HAS_YAW_RATE_BIT) {
+            out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_YAW_RATE_BIT;
+        }
+        if (locationExtended.bodyFrameData.bodyFrameDatamask & LOCATION_NAV_DATA_HAS_PITCH_BIT) {
+            out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_PITCH_BIT;
+        }
+        out.bodyFrameData.longAccel = locationExtended.bodyFrameData.longAccel;
+        out.bodyFrameData.latAccel = locationExtended.bodyFrameData.latAccel;
+        out.bodyFrameData.vertAccel = locationExtended.bodyFrameData.vertAccel;
+        out.bodyFrameData.yawRate = locationExtended.bodyFrameData.yawRate;
+        out.bodyFrameData.pitch = locationExtended.bodyFrameData.pitch;
+    }
 }
 
 inline uint32_t
@@ -1699,7 +1751,7 @@
 {
     LOC_API_ADAPTER_EVENT_MASK_T mask = 0;
     for (auto it=mClientData.begin(); it != mClientData.end(); ++it) {
-        if (it->second.trackingCb != nullptr) {
+        if (it->second.trackingCb != nullptr || it->second.gnssLocationInfoCb != nullptr) {
             mask |= LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT;
         }
         if (it->second.gnssNiCb != nullptr) {
@@ -1906,7 +1958,7 @@
 GnssAdapter::hasTrackingCallback(LocationAPI* client)
 {
     auto it = mClientData.find(client);
-    return (it != mClientData.end() && it->second.trackingCb);
+    return (it != mClientData.end() && (it->second.trackingCb || it->second.gnssLocationInfoCb));
 }
 
 bool
@@ -2737,15 +2789,15 @@
         }
 
         for (auto it=mClientData.begin(); it != mClientData.end(); ++it) {
-            if (nullptr != it->second.trackingCb) {
-                Location location = {};
-                convertLocation(location, ulpLocation.gpsLocation, locationExtended, techMask);
-                it->second.trackingCb(location);
-            }
             if (nullptr != it->second.gnssLocationInfoCb) {
                 GnssLocationInfoNotification locationInfo = {};
                 convertLocationInfo(locationInfo, locationExtended);
+                convertLocation(locationInfo.location, ulpLocation, locationExtended, techMask);
                 it->second.gnssLocationInfoCb(locationInfo);
+            } else if (nullptr != it->second.trackingCb) {
+                Location location = {};
+                convertLocation(location, ulpLocation, locationExtended, techMask);
+                it->second.trackingCb(location);
             }
         }
     }
@@ -2763,15 +2815,6 @@
             reportNmea(sentence.c_str(), sentence.length());
         }
     }
-
-    // Free the allocated memory for rawData
-    UlpLocation* gp = (UlpLocation*)&(ulpLocation);
-    if (gp != NULL && gp->rawData != NULL)
-    {
-        delete (char*)gp->rawData;
-        gp->rawData = NULL;
-        gp->rawDataSize = 0;
-    }
 }
 
 void
diff --git a/sdm845/gnss/GnssAdapter.h b/sdm845/gnss/GnssAdapter.h
index 9d54e6a..ad512da 100644
--- a/sdm845/gnss/GnssAdapter.h
+++ b/sdm845/gnss/GnssAdapter.h
@@ -156,7 +156,7 @@
 
     /*==== CONVERSION ===================================================================*/
     static void convertOptions(LocPosMode& out, const TrackingOptions& trackingOptions);
-    static void convertLocation(Location& out, const LocGpsLocation& locGpsLocation,
+    static void convertLocation(Location& out, const UlpLocation& ulpLocation,
                                 const GpsLocationExtended& locationExtended,
                                 const LocPosTechMask techMask);
     static void convertLocationInfo(GnssLocationInfoNotification& out,
diff --git a/sdm845/location/LocationAPI.h b/sdm845/location/LocationAPI.h
index 682a376..5f2b3a1 100644
--- a/sdm845/location/LocationAPI.h
+++ b/sdm845/location/LocationAPI.h
@@ -88,6 +88,40 @@
     LOCATION_RELIABILITY_HIGH,
 } LocationReliability;
 
+typedef uint32_t GnssLocationNavSolutionMask;
+typedef enum {
+    LOCATION_SBAS_CORRECTION_IONO_BIT  = (1<<0), // SBAS ionospheric correction is used
+    LOCATION_SBAS_CORRECTION_FAST_BIT  = (1<<1), // SBAS fast correction is used
+    LOCATION_SBAS_CORRECTION_LONG_BIT  = (1<<2), // SBAS long-tem correction is used
+    LOCATION_SBAS_INTEGRITY_BIT        = (1<<3), // SBAS integrity information is used
+    LOCATION_NAV_CORRECTION_DGNSS_BIT  = (1<<4), // Position Report is DGNSS corrected
+    LOCATION_NAV_CORRECTION_RTK_BIT    = (1<<5), // Position Report is RTK corrected
+    LOCATION_NAV_CORRECTION_PPP_BIT    = (1<<6) // Position Report is PPP corrected
+} GnssLocationNavSolutionBits;
+
+typedef uint32_t GnssLocationPosTechMask;
+typedef enum {
+    LOCATION_POS_TECH_DEFAULT_BIT                  = 0,
+    LOCATION_POS_TECH_SATELLITE_BIT                = (1<<0),
+    LOCATION_POS_TECH_CELLID_BIT                   = (1<<1),
+    LOCATION_POS_TECH_WIFI_BIT                     = (1<<2),
+    LOCATION_POS_TECH_SENSORS_BIT                  = (1<<3),
+    LOCATION_POS_TECH_REFERENCE_LOCATION_BIT       = (1<<4),
+    LOCATION_POS_TECH_INJECTED_COARSE_POSITION_BIT = (1<<5),
+    LOCATION_POS_TECH_AFLT_BIT                     = (1<<6),
+    LOCATION_POS_TECH_HYBRID_BIT                   = (1<<7),
+    LOCATION_POS_TECH_PPE_BIT                      = (1<<8)
+} GnssLocationPosTechBits;
+
+typedef uint32_t GnssLocationPosDataMask;
+typedef enum {
+    LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT  = (1<<0), // Navigation data has Forward Acceleration
+    LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT   = (1<<1), // Navigation data has Sideward Acceleration
+    LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT  = (1<<2), // Navigation data has Vertical Acceleration
+    LOCATION_NAV_DATA_HAS_YAW_RATE_BIT    = (1<<3), // Navigation data has Heading Rate
+    LOCATION_NAV_DATA_HAS_PITCH_BIT       = (1<<4)  // Navigation data has Body pitch
+} GnssLocationPosDataBits;
+
 typedef uint32_t GnssLocationInfoFlagMask;
 typedef enum {
     GNSS_LOCATION_INFO_ALTITUDE_MEAN_SEA_LEVEL_BIT      = (1<<0), // valid altitude mean sea level
@@ -97,7 +131,14 @@
     GNSS_LOCATION_INFO_VER_RELIABILITY_BIT              = (1<<4), // valid vertical reliability
     GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT = (1<<5), // valid elipsode semi major
     GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT = (1<<6), // valid elipsode semi minor
-    GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT    = (1<<7),// valid accuracy elipsode azimuth
+    GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT    = (1<<7), // valid accuracy elipsode azimuth
+    GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT            = (1<<8), // valid gnss sv used in pos data
+    GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT            = (1<<9), // valid navSolutionMask
+    GNSS_LOCATION_INFO_POS_TECH_MASK_BIT                = (1<<10),// valid LocPosTechMask
+    GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT               = (1<<11),// valid LocSvInfoSource
+    GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT            = (1<<12),// valid position dynamics data
+    GNSS_LOCATION_INFO_GPS_TIME_BIT                     = (1<<13),// valid GPS Time
+    GNSS_LOCATION_INFO_EXT_DOP_BIT                      = (1<<14) // valid gdop, tdop
 } GnssLocationInfoFlagBits;
 
 typedef enum {
@@ -417,6 +458,45 @@
     GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT  = (1<<4),
 } GnssAidingDataSvTypeBits;
 
+typedef enum
+{
+    GNSS_LOC_SV_SYSTEM_GPS                    = 1,
+    /**< GPS satellite. */
+    GNSS_LOC_SV_SYSTEM_GALILEO                = 2,
+    /**< GALILEO satellite. */
+    GNSS_LOC_SV_SYSTEM_SBAS                   = 3,
+    /**< SBAS satellite. */
+    GNSS_LOC_SV_SYSTEM_COMPASS                = 4,
+    /**< COMPASS satellite. */
+    GNSS_LOC_SV_SYSTEM_GLONASS                = 5,
+    /**< GLONASS satellite. */
+    GNSS_LOC_SV_SYSTEM_BDS                    = 6,
+    /**< BDS satellite. */
+    GNSS_LOC_SV_SYSTEM_QZSS                   = 7
+    /**< QZSS satellite. */
+} Gnss_LocSvSystemEnumType;
+
+typedef uint32_t GnssSystemTimeStructTypeFlags;
+typedef enum {
+    GNSS_SYSTEM_TIME_WEEK_VALID             = (1 << 0),
+    GNSS_SYSTEM_TIME_WEEK_MS_VALID          = (1 << 1),
+    GNSS_SYSTEM_CLK_TIME_BIAS_VALID         = (1 << 2),
+    GNSS_SYSTEM_CLK_TIME_BIAS_UNC_VALID     = (1 << 3),
+    GNSS_SYSTEM_REF_FCOUNT_VALID            = (1 << 4),
+    GNSS_SYSTEM_NUM_CLOCK_RESETS_VALID      = (1 << 5)
+} GnssSystemTimeTypeBits;
+
+typedef uint32_t GnssGloTimeStructTypeFlags;
+typedef enum {
+    GNSS_CLO_DAYS_VALID                     = (1 << 0),
+    GNSS_GLOS_MSEC_VALID                    = (1 << 1),
+    GNSS_GLO_CLK_TIME_BIAS_VALID            = (1 << 2),
+    GNSS_GLO_CLK_TIME_BIAS_UNC_VALID        = (1 << 3),
+    GNSS_GLO_REF_FCOUNT_VALID               = (1 << 4),
+    GNSS_GLO_NUM_CLOCK_RESETS_VALID         = (1 << 5),
+    GNSS_GLO_FOUR_YEAR_VALID                = (1 << 6)
+} GnssGloTimeTypeBits;
+
 typedef struct {
     GnssAidingDataSvMask svMask;         // bitwise OR of GnssAidingDataSvBits
     GnssAidingDataSvTypeMask svTypeMask; // bitwise OR of GnssAidingDataSvTypeBits
@@ -548,18 +628,141 @@
 } GeofenceStatusNotification;
 
 typedef struct {
+    uint64_t gpsSvUsedIdsMask;
+    uint64_t gloSvUsedIdsMask;
+    uint64_t galSvUsedIdsMask;
+    uint64_t bdsSvUsedIdsMask;
+    uint64_t qzssSvUsedIdsMask;
+} GnssLocationSvUsedInPosition;
+
+/** @struct
+    Body Frame parameters
+*/
+typedef struct {
+    GnssLocationPosDataMask bodyFrameDataMask; // Contains Body frame LocPosDataMask bits
+    float longAccel;                           // Forward Acceleration in body frame (m/s2)
+    float latAccel;                            // Sideward Acceleration in body frame (m/s2)
+    float vertAccel;                           // Vertical Acceleration in body frame (m/s2)
+    float yawRate;                             // Heading Rate (Radians/second)
+    float pitch;                               // Body pitch (Radians)
+} GnssLocationPositionDynamics;
+
+typedef struct {
+    /** Validity mask for below fields */
+    GnssSystemTimeStructTypeFlags validityMask;
+    /** Extended week number at reference tick.
+    Unit: Week.
+    Set to 65535 if week number is unknown.
+    For GPS:
+      Calculated from midnight, Jan. 6, 1980.
+      OTA decoded 10 bit GPS week is extended to map between:
+      [NV6264 to (NV6264 + 1023)].
+      NV6264: Minimum GPS week number configuration.
+      Default value of NV6264: 1738
+    For BDS:
+      Calculated from 00:00:00 on January 1, 2006 of Coordinated Universal Time (UTC).
+    For GAL:
+      Calculated from 00:00 UT on Sunday August 22, 1999 (midnight between August 21 and August 22).
+   */
+    uint16_t systemWeek;
+    /** Time in to the current week at reference tick.
+       Unit: Millisecond. Range: 0 to 604799999.
+       Check for systemClkTimeUncMs before use */
+    uint32_t systemMsec;
+    /** System clock time bias (sub-millisecond)
+        Units: Millisecond
+        Note: System time (TOW Millisecond) = systemMsec - systemClkTimeBias.
+        Check for systemClkTimeUncMs before use. */
+    float systemClkTimeBias;
+    /** Single sided maximum time bias uncertainty
+        Units: Millisecond */
+    float systemClkTimeUncMs;
+    /** FCount (free running HW timer) value. Don't use for relative time purpose
+         due to possible discontinuities.
+         Unit: Millisecond */
+    uint32_t refFCount;
+    /** Number of clock resets/discontinuities detected, affecting the local hardware counter value. */
+    uint32_t numClockResets;
+} GnssSystemTimeStructType;
+
+typedef struct {
+    /** GLONASS day number in four years. Refer to GLONASS ICD.
+        Applicable only for GLONASS and shall be ignored for other constellations.
+        If unknown shall be set to 65535 */
+    uint16_t gloDays;
+    /** Validity mask for below fields */
+    GnssGloTimeStructTypeFlags validityMask;
+    /** GLONASS time of day in Millisecond. Refer to GLONASS ICD.
+        Units: Millisecond
+        Check for gloClkTimeUncMs before use */
+    uint32_t gloMsec;
+    /** GLONASS clock time bias (sub-millisecond)
+        Units: Millisecond
+        Note: GLO time (TOD Millisecond) = gloMsec - gloClkTimeBias.
+        Check for gloClkTimeUncMs before use. */
+    float gloClkTimeBias;
+    /** Single sided maximum time bias uncertainty
+        Units: Millisecond */
+    float gloClkTimeUncMs;
+    /** FCount (free running HW timer) value. Don't use for relative time purpose
+        due to possible discontinuities.
+        Unit: Millisecond */
+    uint32_t  refFCount;
+    /** Number of clock resets/discontinuities detected, affecting the local hardware counter value. */
+    uint32_t numClockResets;
+    /** GLONASS four year number from 1996. Refer to GLONASS ICD.
+        Applicable only for GLONASS and shall be ignored for other constellations.
+        If unknown shall be set to 255 */
+    uint8_t gloFourYear;
+} GnssGloTimeStructType;
+
+typedef union {
+    GnssSystemTimeStructType gpsSystemTime;
+    GnssSystemTimeStructType galSystemTime;
+    GnssSystemTimeStructType bdsSystemTime;
+    GnssSystemTimeStructType qzssSystemTime;
+    GnssGloTimeStructType gloSytemTime;
+} SystemTimeStructUnion;
+    /** Time applicability of PVT report */
+typedef struct {
+    /** Specifies GNSS system time reported. Mandatory field */
+    Gnss_LocSvSystemEnumType gnssSystemTimeSrc;
+    /** Reporting of GPS system time is recommended.
+      If GPS time is unknown & other satellite system time is known,
+      it should be reported.
+      Mandatory field
+     */
+    SystemTimeStructUnion u;
+} GnssSystemTime;
+
+typedef struct {
     size_t size;                        // set to sizeof(GnssLocationInfo)
     GnssLocationInfoFlagMask flags;     // bitwise OR of GnssLocationInfoBits for param validity
     float altitudeMeanSeaLevel;         // altitude wrt mean sea level
     float pdop;                         // position dilusion of precision
     float hdop;                         // horizontal dilusion of precision
     float vdop;                         // vertical dilusion of precision
+    float gdop;                         // geometric  dilution of precision
+    float tdop;                         // time dilution of precision
     float magneticDeviation;            // magnetic deviation
     LocationReliability horReliability; // horizontal reliability
     LocationReliability verReliability; // vertical reliability
     float horUncEllipseSemiMajor;       // horizontal elliptical accuracy semi-major axis
     float horUncEllipseSemiMinor;       // horizontal elliptical accuracy semi-minor axis
     float horUncEllipseOrientAzimuth;   // horizontal elliptical accuracy azimuth
+    float northVelocity;                // North Velocity.Unit: Meters/sec
+    float eastVelocity;                 // East Velocity
+    float upVelocity;
+    float northVelocityStdDeviation;
+    float eastVelocityStdDeviation;
+    float upVelocityStdDeviation;
+    GnssLocationSvUsedInPosition svUsedInPosition;// Gnss sv used in position data
+    GnssLocationNavSolutionMask navSolutionMask;  // Nav solution mask to indicate sbas corrections
+    GnssLocationPosTechMask posTechMask;          // Position technology used in computing this fix
+    GnssLocationPositionDynamics bodyFrameData;   // Body Frame Dynamics: 4wayAcceleration and
+                                                  // pitch set with validity
+    GnssSystemTime gnssSystemTime;            // GNSS System Time
+    Location location;
 } GnssLocationInfoNotification;
 
 typedef struct {
diff --git a/sdm845/utils/gps_extended_c.h b/sdm845/utils/gps_extended_c.h
index 01f469d..66ca61b 100644
--- a/sdm845/utils/gps_extended_c.h
+++ b/sdm845/utils/gps_extended_c.h
@@ -133,13 +133,6 @@
     /* Provider indicator for HYBRID or GPS */
     uint16_t        position_source;
     LocPosTechMask  tech_mask;
-    /*allows HAL to pass additional information related to the location */
-    int             rawDataSize;         /* in # of bytes */
-    void            * rawData;
-    bool            is_indoor;
-    float           floor_number;
-    char            map_url[GPS_LOCATION_MAP_URL_SIZE];
-    unsigned char   map_index[GPS_LOCATION_MAP_INDEX_SIZE];
 } UlpLocation;
 
 typedef struct {
@@ -746,25 +739,6 @@
 #define ULP_GNSS_SV_POLY_BIT_VELO_COEFF             (1<<ULP_GNSS_SV_POLY_VELO_COEFF)
 #define ULP_GNSS_SV_POLY_BIT_ENHANCED_IOD           (1<<ULP_GNSS_SV_POLY_ENHANCED_IOD)
 
-
-typedef enum
-{
-    GNSS_LOC_SV_SYSTEM_GPS                    = 1,
-    /**< GPS satellite. */
-    GNSS_LOC_SV_SYSTEM_GALILEO                = 2,
-    /**< GALILEO satellite. */
-    GNSS_LOC_SV_SYSTEM_SBAS                   = 3,
-    /**< SBAS satellite. */
-    GNSS_LOC_SV_SYSTEM_COMPASS                = 4,
-    /**< COMPASS satellite. */
-    GNSS_LOC_SV_SYSTEM_GLONASS                = 5,
-    /**< GLONASS satellite. */
-    GNSS_LOC_SV_SYSTEM_BDS                    = 6,
-    /**< BDS satellite. */
-    GNSS_LOC_SV_SYSTEM_QZSS                   = 7
-    /**< QZSS satellite. */
-} Gnss_LocSvSystemEnumType;
-
 typedef enum
 {
     GNSS_LOC_FREQ_SOURCE_INVALID = 0,