From b362a9ab91bb4c05ef1d5c4e7019499257c7f849 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Mon, 22 Jun 2009 16:20:39 -0400 Subject: gps: Check for null APN name to avoid a runtime restart. We still need to figure out how the APN name is getting set to empty string by the telephony code. Signed-off-by: Mike Lockwood --- .../java/com/android/internal/location/GpsLocationProvider.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'location') diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java index e4ff0e3..5c8fcf2 100755 --- a/location/java/com/android/internal/location/GpsLocationProvider.java +++ b/location/java/com/android/internal/location/GpsLocationProvider.java @@ -949,8 +949,13 @@ public class GpsLocationProvider extends ILocationProvider.Stub { int result = mConnMgr.startUsingNetworkFeature( ConnectivityManager.TYPE_MOBILE, Phone.FEATURE_ENABLE_SUPL); if (result == Phone.APN_ALREADY_ACTIVE) { - native_agps_data_conn_open(mAGpsApn); - mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPEN; + if (mAGpsApn != null) { + native_agps_data_conn_open(mAGpsApn); + mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPEN; + } else { + Log.e(TAG, "mAGpsApn not set when receiving Phone.APN_ALREADY_ACTIVE"); + native_agps_data_conn_failed(); + } } else if (result == Phone.APN_REQUEST_STARTED) { mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPENING; } else { -- cgit v1.1