diff options
author | Mike Lockwood <lockwood@android.com> | 2009-06-22 16:20:39 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-06-22 16:20:39 -0400 |
commit | b362a9ab91bb4c05ef1d5c4e7019499257c7f849 (patch) | |
tree | 0ec842520209c12ce2e391881f65e514ea834851 /location | |
parent | ecfb9f91afa49df7b9b62526dcaca431b5ff1e01 (diff) | |
download | frameworks_base-b362a9ab91bb4c05ef1d5c4e7019499257c7f849.zip frameworks_base-b362a9ab91bb4c05ef1d5c4e7019499257c7f849.tar.gz frameworks_base-b362a9ab91bb4c05ef1d5c4e7019499257c7f849.tar.bz2 |
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 <lockwood@android.com>
Diffstat (limited to 'location')
-rwxr-xr-x | location/java/com/android/internal/location/GpsLocationProvider.java | 9 |
1 files changed, 7 insertions, 2 deletions
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 { |