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

Commit 68b1e590 authored by Jack Yu's avatar Jack Yu
Browse files

Reverted data roaming leakage fix that causes side effect

Reverted ag/753579 that causes tethering not working in some
corner cases.

Test: Telphony anity tests
bug: 33847610
Merged-In: I061a706c3ed6b3255e39a33d0efa0d2f32af3120
Change-Id: I061a706c3ed6b3255e39a33d0efa0d2f32af3120
parent fe4a960e
Loading
Loading
Loading
Loading
+19 −32
Original line number Diff line number Diff line
@@ -1545,34 +1545,23 @@ public class DataConnection extends StateMachine {

            // verify and get updated information in case these things
            // are obsolete
            {
            ServiceState ss = mPhone.getServiceState();
            final int networkType = ss.getDataNetworkType();
            if (mNetworkInfo.getSubtype() != networkType) {
                    log("DcActiveState with incorrect subtype (" + mNetworkInfo.getSubtype() +
                            ", " + networkType + "), updating.");
                log("DcActiveState with incorrect subtype (" + mNetworkInfo.getSubtype()
                        + ", " + networkType + "), updating.");
            }
            mNetworkInfo.setSubtype(networkType, TelephonyManager.getNetworkTypeName(networkType));
            final boolean roaming = ss.getDataRoaming();
            if (roaming != mNetworkInfo.isRoaming()) {
                    log("DcActiveState with incorrect roaming (" + mNetworkInfo.isRoaming() +
                            ", " + roaming +"), updating.");
                log("DcActiveState with incorrect roaming (" + mNetworkInfo.isRoaming()
                        + ", " + roaming + "), updating.");
            }

            mNetworkInfo.setRoaming(roaming);
            }

            boolean createNetworkAgent = true;
            // If a disconnect is already pending, avoid notifying all of connected
            if (hasMessages(EVENT_DISCONNECT) ||
                    hasMessages(EVENT_DISCONNECT_ALL) ||
                    hasDeferredMessages(EVENT_DISCONNECT) ||
                    hasDeferredMessages(EVENT_DISCONNECT_ALL)) {
                log("DcActiveState: skipping notifyAllOfConnected()");
                createNetworkAgent = false;
            } else {
            // If we were retrying there maybe more than one, otherwise they'll only be one.
            notifyAllOfConnected(Phone.REASON_CONNECTED);
            }

            mPhone.getCallTracker().registerForVoiceCallStarted(getHandler(),
                    DataConnection.EVENT_DATA_CONNECTION_VOICE_CALL_STARTED, null);
@@ -1597,13 +1586,11 @@ public class DataConnection extends StateMachine {
            }
            misc.subscriberId = mPhone.getSubscriberId();

            if (createNetworkAgent) {
            setNetworkRestriction();
            mNetworkAgent = new DcNetworkAgent(getHandler().getLooper(), mPhone.getContext(),
                    "DcNetworkAgent", mNetworkInfo, makeNetworkCapabilities(), mLinkProperties,
                    50, misc);
        }
        }

        @Override
        public void exit() {