am 776b3956: am 7f4d8293: am 6826387e: DO NOT MERGE: Clear cached locations when location providers disabled Bug: 12118307

* commit '776b3956a9742b868b037dffd2b24c17b2dfa0e6':
  DO NOT MERGE: Clear cached locations when location providers disabled Bug: 12118307
This commit is contained in:
David Christie
2014-01-10 13:02:48 -08:00
committed by Android Git Automerger

View File

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