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

Commit acdf176b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reverted data roaming leakage fix that causes side effect"

parents e42cfa68 da22a565
Loading
Loading
Loading
Loading
+19 −32
Original line number Diff line number Diff line
@@ -1541,34 +1541,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);
@@ -1593,13 +1582,11 @@ public class DataConnection extends StateMachine {
            }
            misc.subscriberId = mPhone.getSubscriberId();

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

        @Override
        public void exit() {