OSDN Git Service

gps: Add hooks for GPS location injection.
authorMike Lockwood <lockwood@android.com>
Thu, 11 Jun 2009 16:27:28 +0000 (12:27 -0400)
committerMike Lockwood <lockwood@android.com>
Thu, 11 Jun 2009 16:44:52 +0000 (12:44 -0400)
This will allow injecting cell ID location to the GPS
(not implemented yet).
Signed-off-by: Mike Lockwood <lockwood@android.com>
gps/gps_qemu.c
include/hardware_legacy/gps.h

index feae89f..249097d 100644 (file)
@@ -845,6 +845,12 @@ qemu_gps_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty)
     return 0;
 }
 
+static int
+qemu_gps_inject_location(double latitude, double longitude, float accuracy)
+{
+    return 0;
+}
+
 static void
 qemu_gps_delete_aiding_data(GpsAidingData flags)
 {
@@ -868,6 +874,7 @@ static const GpsInterface  qemuGpsInterface = {
     qemu_gps_stop,
     qemu_gps_cleanup,
     qemu_gps_inject_time,
+    qemu_gps_inject_location,
     qemu_gps_delete_aiding_data,
     qemu_gps_set_position_mode,
     qemu_gps_get_extension,
index 8aadf42..62b3ee0 100644 (file)
@@ -219,6 +219,13 @@ typedef struct {
     int   (*inject_time)(GpsUtcTime time, int64_t timeReference,
                          int uncertainty);
 
+    /** Injects current location from another location provider
+     *  (typically cell ID).
+     *  latitude and longitude are measured in degrees
+     *  expected accuracy is measured in meters
+     */
+    int  (*inject_location)(double latitude, double longitude, float accuracy);
+
     /**
      * Specifies that the next call to start will not use the
      * information defined in the flags. GPS_DELETE_ALL is passed for