summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDavid Christie <dnchrist@google.com>2013-12-18 14:33:57 -0800
committerdcashman <dcashman@google.com>2014-01-06 15:30:34 -0800
commit766b5c4342898054ad2036764d811057812cc562 (patch)
tree767d4e75392eb711397e4862c3c5b3d3c646a42b /services
parent562fddce2f154f8adec91cc8a4c4ef1fb4eabcfe (diff)
downloadframeworks_base-766b5c4342898054ad2036764d811057812cc562.zip
frameworks_base-766b5c4342898054ad2036764d811057812cc562.tar.gz
frameworks_base-766b5c4342898054ad2036764d811057812cc562.tar.bz2
Clear cached locations when location providers disabled
Bug: 12118307 (cherry picked from commit b084fef18ee1b5d24d15cff37dc3a053933d361e) Change-Id: Ief869b9e38858092bfa3f8d6d090a278dee7d86c
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/LocationManagerService.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index f784030..6c97956 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -1019,6 +1019,11 @@ public class LocationManagerService extends ILocationManager.Stub {
boolean shouldBeEnabled = isAllowedByCurrentUserSettingsLocked(name);
if (isEnabled && !shouldBeEnabled) {
updateProviderListenersLocked(name, false, mCurrentUserId);
+ // If any provider has been disabled, clear all last locations for all providers.
+ // This is to be on the safe side in case a provider has location derived from
+ // this disabled provider.
+ mLastLocation.clear();
+ mLastLocationCoarseInterval.clear();
changesMade = true;
} else if (!isEnabled && shouldBeEnabled) {
updateProviderListenersLocked(name, true, mCurrentUserId);