Merge "Revert "GpsLocationProvider: Read data enabled status from TelephonyManager." as it reintroduces b/18922524" into lmp-mr1-dev automerge: cce8db2
automerge: b32831e
* commit 'b32831eebfd3c3ba2b26da18fef6818c12643f9d':
Revert "GpsLocationProvider: Read data enabled status from TelephonyManager." as it reintroduces b/18922524
diff --git a/services/core/java/com/android/server/location/GpsLocationProvider.java b/services/core/java/com/android/server/location/GpsLocationProvider.java
index 2231ef0..b46a450 100644
--- a/services/core/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/core/java/com/android/server/location/GpsLocationProvider.java
@@ -788,8 +788,9 @@
}
if (info != null) {
- boolean dataEnabled = TelephonyManager.getDefault() != null ?
- TelephonyManager.getDefault().getDataEnabled() : true;
+ 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) {