Add 0,0 location check

Ignore 0,0 locations from any real provider.

Test: n/a
Bug: 142977619
Change-Id: Ia3fd9712b6a8b3881ebfe2b29279700fa4b32d0f
This commit is contained in:
Soonil Nagarkar
2019-10-18 17:32:38 -07:00
parent e4f30281d2
commit 7fc24c6578

View File

@@ -1000,6 +1000,12 @@ public class LocationManagerService extends ILocationManager.Stub {
@Override
public void onReportLocation(Location location) {
// likelihood of a 0,0 bug is far greater than this being a valid location
if (!isMock() && location.getLatitude() == 0 && location.getLongitude() == 0) {
Slog.w(TAG, "blocking 0,0 location from " + mName + " provider");
return;
}
synchronized (mLock) {
handleLocationChangedLocked(location, this);
}