Send broadcast intent when configured location providers change.
See e.g. http://code.google.com/p/android/issues/detail?id=10042 This is also needed by the power control widget, which has no reliable way otherwise of staying in-sync. Change-Id: I8f2b6b79b1843329bae952a25ea56f15e3cf92aa
This commit is contained in:
@@ -858,18 +858,22 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
||||
}
|
||||
|
||||
private void updateProvidersLocked() {
|
||||
boolean changesMade = false;
|
||||
for (int i = mProviders.size() - 1; i >= 0; i--) {
|
||||
LocationProviderInterface p = mProviders.get(i);
|
||||
boolean isEnabled = p.isEnabled();
|
||||
String name = p.getName();
|
||||
boolean shouldBeEnabled = isAllowedBySettingsLocked(name);
|
||||
|
||||
if (isEnabled && !shouldBeEnabled) {
|
||||
updateProviderListenersLocked(name, false);
|
||||
changesMade = true;
|
||||
} else if (!isEnabled && shouldBeEnabled) {
|
||||
updateProviderListenersLocked(name, true);
|
||||
changesMade = true;
|
||||
}
|
||||
|
||||
}
|
||||
if (changesMade) {
|
||||
mContext.sendBroadcast(new Intent(LocationManager.PROVIDERS_CHANGED_ACTION));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user