Service modem's request for NTP time
Previously, modem's request for NTP time was not supported. This change enables that request to be serviced through the HAL and current NTP time is injected into the modem CRs-Fixed: 406357 Change-Id: I471f98cf57a276902d7991da48cf7244fe798318
This commit is contained in:
parent
b1c6ba1ffc
commit
2051ffae1f
5 changed files with 16 additions and 7 deletions
|
@ -201,9 +201,9 @@ void LocApiAdapter::requestXtraData()
|
|||
|
||||
void LocApiAdapter::requestTime()
|
||||
{
|
||||
LOC_LOGD("loc_event_cb: XTRA time download request... not supported");
|
||||
// loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME));
|
||||
// locEngHandle.sendMsge(locEngHandle.owner, msg);
|
||||
LOC_LOGD("loc_event_cb: XTRA time download request");
|
||||
loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME));
|
||||
locEngHandle.sendMsge(locEngHandle.owner, msg);
|
||||
}
|
||||
|
||||
void LocApiAdapter::requestLocation()
|
||||
|
|
|
@ -334,7 +334,8 @@ static int loc_init(GpsCallbacks* callbacks)
|
|||
callbacks->release_wakelock_cb, /* release_wakelock_cb */
|
||||
callbacks->create_thread_cb, /* create_thread_cb */
|
||||
NULL, /* location_ext_parser */
|
||||
NULL /* sv_ext_parser */};
|
||||
NULL, /* sv_ext_parser */
|
||||
callbacks->request_utc_time_cb /* request_utc_time_cb */};
|
||||
gps_loc_cb = callbacks->location_cb;
|
||||
gps_sv_cb = callbacks->sv_status_cb;
|
||||
|
||||
|
@ -499,7 +500,6 @@ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertain
|
|||
{
|
||||
ENTRY_LOG();
|
||||
int ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty);
|
||||
|
||||
EXIT_LOG(%d, ret_val);
|
||||
return ret_val;
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ typedef struct {
|
|||
gps_create_thread create_thread_cb;
|
||||
loc_ext_parser location_ext_parser;
|
||||
loc_ext_parser sv_ext_parser;
|
||||
gps_request_utc_time request_utc_time_cb;
|
||||
} LocCallbacks;
|
||||
|
||||
enum loc_sess_status {
|
||||
|
|
|
@ -298,7 +298,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
|
|||
loc_eng_data.nmea_cb = callbacks->nmea_cb;
|
||||
loc_eng_data.acquire_wakelock_cb = callbacks->acquire_wakelock_cb;
|
||||
loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb;
|
||||
|
||||
loc_eng_data.request_utc_time_cb = callbacks->request_utc_time_cb;
|
||||
loc_eng_data.intermediateFix = gps_conf.INTERMEDIATE_POS;
|
||||
|
||||
// initial states taken care of by the memset above
|
||||
|
@ -683,7 +683,6 @@ int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time,
|
|||
uncertainty));
|
||||
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
||||
msg, loc_eng_free_msg);
|
||||
|
||||
EXIT_LOG(%d, 0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1682,6 +1681,14 @@ static void loc_eng_deferred_action_thread(void* arg)
|
|||
break;
|
||||
|
||||
case LOC_ENG_MSG_REQUEST_TIME:
|
||||
if (loc_eng_data_p->request_utc_time_cb != NULL)
|
||||
{
|
||||
loc_eng_data_p->request_utc_time_cb();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOC_LOGE("%s] ERROR: Callback function for request_time is NULL", __func__);
|
||||
}
|
||||
break;
|
||||
|
||||
case LOC_ENG_MSG_REQUEST_POSITION:
|
||||
|
|
|
@ -106,6 +106,7 @@ typedef struct
|
|||
gps_ni_notify_callback ni_notify_cb;
|
||||
gps_acquire_wakelock acquire_wakelock_cb;
|
||||
gps_release_wakelock release_wakelock_cb;
|
||||
gps_request_utc_time request_utc_time_cb;
|
||||
ulp_network_location_request ulp_network_callback;
|
||||
ulp_request_phone_context ulp_phone_context_req_cb;
|
||||
boolean intermediateFix;
|
||||
|
|
Loading…
Reference in a new issue