GpsLocationProvider: Read data enabled status from TelephonyManager. automerge: 64ce5f8
automerge: 6b27472
* commit '6b274720c5a210c07256e5b9fc11a1e9aca59017':
GpsLocationProvider: Read data enabled status from TelephonyManager.
This commit is contained in:
@ -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) {
|
||||
|
@ -3665,12 +3665,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;
|
||||
|
Reference in New Issue
Block a user