Bug:
18814559
Change-Id: I0333050d2a5b8d484466e1b1914dcfb9965398c9
}
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) {
/** @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;