From 2aa0523f79d1e9de4bc85efb6026a72af5506f0e Mon Sep 17 00:00:00 2001 From: Sharvil Nanavati Date: Thu, 20 Aug 2015 09:30:47 -0700 Subject: [PATCH] DO NOT MERGE Work around for not getting APN info in NetworkInfo object. This change is a workaround to an issue where the APN name is missing in the CONNECTIVITY_ACTION intent. Submitting this patch so we can unblock AVL testing. Bug: 22908453 Change-Id: I67f67872b8636e63404bd6c2cf7835feb586f254 --- .../java/com/android/server/location/GpsLocationProvider.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/location/GpsLocationProvider.java b/services/core/java/com/android/server/location/GpsLocationProvider.java index ba5f516b13563..02f2c73c951cf 100644 --- a/services/core/java/com/android/server/location/GpsLocationProvider.java +++ b/services/core/java/com/android/server/location/GpsLocationProvider.java @@ -766,6 +766,10 @@ public class GpsLocationProvider implements LocationProviderInterface { && mAGpsDataConnectionState == AGPS_DATA_CONNECTION_OPENING) { if (mNetworkAvailable) { String apnName = info.getExtraInfo(); + // APN wasn't found in the intent, try to get it from the content provider. + if (apnName == null) { + apnName = getSelectedApn(); + } 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*/