diff options
author | Mekala Natarajan <mekalan@quicinc.com> | 2013-03-21 18:29:18 -0700 |
---|---|---|
committer | Ed Tam <etam@google.com> | 2013-03-31 21:51:43 -0700 |
commit | c65fed03538cb5e4a5b62d3ca114ff3cc5e87e60 (patch) | |
tree | 97759c2709ca2a135f82d17cc50d53cfb28089a0 /loc_api | |
parent | ade0338d23f65f84b098307df0b853b7837ded76 (diff) | |
download | gps-c65fed03538cb5e4a5b62d3ca114ff3cc5e87e60.tar.gz |
gps: Runtime detection between apq v/s mdm gps support
Change-Id: Icfb6edcb8a885bbaa55091b851fb2620d65045f8
Signed-off-by: Ed Tam <etam@google.com>
Diffstat (limited to 'loc_api')
-rw-r--r-- | loc_api/libloc_api_50001/loc.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 16bed3b..2173dbf 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -33,6 +33,8 @@ #include <hardware/gps.h> #include <loc_eng.h> #include <loc_log.h> +#include <fcntl.h> +#include <errno.h> static gps_location_callback gps_loc_cb = NULL; static gps_sv_status_callback gps_sv_cb = NULL; @@ -147,6 +149,7 @@ static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = #endif static loc_eng_data_s_type loc_afw_data; +static int gss_fd = 0; /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -189,6 +192,18 @@ const GpsInterface* gps_get_hardware_interface () // for gps.c extern "C" const GpsInterface* get_gps_interface() { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if (strcmp(baseband,"apq") == 0) + { + gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + gss_fd = open("/dev/gss", O_RDONLY); + if (gss_fd < 0) { + LOC_LOGE("GSS open failed: %s\n", strerror(errno)); + } + LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES); + } + return &sLocEngInterface; } /*=========================================================================== |