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

Commit 7d3fb2d6 authored by Victoria Lease's avatar Victoria Lease Committed by Android Git Automerger
Browse files

am 881e1a6b: Merge "do not request location from unavailable providers" into klp-dev

* commit '881e1a6b':
  do not request location from unavailable providers
parents 7555372f 881e1a6b
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);