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

Unverified Commit 32555010 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Michael Bestas
Browse files

DCT: Tear down MMS+default connections raised by config_enable_mms_with_mobile_data_off

If the tracker lets an MMS connection go through even if data is off, make sure
it's torn down once the disabled state gets applied. More often than not, APNs
configured as MMS+data would remain alive, and the tracker's state machine would
get stuck out of sync

Ref: CYNGNOS-3239

Change-Id: Ia13e9ff5beea44ecfda40a4910990dab53af25dd
parent 3bd93c12
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2561,6 +2561,13 @@ public class DcTracker extends Handler {
                }
            } else if (met) {
                apnContext.setReason(Phone.REASON_DATA_DISABLED);
                CarrierConfigManager configManager = (CarrierConfigManager)mPhone.getContext().
                        getSystemService(Context.CARRIER_CONFIG_SERVICE);
                PersistableBundle pb = configManager.getConfigForSubId(mPhone.getSubId());
                boolean mmsWithMobileDataOff = false;
                if (pb != null) {
                    mmsWithMobileDataOff = pb.getBoolean("config_enable_mms_with_mobile_data_off");
                }
                // If ConnectivityService has disabled this network, stop trying to bring
                // it up, but do not tear it down - ConnectivityService will do that
                // directly by talking with the DataConnection.
@@ -2571,7 +2578,9 @@ public class DcTracker extends Handler {
                // can declare the DUN APN sharable by default traffic, thus still satisfying
                // those requests and not torn down organically.
                if ((apnContext.getApnType() == PhoneConstants.APN_TYPE_DUN && teardownForDun())
                        || apnContext.getState() != DctConstants.State.CONNECTED) {
                        || apnContext.getState() != DctConstants.State.CONNECTED
                        || (mmsWithMobileDataOff &&
                                   apnContext.getApnType().equals(PhoneConstants.APN_TYPE_MMS))) {
                    cleanup = true;
                } else {
                    cleanup = false;