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

Commit 22445ab6 authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge "Fixed MMS data connection not re-established after airplane mode"

am: 1db513da

Change-Id: I73f96fc959d01fee36c2364a4a5f3ca4d99c75c5
parents e98d2880 1db513da
Loading
Loading
Loading
Loading
+18 −4
Original line number Original line Diff line number Diff line
@@ -3315,6 +3315,10 @@ public class ServiceStateTracker extends Handler {
                mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE
                mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE
                        && mNewSS.getVoiceRegState() != ServiceState.STATE_IN_SERVICE;
                        && mNewSS.getVoiceRegState() != ServiceState.STATE_IN_SERVICE;


        boolean hasAirplaneModeOnChanged =
                mSS.getVoiceRegState() != ServiceState.STATE_POWER_OFF
                        && mNewSS.getVoiceRegState() == ServiceState.STATE_POWER_OFF;

        SparseBooleanArray hasDataAttached = new SparseBooleanArray(
        SparseBooleanArray hasDataAttached = new SparseBooleanArray(
                mTransportManager.getAvailableTransports().length);
                mTransportManager.getAvailableTransports().length);
        SparseBooleanArray hasDataDetached = new SparseBooleanArray(
        SparseBooleanArray hasDataDetached = new SparseBooleanArray(
@@ -3331,7 +3335,12 @@ public class ServiceStateTracker extends Handler {
            NetworkRegistrationInfo newNrs = mNewSS.getNetworkRegistrationInfo(
            NetworkRegistrationInfo newNrs = mNewSS.getNetworkRegistrationInfo(
                    NetworkRegistrationInfo.DOMAIN_PS, transport);
                    NetworkRegistrationInfo.DOMAIN_PS, transport);


            boolean changed = (oldNrs == null || !oldNrs.isInService())
            // If the previously it was not in service, and now it's in service, trigger the
            // attached event. Also if airplane mode was just turned on, and data is already in
            // service, we need to trigger the attached event again so that DcTracker can setup
            // data on all connectable APNs again (because we've already torn down all data
            // connections just before airplane mode turned on)
            boolean changed = (oldNrs == null || !oldNrs.isInService() || hasAirplaneModeOnChanged)
                    && (newNrs != null && newNrs.isInService());
                    && (newNrs != null && newNrs.isInService());
            hasDataAttached.put(transport, changed);
            hasDataAttached.put(transport, changed);


@@ -3448,7 +3457,8 @@ public class ServiceStateTracker extends Handler {
                    + " hasLostMultiApnSupport = " + hasLostMultiApnSupport
                    + " hasLostMultiApnSupport = " + hasLostMultiApnSupport
                    + " hasCssIndicatorChanged = " + hasCssIndicatorChanged
                    + " hasCssIndicatorChanged = " + hasCssIndicatorChanged
                    + " hasNrFrequencyRangeChanged = " + hasNrFrequencyRangeChanged
                    + " hasNrFrequencyRangeChanged = " + hasNrFrequencyRangeChanged
                    + " hasNrStateChanged = " + hasNrStateChanged);
                    + " hasNrStateChanged = " + hasNrStateChanged
                    + " hasAirplaneModeOnlChanged = " + hasAirplaneModeOnChanged);
        }
        }


        // Add an event log when connection state changes
        // Add an event log when connection state changes
@@ -3620,13 +3630,17 @@ public class ServiceStateTracker extends Handler {


            if (hasDataAttached.get(transport)) {
            if (hasDataAttached.get(transport)) {
                shouldLogAttachedChange = true;
                shouldLogAttachedChange = true;
                if (mAttachedRegistrants.get(transport) != null) {
                    mAttachedRegistrants.get(transport).notifyRegistrants();
                    mAttachedRegistrants.get(transport).notifyRegistrants();
                }
                }
            }
            if (hasDataDetached.get(transport)) {
            if (hasDataDetached.get(transport)) {
                shouldLogAttachedChange = true;
                shouldLogAttachedChange = true;
                if (mDetachedRegistrants.get(transport) != null) {
                    mDetachedRegistrants.get(transport).notifyRegistrants();
                    mDetachedRegistrants.get(transport).notifyRegistrants();
                }
                }
            }
            }
        }


        if (shouldLogAttachedChange) {
        if (shouldLogAttachedChange) {
            logAttachChange();
            logAttachChange();