From 8dd8689be20398a79804f8b5c6713bdf50e2128b Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Tue, 9 Apr 2013 14:33:42 -0700 Subject: [PATCH] gps.conf: Removed the option to configure ulp on/off Since the switch for ulp in gps.conf did not truly turn QCA implementation for Fused Location Provider on/off this change removes this redundant parameter from gps.conf Change-Id: I677c42a00e6b0d156c2e4c3b65da13a55eb97279 CRs-Fixed: 461273 --- etc/gps.conf | 5 ++--- loc_api/libloc_api_50001/loc.cpp | 15 +++------------ loc_api/libloc_api_50001/loc_eng.cpp | 12 ++++++------ loc_api/libloc_api_50001/loc_ulp.h | 3 --- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index b38526a2..f3396d20 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -31,9 +31,8 @@ SUPL_VER=0x10000 # MSB = 2 # MSA = 4 # ON_DEMAND_TIME = 0x10 -# ULP = 0x20 -# default = MSA | MSB | SCHEDULING | ULP -CAPABILITIES=0x27 +# default = MSA | MSB | SCHEDULING +CAPABILITIES=0x7 # Accuracy threshold for intermediate positions # less accurate positions are ignored, 0 for passing all positions diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index fc6a2168..c878d642 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -234,10 +234,8 @@ extern "C" const GpsInterface* get_gps_interface() targetEnumType target = TARGET_OTHER; loc_eng_read_config(); - //We load up libulp module at this point itself if ULP configured to be On - if(gps_conf.CAPABILITIES & ULP_CAPABILITY) { - loc_eng_ulp_inf = loc_eng_get_ulp_inf(); - } + //We load up libulp module at this point itself + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); target = get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); @@ -686,10 +684,7 @@ const void* loc_get_extension(const char* name) } else if(strcmp(name, ULP_NETWORK_INTERFACE) == 0) { - //Return a valid value for ULP Network Interface only if ULP - //turned on in gps.conf - if(gps_conf.CAPABILITIES & ULP_CAPABILITY) - ret_val = &sUlpNetworkInterface; + ret_val = &sUlpNetworkInterface; } else @@ -1077,10 +1072,6 @@ const ulpInterface * loc_eng_get_ulp_inf(void) get_ulp_interface* get_ulp_inf; const ulpInterface* loc_eng_ulpInf = NULL; - if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { - LOC_LOGD ("%s, ULP is not configured to be On in gps.conf\n", __func__); - goto exit; - } dlerror(); /* Clear any existing error */ handle = dlopen ("libulp2.so", RTLD_NOW); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 09e9c4c3..28cbb6e8 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -522,7 +522,7 @@ int loc_eng_start(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { //Pass the start messgage to ULP if present & activated loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_START_FIX)); @@ -580,7 +580,7 @@ int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { //Pass the start messgage to ULP if present & activated loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_STOP_FIX)); @@ -2014,7 +2014,7 @@ bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, LOC_LOGD("loc_eng_send_extra_command: %s\n", command); ret_val = TRUE; - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { ulp_msg_inject_raw_command *msg( new ulp_msg_inject_raw_command(&loc_eng_data,command, length)); @@ -2053,7 +2053,7 @@ int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, INIT_CHECK(loc_eng_data.context, return -1); int ret_val; - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { LOC_LOGD("SJ:loc_eng_update_criteria: valid 0x%x action:%d, minTime:%ld, minDistance:%f, singleShot:%d, horizontalAccuracy:%d, powerRequirement:%d \n", criteria.valid_mask, criteria.action, criteria.min_interval, criteria.min_distance, criteria.recurrence_type, criteria.preferred_horizontal_accuracy, @@ -2102,7 +2102,7 @@ int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, settings->is_wifi_setting_enabled, settings->is_agps_enabled, settings->is_enh_location_services_enabled ); - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { ulp_msg_inject_phone_context_settings *msg (new ulp_msg_inject_phone_context_settings(&loc_eng_data, *settings)); @@ -2203,7 +2203,7 @@ int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, { ENTRY_LOG(); int ret_val = 0; - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { ulp_msg_inject_network_position *msg (new ulp_msg_inject_network_position(&loc_eng_data, *position_report)); diff --git a/loc_api/libloc_api_50001/loc_ulp.h b/loc_api/libloc_api_50001/loc_ulp.h index 75636993..deb8586d 100644 --- a/loc_api/libloc_api_50001/loc_ulp.h +++ b/loc_api/libloc_api_50001/loc_ulp.h @@ -63,9 +63,6 @@ extern "C" { /** Position source is GNSS only */ #define ULP_LOCATION_IS_FROM_GNSS 0x0002 -/* Hybrid support, the Android Framework will query to see if this capability is set before using the ulp functionalities in HAL */ -#define ULP_CAPABILITY 0x0000020 - #define ULP_MIN_INTERVAL_INVALID 0xffffffff /** Represents recurrence of location */