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
This commit is contained in:
Bhavna Sharma 2014-03-20 11:16:00 -07:00
parent dc4419cb2e
commit 7170b25778

View file

@ -508,33 +508,16 @@ SIDE EFFECTS
===========================================================================*/ ===========================================================================*/
static int loc_inject_location(double latitude, double longitude, float accuracy) static int loc_inject_location(double latitude, double longitude, float accuracy)
{ {
static bool initialized = false;
static bool enable_cpi = true;
accuracy = 1000;
ENTRY_LOG(); ENTRY_LOG();
if(!initialized) if (accuracy < 1000)
{ {
char value[PROPERTY_VALUE_MAX]; accuracy = 1000;
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;
} }
int ret_val = 0; 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); EXIT_LOG(%d, ret_val);
return ret_val; return ret_val;
} }