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

Commit 80f67ef9 authored by Amit Mahajan's avatar Amit Mahajan Committed by Android (Google) Code Review
Browse files

Merge "Using default setting if setting+subid is not found." into lmp-mr1-dev

parents 373f9fa9 c9e4b3e8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -439,8 +439,8 @@ public class PhoneFactory {
        Rlog.d(LOG_TAG, "setDataSubscription: " + subId);

        // Update the current mobile data flag
        enabled = Settings.Global.getInt(sContext.getContentResolver(),
                Settings.Global.MOBILE_DATA + subId, 0) != 0;
        enabled = TelephonyManager.getIntWithSubId(sContext.getContentResolver(),
                Settings.Global.MOBILE_DATA, subId, 0) != 0;
        Settings.Global.putInt(sContext.getContentResolver(),
                Settings.Global.MOBILE_DATA + subId, enabled ? 1 : 0);
        Rlog.d(LOG_TAG, "set mobile_data: " + enabled);
+2 −2
Original line number Diff line number Diff line
@@ -2710,8 +2710,8 @@ public final class DcTracker extends DcTrackerBase {
        registerForAllEvents();
        onUpdateIcc();

        mUserDataEnabled = Settings.Global.getInt(mPhone.getContext().getContentResolver(),
                Settings.Global.MOBILE_DATA, 1) == 1;
        mUserDataEnabled = TelephonyManager.getIntWithSubId(mPhone.getContext().getContentResolver(),
                Settings.Global.MOBILE_DATA, mPhone.getSubId(), 1) == 1;

        if (mPhone instanceof CDMALTEPhone) {
            ((CDMALTEPhone)mPhone).updateCurrentCarrierInProvider();
+7 −5
Original line number Diff line number Diff line
@@ -572,8 +572,8 @@ public abstract class DcTrackerBase extends Handler {
        filter.addAction(INTENT_DATA_STALL_ALARM);
        filter.addAction(INTENT_PROVISIONING_APN_ALARM);

        mUserDataEnabled = Settings.Global.getInt(
                mPhone.getContext().getContentResolver(), Settings.Global.MOBILE_DATA + phoneSubId,
        mUserDataEnabled = TelephonyManager.getIntWithSubId(
                mPhone.getContext().getContentResolver(), Settings.Global.MOBILE_DATA, phoneSubId,
                1) == 1;

        mPhone.getContext().registerReceiver(mIntentReceiver, filter, null, mPhone);
@@ -774,12 +774,14 @@ public abstract class DcTrackerBase extends Handler {
     * Return current {@link android.provider.Settings.Global#MOBILE_DATA} value.
     */
    public boolean getDataEnabled() {
        try {
        final ContentResolver resolver = mPhone.getContext().getContentResolver();
        try {
            int phoneSubId = mPhone.getSubId();
            return Settings.Global.getInt(resolver, Settings.Global.MOBILE_DATA + phoneSubId) != 0;
            return TelephonyManager.getIntWithSubId(resolver, Settings.Global.MOBILE_DATA,
                    phoneSubId) != 0;
        } catch (SettingNotFoundException snfe) {
            return false;
            return "true".equalsIgnoreCase(
                    SystemProperties.get("ro.com.android.mobiledata", "true"));
        }
    }