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:
parent
dc4419cb2e
commit
7170b25778
1 changed files with 4 additions and 21 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
EXIT_LOG(%d, ret_val);
|
||||
return ret_val;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue