diff options
-rw-r--r-- | services/core/java/com/android/server/location/GpsLocationProvider.java | 4 |
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) { |