GPS: Fix problem with SUPL when SUPL APN is already active.

Use ConnectivityManager.CONNECTIVITY_ACTION broadcast in LocationManagerService
to notify GPS when SUPL connection is ready instead of TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED,
which is not sent in all cases.
Expand LocationProvider.updateNetworkState() to include NetworkInfo object.

Fixes bug b/2155661

Change-Id: Iee227ace7d536b36cf7973e3e6a8b7a621ce6565
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2009-10-08 15:45:03 -04:00
parent 9d5b58991e
commit 03d246779e
7 changed files with 38 additions and 28 deletions

View File

@@ -48,6 +48,7 @@ import android.location.Location;
import android.location.LocationManager;
import android.location.LocationProvider;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
@@ -529,7 +530,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
}
// notify provider of current network state
proxy.updateNetworkState(mNetworkState);
proxy.updateNetworkState(mNetworkState, null);
}
}
@@ -1600,13 +1601,15 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
} else {
mNetworkState = LocationProvider.TEMPORARILY_UNAVAILABLE;
}
NetworkInfo info =
(NetworkInfo)intent.getExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
// Notify location providers of current network state
synchronized (mLock) {
for (int i = mProviders.size() - 1; i >= 0; i--) {
LocationProviderProxy provider = mProviders.get(i);
if (provider.requiresNetwork()) {
provider.updateNetworkState(mNetworkState);
provider.updateNetworkState(mNetworkState, info);
}
}
}