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

Commit 04cff6c9 authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Ensure test provider turns real provider off

Real providers can be turned off when replaced with a test provider,
saving some potential battery cost.

BUG: 128442322
Test: manual
Change-Id: I9beaee8c6c92fae765ad2bde53a20147f5b457b8
parent 61cd3214
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -1824,12 +1824,7 @@ public class LocationManagerService extends ILocationManager.Stub {
    @GuardedBy("mLock")
    private void removeProviderLocked(LocationProvider provider) {
        if (mProviders.remove(provider)) {
            long identity = Binder.clearCallingIdentity();
            try {
            provider.onUseableChangedLocked(false);
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
    }

@@ -2108,7 +2103,9 @@ public class LocationManagerService extends ILocationManager.Stub {
        WorkSource worksource = new WorkSource();
        ProviderRequest providerRequest = new ProviderRequest();

        if (records != null && !records.isEmpty()) {
        // if provider is not active, it should not respond to requests

        if (mProviders.contains(provider) && records != null && !records.isEmpty()) {
            long backgroundThrottleInterval;

            long identity = Binder.clearCallingIdentity();