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

Commit 756bf43e authored by Suresh Koleti's avatar Suresh Koleti Committed by Linux Build Service Account
Browse files

Add support for sending and receiving mms when mobile data is off. Fix crash...

Add support for sending and receiving mms when mobile data is off. Fix crash during data setup error with null fail cause value.

1. Can not set up mms apn while mobile data is turned off, so it will fail
to connect when use mms connectivity in app.
Even if mobile data is turned off, we also allow set up mms data when
use mms connectivity.
2. Assign DcFailCause.UNKNOWN to fail cause if a null value is received
from DataConnection.

CRs-Fixed: 532101, 600935
Change-Id: I32eac49bec9687052ddbb5ad89da5efc478326df
parent 303f8a4f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1184,6 +1184,12 @@ public final class DcTracker extends DcTrackerBase {
        boolean checkUserDataEnabled =
                    !(apnContext.getApnType().equals(PhoneConstants.APN_TYPE_IMS));

        // If set the special property, enable mms data even if mobile data is turned off.
        if (apnContext.getApnType().equals(PhoneConstants.APN_TYPE_MMS)) {
            checkUserDataEnabled = checkUserDataEnabled && !(mPhone.getContext().getResources().
                    getBoolean(com.android.internal.R.bool.config_enable_mms_with_mobile_data_off));
        }

        if (apnContext.isConnectable() && (isEmergencyApn ||
                (isDataAllowed(apnContext) &&
                getAnyDataEnabled(checkUserDataEnabled) && !isEmergency()))) {
@@ -2357,6 +2363,11 @@ public final class DcTracker extends DcTrackerBase {
                log(String.format("onDataSetupComplete: error apn=%s cause=%s",
                        (apn == null ? "unknown" : apn.apn), cause));
            }

            if (cause == null) {
                cause = DcFailCause.UNKNOWN;
            }

            if (cause.isEventLoggable()) {
                // Log this failure to the Event Logs.
                int cid = getCellLocationId();