Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64ce5f8f authored by Shishir Agrawal's avatar Shishir Agrawal
Browse files

GpsLocationProvider: Read data enabled status from TelephonyManager.

Bug: 18814559
Change-Id: I0333050d2a5b8d484466e1b1914dcfb9965398c9
parent 3bb5fdc7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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) {
+2 −2
Original line number Diff line number Diff line
@@ -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;