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

Commit 881e1a6b authored by Victoria Lease's avatar Victoria Lease Committed by Android (Google) Code Review
Browse files

Merge "do not request location from unavailable providers" into klp-dev

parents 85e5ed63 b30f3838
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ public class FusionEngine implements LocationListener {
    private void enableProvider(String name, long minTime) {
        ProviderStats stats = mStats.get(name);

        if (stats.available) {
            if (!stats.requested) {
                stats.requestTime = SystemClock.elapsedRealtime();
                stats.requested = true;
@@ -141,6 +142,7 @@ public class FusionEngine implements LocationListener {
                mLocationManager.requestLocationUpdates(name, minTime, 0, this, mLooper);
            }
        }
    }

    private void disableProvider(String name) {
        ProviderStats stats = mStats.get(name);
+1 −1
Original line number Diff line number Diff line
@@ -1473,7 +1473,7 @@ public class LocationManagerService extends ILocationManager.Stub {
                + " " + name + " " + request + " from " + packageName + "(" + uid + ")");
        LocationProviderInterface provider = mProvidersByName.get(name);
        if (provider == null) {
            throw new IllegalArgumentException("provider doesn't exist: " + provider);
            throw new IllegalArgumentException("provider doesn't exist: " + name);
        }

        UpdateRecord record = new UpdateRecord(name, request, receiver);