am 21a801d0: am 0d30e07d: am 3d5ea26f: am 4503409a: Merge "Clear cached locations when location providers disabled Bug: 12118307" into klp-dev

* commit '21a801d0885d65f128b84a593140b07fd0d4e980':
  Clear cached locations when location providers disabled Bug: 12118307
This commit is contained in:
Daniel Cashman
2014-01-13 19:00:37 +00:00
committed by Android Git Automerger

View File

@@ -1148,6 +1148,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);