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

Commit 76519950 authored by Yu-Han Yang's avatar Yu-Han Yang
Browse files

Drop invalid GNSS location instead of crash

Do not crash system server with new scenarios to avoid OTA devices from
experiencing new crashes

Bug: 314328533
Test: manual
Change-Id: I5ae868b840b5445105c57cab96aaf7be5fb504eb
parent 55e27576
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1384,7 +1384,8 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
        try {
            reportLocation(LocationResult.wrap(location).validate());
        } catch (BadLocationException e) {
            throw new IllegalArgumentException(e);
            Log.e(TAG, "Dropping invalid location: " + e);
            return;
        }

        if (mStarted) {
@@ -1759,7 +1760,8 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
            try {
                reportLocation(LocationResult.wrap(locations).validate());
            } catch (BadLocationException e) {
                throw new IllegalArgumentException(e);
                Log.e(TAG, "Dropping invalid locations: " + e);
                return;
            }
        }