From 7e9e68a3af03803d2e0ce792d750dd5bd8338e6c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 15 Dec 2014 17:49:40 -0800 Subject: [PATCH] support reinjecting supl url for sim hot swap modem might reset during sim hot swap, in which case the prior supl url shall be remembered so that can be reinjected. This change enables it. CRs-fixed: 771493 Change-Id: I86ec898a54bc8706720c29a1ea67ce27153ee981 --- loc_api/libloc_api_50001/loc_eng.cpp | 40 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 1b301060..6919aab4 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2523,29 +2523,29 @@ int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); int ret_val = 0; + LOC_LOGV("save the address, type: %d, hostname: %s, port: %d", + (int) type, hostname, port); + switch (type) + { + case LOC_AGPS_SUPL_SERVER: + strlcpy(loc_eng_data.supl_host_buf, hostname, + sizeof(loc_eng_data.supl_host_buf)); + loc_eng_data.supl_port_buf = port; + loc_eng_data.supl_host_set = 1; + break; + case LOC_AGPS_CDMA_PDE_SERVER: + strlcpy(loc_eng_data.c2k_host_buf, hostname, + sizeof(loc_eng_data.c2k_host_buf)); + loc_eng_data.c2k_port_buf = port; + loc_eng_data.c2k_host_set = 1; + break; + default: + LOC_LOGE("loc_eng_set_server_proxy, unknown server type = %d", (int) type); + } + if (NULL != loc_eng_data.adapter) { ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); - } else { - LOC_LOGW("set_server called before init. save the address, type: %d, hostname: %s, port: %d", - (int) type, hostname, port); - switch (type) - { - case LOC_AGPS_SUPL_SERVER: - strlcpy(loc_eng_data.supl_host_buf, hostname, - sizeof(loc_eng_data.supl_host_buf)); - loc_eng_data.supl_port_buf = port; - loc_eng_data.supl_host_set = 1; - break; - case LOC_AGPS_CDMA_PDE_SERVER: - strlcpy(loc_eng_data.c2k_host_buf, hostname, - sizeof(loc_eng_data.c2k_host_buf)); - loc_eng_data.c2k_port_buf = port; - loc_eng_data.c2k_host_set = 1; - break; - default: - LOC_LOGE("loc_eng_set_server_proxy, unknown server type = %d", (int) type); - } } EXIT_LOG(%d, ret_val);