GPS: Changes to enable on-demand data call flow for CDMA connections

In the CDMA case we do not get a valid APN on a data connection request
to the connectivity manager. A fix is put in so that even if we get a
null APN we populate this field before we call native_agps_data_conn_open()
method to avoid a run time exception.

Change-Id: I134ead5d8b177fced9b14756c6bd8199a2b9c35d
This commit is contained in:
Stephen Li
2011-01-25 18:47:28 -08:00
parent 94062517ae
commit 83b69713f2

View File

@ -496,7 +496,12 @@ public class GpsLocationProvider implements LocationProviderInterface {
if (info != null && info.getType() == ConnectivityManager.TYPE_MOBILE_SUPL
&& mAGpsDataConnectionState == AGPS_DATA_CONNECTION_OPENING) {
String apnName = info.getExtraInfo();
if (mNetworkAvailable && apnName != null && apnName.length() > 0) {
if (mNetworkAvailable) {
if (apnName == null) {
/* Assign a dummy value in the case of C2K as otherwise we will have a runtime
exception in the following call to native_agps_data_conn_open*/
apnName = "dummy-apn";
}
mAGpsApn = apnName;
if (DEBUG) Log.d(TAG, "call native_agps_data_conn_open");
native_agps_data_conn_open(apnName);