GpsLocationProvider: Read data enabled status from TelephonyManager.

automerge: 64ce5f8

* commit '64ce5f8fab077e4792737f86502d0e77ad6cbb0b':
  GpsLocationProvider: Read data enabled status from TelephonyManager.
This commit is contained in:
Shishir Agrawal
2015-02-11 03:35:42 +00:00
committed by android-build-merger
2 changed files with 3 additions and 5 deletions

View File

@ -788,9 +788,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
}
if (info != null) {
boolean dataEnabled = TelephonyManager.getIntWithSubId(mContext.getContentResolver(),
Settings.Global.MOBILE_DATA, SubscriptionManager.getDefaultSubId(),
1) == 1;
boolean dataEnabled = TelephonyManager.getDefault().getDataEnabled();
boolean networkAvailable = info.isAvailable() && dataEnabled;
String defaultApn = getSelectedApn();
if (defaultApn == null) {

View File

@ -3669,12 +3669,12 @@ public class TelephonyManager {
/** @hide */
@SystemApi
public boolean getDataEnabled(int subId) {
boolean retVal;
boolean retVal = false;
try {
retVal = getITelephony().getDataEnabled(subId);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#getDataEnabled", e);
retVal = false;
} catch (NullPointerException e) {
}
Log.d(TAG, "getDataEnabled: retVal=" + retVal);
return retVal;