From 5959bf2d3c7fcfa4058cbcf81c3dc376c962d25e Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Wed, 5 Dec 2012 09:57:40 -0800 Subject: [PATCH] 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 --- services/java/com/android/server/LocationManagerService.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index 233a0517907dc..f21f826d9fd8f 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -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); } }