Merge "Add 0,0 location check"

This commit is contained in:
TreeHugger Robot
2019-10-22 19:58:34 +00:00
committed by Android (Google) Code Review

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);
}