Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9cb358f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Drop locations with invalid lat or lng"

parents 4e8dff1f a351e48b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -890,6 +890,15 @@ public class LocationProviderManager extends

                        @Override
                        public boolean test(Location location) {
                            if (Double.isNaN(location.getLatitude()) || location.getLatitude() < -90
                                    || location.getLatitude() > 90
                                    || Double.isNaN(location.getLongitude())
                                    || location.getLongitude() < -180
                                    || location.getLongitude() > 180) {
                                Log.e(TAG, mName + " provider registration " + getIdentity()
                                        + " dropped delivery - invalid latitude or longitude.");
                                return false;
                            }
                            if (mPreviousLocation != null) {
                                // check fastest interval
                                long deltaMs = location.getElapsedRealtimeMillis()