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

Commit e12e6a29 authored by Ying Xu's avatar Ying Xu Committed by Cassie
Browse files

Revert "Set the APN when DcNetworkAgent is created"

This reverts commit 43e8cd09.

Reason for revert: May be the cause of b/149459996

Bug: 148674994
Test: Telephony Unit Tests
Change-Id: I6694a1a918bc7720485c9c0e7e8f691052bb426d
parent 03576022
Loading
Loading
Loading
Loading
+8 −16
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.net.Uri;
import android.os.Message;
import android.telephony.AccessNetworkConstants;
import android.telephony.AccessNetworkConstants.TransportType;
import android.telephony.Annotation.NetworkType;
import android.telephony.AnomalyReporter;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.ServiceState;
@@ -96,9 +95,6 @@ public class DcNetworkAgent extends NetworkAgent {
        mTransportType = transportType;
        mDataConnection = dc;
        mNetworkInfo = new NetworkInfo(ni);
        setLegacyExtraInfo(dc.getApnSetting().getApnName());
        int subType = getNetworkType();
        setLegacySubtype(subType, TelephonyManager.getNetworkTypeName(subType));
        // TODO: Remove after b/151487565 is fixed.
        sNetworkAgents.add(this);
        checkRedundantIms();
@@ -293,7 +289,14 @@ public class DcNetworkAgent extends NetworkAgent {
            setLegacyExtraInfo(extraInfo);
        }

        int subType = getNetworkType();
        final ServiceState serviceState = mPhone.getServiceState();
        NetworkRegistrationInfo nri = serviceState.getNetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, mTransportType);
        int subType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
        if (nri != null) {
            subType = nri.getAccessNetworkTechnology();
        }

        if (mNetworkInfo.getSubtype() != subType) {
            setLegacySubtype(subType, TelephonyManager.getNetworkTypeName(subType));
        }
@@ -386,17 +389,6 @@ public class DcNetworkAgent extends NetworkAgent {
        Rlog.e(mTag, s);
    }

    private @NetworkType int getNetworkType() {
        final ServiceState serviceState = mPhone.getServiceState();
        NetworkRegistrationInfo nri = serviceState.getNetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, mTransportType);
        int subType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
        if (nri != null) {
            subType = nri.getAccessNetworkTechnology();
        }
        return subType;
    }

    class DcKeepaliveTracker {
        private class KeepaliveRecord {
            public int slotId;