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

Commit b6aed2d3 authored by Svet Ganov's avatar Svet Ganov Committed by android-build-merger
Browse files

Merge \\\"Blame only location observers that actually receive updates\\\" into...

Merge \\\"Blame only location observers that actually receive updates\\\" into nyc-dev am: 4e85376f am: 7c62ead7
am: 07dcf7ab

Change-Id: I30356c19d3c13dbbc3852f8c39be070662117eae
parents 60687a72 07dcf7ab
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1431,6 +1431,13 @@ public class LocationManagerService extends ILocationManager.Stub {
                for (UpdateRecord record : records) {
                    if (isCurrentProfile(UserHandle.getUserId(record.mReceiver.mUid))) {
                        LocationRequest locationRequest = record.mRequest;

                        // Don't assign battery blame for update records whose
                        // client has no permission to receive location data.
                        if (!providerRequest.locationRequests.contains(locationRequest)) {
                            continue;
                        }

                        if (locationRequest.getInterval() <= thresholdInterval) {
                            if (record.mReceiver.mWorkSource != null
                                    && record.mReceiver.mWorkSource.size() > 0