am 3238d0d9: Merge "Clear cached locations when location providers disabled Bug: 12118307" into jb-mr2-dev
* commit '3238d0d9f98d4d0972e52a81a4e9b8d2aea0436d': Clear cached locations when location providers disabled Bug: 12118307
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user