Merge "Change to CPI logic"

This commit is contained in:
Linux Build Service Account 2014-04-02 10:21:08 -07:00 committed by Gerrit - the friendly Code Review server
commit 638bbddfef

View file

@ -514,33 +514,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;
}