From 83b69713f2dbeee7ff5e07836673a9a477be236f Mon Sep 17 00:00:00 2001 From: Stephen Li Date: Tue, 25 Jan 2011 18:47:28 -0800 Subject: [PATCH] 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 --- .../com/android/server/location/GpsLocationProvider.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/location/GpsLocationProvider.java b/services/java/com/android/server/location/GpsLocationProvider.java index b1ab05b917e43..834119abd4bd3 100755 --- a/services/java/com/android/server/location/GpsLocationProvider.java +++ b/services/java/com/android/server/location/GpsLocationProvider.java @@ -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);