Loading location/java/android/location/LocationManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,13 @@ public class LocationManager { public static final String GPS_ENABLED_CHANGE_ACTION = "android.location.GPS_ENABLED_CHANGE"; /** * Broadcast intent action when the configured location providers * change. */ public static final String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED"; /** * Broadcast intent action indicating that the GPS has either started or * stopped receiving GPS fixes. An intent extra provides this state as a Loading services/java/com/android/server/LocationManagerService.java +6 −2 Original line number Diff line number Diff line Loading @@ -859,18 +859,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)); } } Loading Loading
location/java/android/location/LocationManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,13 @@ public class LocationManager { public static final String GPS_ENABLED_CHANGE_ACTION = "android.location.GPS_ENABLED_CHANGE"; /** * Broadcast intent action when the configured location providers * change. */ public static final String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED"; /** * Broadcast intent action indicating that the GPS has either started or * stopped receiving GPS fixes. An intent extra provides this state as a Loading
services/java/com/android/server/LocationManagerService.java +6 −2 Original line number Diff line number Diff line Loading @@ -859,18 +859,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)); } } Loading