summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2016-06-07 15:14:06 -0700
committerKevin Tang <zhikait@codeaurora.org>2016-06-14 16:27:28 -0700
commit2fc8de7ad455d7e1c879fdfdcb1eb566d18b3298 (patch)
tree0140867999b96cee323fa3755376b348b2374277
parente090bfde99aa9638506671086eb3935f7e90f609 (diff)
downloadgps-2fc8de7ad455d7e1c879fdfdcb1eb566d18b3298.tar.gz
making SUPL ES run time configurable
SUPL ES gets updated as part of the sim specific AGPS config hot swap update. We keep that lastest SUPL ES and send that as part of the NI request, to let NI handler to know the config status. Change-Id: I566725d5db9b3abdbd9a423b86c10b819217f4f6 CRs-Fixed: 1024879
-rw-r--r--core/ContextBase.h7
-rw-r--r--core/gps_extended_c.h4
-rw-r--r--loc_api/libloc_api_50001/loc.cpp16
-rw-r--r--loc_api/libloc_api_50001/loc_eng.cpp3
-rw-r--r--loc_api/libloc_api_50001/loc_eng.h2
-rw-r--r--loc_api/libloc_api_50001/loc_eng_ni.cpp2
6 files changed, 26 insertions, 8 deletions
diff --git a/core/ContextBase.h b/core/ContextBase.h
index bd9a19f..1ed6715 100644
--- a/core/ContextBase.h
+++ b/core/ContextBase.h
@@ -47,12 +47,13 @@ typedef struct loc_gps_cfg_s
uint32_t ACCURACY_THRES;
uint32_t SUPL_VER;
uint32_t SUPL_MODE;
+ uint32_t SUPL_ES;
uint32_t CAPABILITIES;
uint32_t LPP_PROFILE;
uint32_t XTRA_VERSION_CHECK;
- char XTRA_SERVER_1[MAX_XTRA_SERVER_URL_LENGTH];
- char XTRA_SERVER_2[MAX_XTRA_SERVER_URL_LENGTH];
- char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH];
+ char XTRA_SERVER_1[MAX_XTRA_SERVER_URL_LENGTH];
+ char XTRA_SERVER_2[MAX_XTRA_SERVER_URL_LENGTH];
+ char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH];
uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL;
uint32_t NMEA_PROVIDER;
uint32_t GPS_LOCK;
diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h
index 9b677b8..2780ebc 100644
--- a/core/gps_extended_c.h
+++ b/core/gps_extended_c.h
@@ -170,14 +170,14 @@ typedef struct {
} AGpsExtCallbacks;
+typedef void (*loc_ni_notify_callback)(GpsNiNotification *notification, bool esEnalbed);
/** GPS NI callback structure. */
typedef struct
{
/**
* Sends the notification request from HAL to GPSLocationProvider.
*/
- gps_ni_notify_callback notify_cb;
- gps_create_thread create_thread_cb;
+ loc_ni_notify_callback notify_cb;
} GpsNiExtCallbacks;
typedef enum loc_server_type {
diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp
index 4453f14..ca9760d 100644
--- a/loc_api/libloc_api_50001/loc.cpp
+++ b/loc_api/libloc_api_50001/loc.cpp
@@ -52,9 +52,15 @@ using namespace loc_core;
//Globals defns
static gps_location_callback gps_loc_cb = NULL;
static gps_sv_status_callback gps_sv_cb = NULL;
+static gps_ni_notify_callback gps_ni_cb = NULL;
static void local_loc_cb(UlpLocation* location, void* locExt);
static void local_sv_cb(GpsSvStatus* sv_status, void* svExt);
+static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed);
+
+GpsNiExtCallbacks sGpsNiExtCallbacks = {
+ local_ni_cb
+};
static const GpsGeofencingInterface* get_geofence_interface(void);
@@ -967,7 +973,8 @@ SIDE EFFECTS
void loc_ni_init(GpsNiCallbacks *callbacks)
{
ENTRY_LOG();
- loc_eng_ni_init(loc_afw_data,(GpsNiExtCallbacks*) callbacks);
+ gps_ni_cb = callbacks->notify_cb;
+ loc_eng_ni_init(loc_afw_data, &sGpsNiExtCallbacks);
EXIT_LOG(%s, VOID_RET);
}
@@ -1082,3 +1089,10 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt)
EXIT_LOG(%s, VOID_RET);
}
+static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed)
+{
+ if (NULL != gps_ni_cb) {
+ gps_ni_cb(notification);
+ }
+}
+
diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp
index f150bc3..9dc0159 100644
--- a/loc_api/libloc_api_50001/loc_eng.cpp
+++ b/loc_api/libloc_api_50001/loc_eng.cpp
@@ -88,6 +88,7 @@ static const loc_param_s_type gps_conf_table[] =
{"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
{"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'},
{"SUPL_MODE", &gps_conf.SUPL_MODE, NULL, 'n'},
+ {"SUPL_ES", &gps_conf.SUPL_ES, NULL, 'n'},
{"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'},
{"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'},
{"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'},
@@ -129,6 +130,7 @@ static void loc_default_parameters(void)
gps_conf.GPS_LOCK = 0;
gps_conf.SUPL_VER = 0x10000;
gps_conf.SUPL_MODE = 0x3;
+ gps_conf.SUPL_ES = 0;
gps_conf.CAPABILITIES = 0x7;
/* LTE Positioning Profile configuration is disable by default*/
gps_conf.LPP_PROFILE = 0;
@@ -2779,6 +2781,7 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data,
gps_conf_tmp.LPP_PROFILE = gps_conf.LPP_PROFILE;
gps_conf_tmp.A_GLONASS_POS_PROTOCOL_SELECT = gps_conf.A_GLONASS_POS_PROTOCOL_SELECT;
gps_conf_tmp.SUPL_MODE = gps_conf.SUPL_MODE;
+ gps_conf_tmp.SUPL_ES = gps_conf.SUPL_ES;
gps_conf_tmp.GPS_LOCK = gps_conf.GPS_LOCK;
gps_conf = gps_conf_tmp;
}
diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h
index b1cfe72..1fe1375 100644
--- a/loc_api/libloc_api_50001/loc_eng.h
+++ b/loc_api/libloc_api_50001/loc_eng.h
@@ -89,7 +89,7 @@ typedef struct loc_eng_data_s
loc_sv_status_cb_ext sv_status_cb;
agps_status_extended agps_status_cb;
gps_nmea_callback nmea_cb;
- gps_ni_notify_callback ni_notify_cb;
+ loc_ni_notify_callback ni_notify_cb;
gps_set_capabilities set_capabilities_cb;
gps_acquire_wakelock acquire_wakelock_cb;
gps_release_wakelock release_wakelock_cb;
diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp
index a29784f..9b454c6 100644
--- a/loc_api/libloc_api_50001/loc_eng_ni.cpp
+++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp
@@ -188,7 +188,7 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
}
CALLBACK_LOG_CALLFLOW("ni_notify_cb - id", %d, notif->notification_id);
- loc_eng_data.ni_notify_cb((GpsNiNotification*)notif);
+ loc_eng_data.ni_notify_cb((GpsNiNotification*)notif, gps_conf.SUPL_ES != 0);
}
EXIT_LOG(%s, VOID_RET);
}