am 8e0c7768: DO NOT MERGE: Clear cached locations when location providers disabled Bug: 12118307

* commit '8e0c7768c87014fef277df84c737dd6c37fb8866':
  DO NOT MERGE: Clear cached locations when location providers disabled Bug: 12118307
This commit is contained in:
David Christie
2014-01-10 12:53:41 -08:00
committed by Android Git Automerger

View File

@@ -982,6 +982,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
boolean shouldBeEnabled = isAllowedBySettingsLocked(name);
if (isEnabled && !shouldBeEnabled) {
updateProviderListenersLocked(name, false);
// 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.
mLastKnownLocation.clear();
changesMade = true;
} else if (!isEnabled && shouldBeEnabled) {
updateProviderListenersLocked(name, true);