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

Commit 2b0f0da4 authored by Stuart Scott's avatar Stuart Scott
Browse files

Do not allow data if defaults are not selected.

bug:15925985
bug:18269924
Change-Id: I2eca123a358eeadf9d22cfe6cc55627a9387546a
parent 8b31b6fe
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -703,7 +703,11 @@ public final class DcTracker extends DcTrackerBase {
        boolean attachedState = mAttached.get();
        boolean desiredPowerState = mPhone.getServiceStateTracker().getDesiredPowerState();
        IccRecords r = mIccRecords.get();
        boolean recordsLoaded = (r != null) ? r.getRecordsLoaded() : false;
        boolean recordsLoaded = false;
        if (r != null) {
            recordsLoaded = r.getRecordsLoaded();
            if (DBG) log("isDataAllowed getRecordsLoaded=" + recordsLoaded);
        }

        //FIXME always attach
        boolean psRestricted = mIsPsRestricted;
@@ -712,6 +716,8 @@ public final class DcTracker extends DcTrackerBase {
            attachedState = true;
            psRestricted = false;
        }
        int dataSub = SubscriptionManager.getDefaultDataSubId();
        boolean defaultDataSelected = SubscriptionManager.isValidSubId(dataSub);

        boolean allowed =
                    (attachedState || mAutoAttachOnCreation) &&
@@ -719,6 +725,7 @@ public final class DcTracker extends DcTrackerBase {
                    (mPhone.getState() == PhoneConstants.State.IDLE ||
                     mPhone.getServiceStateTracker().isConcurrentVoiceAndDataAllowed()) &&
                    internalDataEnabled &&
                    defaultDataSelected &&
                    (!mPhone.getServiceState().getDataRoaming() || getDataOnRoamingEnabled()) &&
                    //!mIsPsRestricted &&
                    !psRestricted &&
@@ -735,6 +742,7 @@ public final class DcTracker extends DcTrackerBase {
                reason += " - Concurrent voice and data not allowed";
            }
            if (!internalDataEnabled) reason += " - mInternalDataEnabled= false";
            if (!defaultDataSelected) reason += " - defaultDataSelected= false";
            if (mPhone.getServiceState().getDataRoaming() && !getDataOnRoamingEnabled()) {
                reason += " - Roaming and data roaming not enabled";
            }