Reinitialize dataservice client post SSR

On SSR invoke dsi_release() and dsi_init(Mode_SSR) to recover
data call functionality post SSR.

Change-Id: Ie784dad73ae8d6d91cf4cb87efe938af9015a7a2
CRs-Fixed: 1073101
This commit is contained in:
Harikrishnan Hariharan 2016-10-18 17:13:20 +05:30 committed by Gerrit - the friendly Code Review server
parent c75f2c6908
commit 1de8a18031
4 changed files with 54 additions and 5 deletions

View file

@ -549,7 +549,7 @@ enum loc_api_adapter_err LocApiBase::
}
int LocApiBase::
initDataServiceClient()
initDataServiceClient(bool isDueToSsr)
DEFAULT_IMPL(-1)
int LocApiBase::
@ -564,6 +564,10 @@ void LocApiBase::
closeDataCall()
DEFAULT_IMPL()
void LocApiBase::
releaseDataServiceClient()
DEFAULT_IMPL()
int LocApiBase::
setGpsLock(LOC_GPS_LOCK_MASK lock)
DEFAULT_IMPL(-1)

View file

@ -215,10 +215,11 @@ public:
getBestAvailableZppFix(GpsLocation & zppLoc);
virtual enum loc_api_adapter_err
getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask);
virtual int initDataServiceClient();
virtual int initDataServiceClient(bool isDueToSsr);
virtual int openAndStartDataCall();
virtual void stopDataCall();
virtual void closeDataCall();
virtual void releaseDataServiceClient();
virtual void installAGpsCert(const DerEncodedCertificate* pData,
size_t length,
uint32_t slotBitMask);

View file

@ -240,9 +240,9 @@ public:
{
return mLocApi->setLPPeProtocol(lppeCP, lppeUP);
}
inline virtual int initDataServiceClient()
inline virtual int initDataServiceClient(bool isDueToSsr)
{
return mLocApi->initDataServiceClient();
return mLocApi->initDataServiceClient(isDueToSsr);
}
inline virtual int openAndStartDataCall()
{
@ -256,6 +256,10 @@ public:
{
mLocApi->closeDataCall();
}
inline virtual void releaseDataServiceClient()
{
mLocApi->releaseDataServiceClient();
}
inline enum loc_api_adapter_err
getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask)
{

View file

@ -186,6 +186,7 @@ static void loc_default_parameters(void)
// 2nd half of init(), singled out for
// modem restart to use.
static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data);
static void loc_eng_dsclient_release(loc_eng_data_s_type &loc_eng_data);
static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data);
static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data,
@ -2308,6 +2309,39 @@ static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data)
}
EXIT_LOG(%s, VOID_RET);
}
/*===========================================================================
FUNCTION loc_eng_dsclient_release
DESCRIPTION
Stop/Close/Release DS client when modem SSR happens.
DEPENDENCIES
NONE
RETURN VALUE
0
SIDE EFFECTS
N/A
===========================================================================*/
static void loc_eng_dsclient_release(loc_eng_data_s_type &loc_eng_data)
{
ENTRY_LOG();
int result = 1;
LocEngAdapter* adapter = loc_eng_data.adapter;
if (NULL != adapter && gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL)
{
// stop and close the ds client
adapter->stopDataCall();
adapter->closeDataCall();
adapter->releaseDataServiceClient();
}
EXIT_LOG(%s, VOID_RET);
}
/*===========================================================================
FUNCTION loc_eng_agps_init
@ -2378,7 +2412,7 @@ static void createAgnssNifs(loc_eng_data_s_type& locEng) {
}
if (NULL == locEng.ds_nif &&
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL &&
0 == adapter->initDataServiceClient()) {
0 == adapter->initDataServiceClient(false)) {
locEng.ds_nif = new DSStateMachine(servicerTypeExt,
(void *)dataCallCb,
locEng.adapter);
@ -2912,6 +2946,12 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data)
if (loc_eng_data.internet_nif)
loc_eng_data.internet_nif->dropAllSubscribers();
// reinitialize DS client in SSR mode
loc_eng_dsclient_release(loc_eng_data);
if (loc_eng_data.adapter->mSupportsAgpsRequests &&
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) {
loc_eng_data.adapter->initDataServiceClient(true);
}
loc_eng_agps_reinit(loc_eng_data);
}