From 7170b25778208fbd3cbe62b003e8707f12bb6422 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Thu, 20 Mar 2014 11:16:00 -0700 Subject: [PATCH] Change to CPI logic CPI should not be dependent on persist.gps.qc_nlp_in_use property. It should only be dependent on whether CPI is enabled or not. Reduce confidence in position if required. CRs-Fixed: 639153 Change-Id: I9e54ab1ac605143843a2e19607ff8e2e20704d01 --- loc_api/libloc_api_50001/loc.cpp | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index d98a80fa..f421ad0b 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -508,33 +508,16 @@ SIDE EFFECTS ===========================================================================*/ static int loc_inject_location(double latitude, double longitude, float accuracy) { - static bool initialized = false; - static bool enable_cpi = true; - accuracy = 1000; ENTRY_LOG(); - if(!initialized) + if (accuracy < 1000) { - char value[PROPERTY_VALUE_MAX]; - memset(value, 0, sizeof(value)); - (void)property_get("persist.gps.qc_nlp_in_use", value, "0"); - if(0 == strcmp(value, "1")) - { - enable_cpi = false; - LOC_LOGI("GPS HAL coarse position injection disabled"); - } - else - { - LOC_LOGI("GPS HAL coarse position injection enabled"); - } - initialized = true; + accuracy = 1000; } int ret_val = 0; - if(enable_cpi) - { - ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); - } + ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + EXIT_LOG(%d, ret_val); return ret_val; }