Revert "GpsLocationProvider: Read data enabled status from TelephonyManager."

This reverts commit fabbdf7204.

Causes NPE on devices without telephony (Android Wear for example)
Bug:18922524

Change-Id: I3be4187a20da11fd5a302dd88e808a68cd7e5737
This commit is contained in:
Bryce Lee
2015-01-08 02:32:08 +00:00
parent fabbdf7204
commit 7c91446769

View File

@@ -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) {