From c65fed03538cb5e4a5b62d3ca114ff3cc5e87e60 Mon Sep 17 00:00:00 2001 From: Mekala Natarajan Date: Thu, 21 Mar 2013 18:29:18 -0700 Subject: [PATCH] gps: Runtime detection between apq v/s mdm gps support Change-Id: Icfb6edcb8a885bbaa55091b851fb2620d65045f8 Signed-off-by: Ed Tam --- loc_api/libloc_api_50001/loc.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 16bed3b1..2173dbfd 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include 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; } /*===========================================================================