DO NOT MERGE Adjust update interval when expiring location requests.

Cherry-pick I88b419c92940b7e536d48b26e5fc0f72f3c9e73d

This is a more complete solution for this issue that disables
location providers when expiring their last request *and* adjusts
update intervals when expiring any request. This should help
further limit battery drain when a high-frequency-update app
exits, as it allows the system to throttle the update interval
back down to something appropriate for the remaining listeners.

Bug: 7611837
Change-Id: I7629a90f4c693be4bf96d662bd3a8b06dae0b089
This commit is contained in:
Victoria Lease
2012-12-05 09:57:40 -08:00
parent 82a76800ad
commit 5959bf2d3c

View File

@@ -1710,9 +1710,6 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
for (UpdateRecord r : deadUpdateRecords) {
r.disposeLocked(true);
}
}
// let the provider know if we just disposed its last update record
if (records.size() == 0) {
applyRequirementsLocked(provider);
}
}