android_device_mt6753_common/patches/hardware_libhardware/fix-gps-light-audio.patch

89 lines
2.4 KiB
Diff

diff -ur libhardware/include/hardware/gps.h libhardware_mtk/include/hardware/gps.h
--- libhardware/include/hardware/gps.h 2016-01-22 15:47:44.063878000 -0800
+++ libhardware_mtk/include/hardware/gps.h 2016-01-23 05:25:12.364466000 -0800
@@ -37,6 +37,9 @@
/** Milliseconds since January 1, 1970 */
typedef int64_t GpsUtcTime;
+/** Maximum number of GNSS SVs for gps_sv_status_callback(). */
+#define GNSS_MAX_SVS 256
+
/** Maximum number of SVs for gps_sv_status_callback(). */
#define GPS_MAX_SVS 32
@@ -482,6 +485,33 @@
float azimuth;
} GpsSvInfo;
+
+/** Represents GNSS SV information. */
+typedef struct {
+ /** set to sizeof(GnssSvInfo) */
+ size_t size;
+ /** Pseudo-random number for the SV. */
+ int prn;
+ /** Signal to noise ratio. */
+ float snr;
+ /** Elevation of SV in degrees. */
+ float elevation;
+ /** Azimuth of SV in degrees. */
+ float azimuth;
+ /**
+ * SVs have ephemeris data.
+ */
+ bool has_ephemeris;
+ /**
+ * SVs have almanac data.
+ */
+ bool has_almanac;
+ /**
+ * SVs were used for computing the most recent position fix.
+ */
+ bool used_in_fix;
+} GnssSvInfo;
+
/** Represents SV status. */
typedef struct {
/** set to sizeof(GpsSvStatus) */
@@ -511,6 +541,18 @@
} GpsSvStatus;
+/** Represents GNSS SV status. */
+typedef struct {
+ /** set to sizeof(GnssSvStatus) */
+ size_t size;
+
+ /** Number of SVs currently visible. */
+ int num_svs;
+
+ /** Contains an array of GNSS SV information. */
+ GnssSvInfo sv_list[GNSS_MAX_SVS];
+} GnssSvStatus;
+
/* 2G and 3G */
/* In 3G lac is discarded */
typedef struct {
@@ -550,6 +592,12 @@
*/
typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info);
+/**
+ * Callback with GNSS SV status information.
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (* gnss_sv_status_callback)(GnssSvStatus* sv_info);
+
/** Callback for reporting NMEA sentences.
* Can only be called from a thread created by create_thread_cb.
*/
@@ -583,6 +631,7 @@
gps_location_callback location_cb;
gps_status_callback status_cb;
gps_sv_status_callback sv_status_cb;
+ gnss_sv_status_callback gnss_sv_status_cb;
gps_nmea_callback nmea_cb;
gps_set_capabilities set_capabilities_cb;
gps_acquire_wakelock acquire_wakelock_cb;