Ignore invalid location

Do not report invalid locatin to HAL.
Generate empty NEMA when status is LOC_SESS_FAILURE.

Bug: 64286361
CRs-Fixed: 2087261

Change-Id: Id5c47052eef5cae951c020fa8061e2c761c1152d
This commit is contained in:
Baili Feng 2017-08-04 12:57:04 +08:00 committed by Kevin Tang
parent ac16b8d821
commit 45c1850f21

View file

@ -1900,17 +1900,7 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation,
LocPosTechMask techMask) LocPosTechMask techMask)
{ {
bool reported = false; bool reported = false;
if (LOC_SESS_FAILURE == status) { // what's in the if is... (line by line)
Location invalidLocation = {};
invalidLocation.size = sizeof(Location);
for (auto it=mClientData.begin(); it != mClientData.end(); ++it) {
if (nullptr != it->second.trackingCb) {
it->second.trackingCb(invalidLocation);
}
}
reported = true;
}
// what's in the else if is... (line by line)
// 1. this is a final fix; and // 1. this is a final fix; and
// 1.1 it is a Satellite fix; or // 1.1 it is a Satellite fix; or
// 1.2 it is a sensor fix // 1.2 it is a sensor fix
@ -1920,7 +1910,7 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation,
// 2.2.1 there is inaccuracy; and // 2.2.1 there is inaccuracy; and
// 2.2.2 we care about inaccuracy; and // 2.2.2 we care about inaccuracy; and
// 2.2.3 the inaccuracy exceeds our tolerance // 2.2.3 the inaccuracy exceeds our tolerance
else if ((LOC_SESS_SUCCESS == status && if ((LOC_SESS_SUCCESS == status &&
((LOC_POS_TECH_MASK_SATELLITE | ((LOC_POS_TECH_MASK_SATELLITE |
LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_SENSORS |
LOC_POS_TECH_MASK_HYBRID) & LOC_POS_TECH_MASK_HYBRID) &