summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryce Lee <brycelee@google.com>2015-01-08 02:32:08 +0000
committerBryce Lee <brycelee@google.com>2015-01-08 02:32:08 +0000
commit7c91446769fcfc4cb8bc93368bbfe5f88c624862 (patch)
tree5879fa6056fe0e149d20998e0eca3cf463fa543a
parentfabbdf7204474a9f789ce441219b3b9f3df66bb8 (diff)
downloadframeworks_base-7c91446769fcfc4cb8bc93368bbfe5f88c624862.zip
frameworks_base-7c91446769fcfc4cb8bc93368bbfe5f88c624862.tar.gz
frameworks_base-7c91446769fcfc4cb8bc93368bbfe5f88c624862.tar.bz2
Revert "GpsLocationProvider: Read data enabled status from TelephonyManager."
This reverts commit fabbdf7204474a9f789ce441219b3b9f3df66bb8. Causes NPE on devices without telephony (Android Wear for example) Bug:18922524 Change-Id: I3be4187a20da11fd5a302dd88e808a68cd7e5737
-rw-r--r--services/core/java/com/android/server/location/GpsLocationProvider.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/location/GpsLocationProvider.java b/services/core/java/com/android/server/location/GpsLocationProvider.java
index 806253a..9c0f987 100644
--- a/services/core/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/core/java/com/android/server/location/GpsLocationProvider.java
@@ -788,7 +788,9 @@ public class GpsLocationProvider implements LocationProviderInterface {
}
if (info != null) {
- boolean dataEnabled = TelephonyManager.getDefault().getDataEnabled();
+ boolean dataEnabled = TelephonyManager.getIntWithSubId(mContext.getContentResolver(),
+ Settings.Global.MOBILE_DATA, SubscriptionManager.getDefaultSubId(),
+ 1) == 1;
boolean networkAvailable = info.isAvailable() && dataEnabled;
String defaultApn = getSelectedApn();
if (defaultApn == null) {