Emergency SUPL

This change is for the new added emergency
SUPL session. Adding a new field in gps.conf
named SUPL_ES, which is for emergency supl NI.

CRs-fixed: 600375

Change-Id: I7c21c5589259df4f1cb7ec2f850e708b2c4faa1a
This commit is contained in:
Jiafei Wen 2013-11-20 17:04:39 -08:00 committed by Dante Russo
parent 3cf2a8f3b7
commit 39bc6e266b
5 changed files with 23 additions and 8 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@ -61,6 +61,8 @@ extern "C" {
#define ULP_MIN_INTERVAL_INVALID 0xffffffff
/*Emergency SUPL*/
#define GPS_NI_TYPE_EMERGENCY_SUPL 4
typedef struct {
/** set to sizeof(UlpLocation) */

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@ -161,7 +161,8 @@ static loc_name_val_s_type loc_eng_ni_types[] =
{
NAME_VAL( GPS_NI_TYPE_VOICE ),
NAME_VAL( GPS_NI_TYPE_UMTS_SUPL ),
NAME_VAL( GPS_NI_TYPE_UMTS_CTRL_PLANE )
NAME_VAL( GPS_NI_TYPE_UMTS_CTRL_PLANE ),
NAME_VAL( GPS_NI_TYPE_EMERGENCY_SUPL )
};
static int loc_eng_ni_type_num = sizeof(loc_eng_ni_types) / sizeof(loc_name_val_s_type);

View file

@ -29,6 +29,9 @@ INTERMEDIATE_POS=0
# supl version 1.0
SUPL_VER=0x10000
# Emergency SUPL, 1=enable, 0=disable
SUPL_ES=1
# GPS Capabilities bit mask
# SCHEDULING = 0x01
# MSB = 0x02

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@ -218,6 +218,8 @@ static void* ni_thread_proc(void *args)
"pthread_cond_timedwait = %d\n",rc );
loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/
LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->resp);
// adding this check to support modem restart, in which case, we need the thread
// to exit without calling sending data. We made sure that rawRequest is NULL in
// loc_eng_ni_reset_on_engine_restart()
@ -225,9 +227,14 @@ static void* ni_thread_proc(void *args)
LocEngInformNiResponse *msg = NULL;
if (NULL != loc_eng_ni_data_p->rawRequest) {
msg = new LocEngInformNiResponse(adapter,
loc_eng_ni_data_p->resp,
loc_eng_ni_data_p->rawRequest);
if (loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE) {
LOC_LOGD("loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE \n");
msg = new LocEngInformNiResponse(adapter,
loc_eng_ni_data_p->resp,
loc_eng_ni_data_p->rawRequest);
} else {
LOC_LOGD("this is the ignore reply for SUPL ES\n");
}
loc_eng_ni_data_p->rawRequest = NULL;
}
pthread_mutex_unlock(&loc_eng_ni_data_p->tLock);
@ -236,6 +243,7 @@ static void* ni_thread_proc(void *args)
loc_eng_ni_data_p->reqID++;
if (NULL != msg) {
LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n");
adapter->sendMsg(msg);
}

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2009,2011 The Linux Foundation. All rights reserved.
/* Copyright (c) 2009,2011,2014 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@ -34,6 +34,7 @@
#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */
#define LOC_NI_NOTIF_KEY_ADDRESS "Address"
#define GPS_NI_RESPONSE_IGNORE 4
typedef struct {
pthread_t thread; /* NI thread */