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

Commit e29c57ec authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6348860 from e2693cf6 to rvc-release

Change-Id: I602aec78b1653fd15c44bb76328afb25c767d446
parents 94ddc3f6 e2693cf6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -297,7 +297,6 @@ public final class MccTable {
                        mccmnc.substring(0, 3), mccmnc.substring(3))) {
                    Rlog.d(LOG_TAG, "updateMccMncConfiguration: update mccmnc="
                            + mccmnc + " failure");
                    return;
                } else {
                    Rlog.d(LOG_TAG, "updateMccMncConfiguration: update mccmnc="
                            + mccmnc + " success");
+30 −18
Original line number Diff line number Diff line
@@ -122,7 +122,6 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
@@ -859,27 +858,39 @@ public class ServiceStateTracker extends Handler {
    }

    /**
     * Notify all mDataConnectionRatChangeRegistrants using an
     * AsyncResult in msg.obj where AsyncResult#result contains the
     * new RAT as an Integer Object.
     * Get registration info
     *
     * @param transport The transport type
     * @return Pair of registration info including {@link ServiceState.RegState} and
     * {@link RilRadioTechnology}.
     *
     */
    protected void notifyDataRegStateRilRadioTechnologyChanged(int transport) {
    @Nullable
    private Pair<Integer, Integer> getRegistrationInfo(@TransportType int transport) {
        NetworkRegistrationInfo nrs = mSS.getNetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, transport);
        if (nrs != null) {
            int rat = ServiceState.networkTypeToRilRadioTechnology(
                    nrs.getAccessNetworkTechnology());
            int drs = regCodeToServiceState(nrs.getRegistrationState());
            if (DBG) {
                log("notifyDataRegStateRilRadioTechnologyChanged: drs=" + drs + " rat=" + rat);
            return new Pair<>(drs, rat);
        }
        return null;
    }

    /**
     * Notify all mDataConnectionRatChangeRegistrants using an
     * AsyncResult in msg.obj where AsyncResult#result contains the
     * new RAT as an Integer Object.
     */
    protected void notifyDataRegStateRilRadioTechnologyChanged(@TransportType int transport) {
        RegistrantList registrantList = mDataRegStateOrRatChangedRegistrants.get(transport);
        if (registrantList != null) {
                registrantList.notifyResult(new Pair<>(drs, rat));
            Pair<Integer, Integer> registrationInfo = getRegistrationInfo(transport);
            if (registrationInfo != null) {
                registrantList.notifyResult(registrationInfo);
            }
        }
        setDataNetworkTypeForPhone(mSS.getRilDataRadioTechnology());
    }

    /**
@@ -3227,11 +3238,8 @@ public class ServiceStateTracker extends Handler {
                mNewSS.getNetworkRegistrationInfo(
                        NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkType.EUTRAN));

        // TODO: loosen this restriction to exempt fields that are provided through system
        // information; otherwise, we will get false positives when things like the operator
        // alphas are provided later - that's better than missing location changes, but
        // still not ideal.
        boolean hasLocationChanged = !Objects.equals(mNewCellIdentity, mCellIdentity);
        boolean hasLocationChanged = (mCellIdentity == null ? mNewCellIdentity != null
                : !mCellIdentity.isSameCell(mNewCellIdentity));

        // ratchet the new tech up through its rat family but don't drop back down
        // until cell change or device is OOS
@@ -3491,6 +3499,7 @@ public class ServiceStateTracker extends Handler {
                    // Update all transports if preference changed so that consumers can be notified
                    // that ServiceState#getRilDataRadioTechnology has changed.
                    || hasDataTransportPreferenceChanged) {
                setDataNetworkTypeForPhone(mSS.getRilDataRadioTechnology());
                notifyDataRegStateRilRadioTechnologyChanged(transport);
                mPhone.notifyAllActiveDataConnections();
            }
@@ -4486,7 +4495,10 @@ public class ServiceStateTracker extends Handler {
            mDataRegStateOrRatChangedRegistrants.put(transport, new RegistrantList());
        }
        mDataRegStateOrRatChangedRegistrants.get(transport).add(r);
        notifyDataRegStateRilRadioTechnologyChanged(transport);
        Pair<Integer, Integer> registrationInfo = getRegistrationInfo(transport);
        if (registrationInfo != null) {
            r.notifyResult(registrationInfo);
        }
    }

    /**
+7 −8
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ import com.android.internal.telephony.LinkCapacityEstimate;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.RIL;
import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.RetryManager;
import com.android.internal.telephony.ServiceStateTracker;
@@ -611,10 +612,8 @@ public class DataConnection extends StateMachine {
        if (nri != null) {
            networkType = nri.getAccessNetworkTechnology();
            mRilRat = ServiceState.networkTypeToRilRadioTechnology(networkType);
            if (isBandwidthSourceKey(DctConstants.BANDWIDTH_SOURCE_CARRIER_CONFIG_KEY)) {
            updateLinkBandwidthsFromCarrierConfig(mRilRat);
        }
        }

        mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_MOBILE,
                networkType, NETWORK_TYPE, TelephonyManager.getNetworkTypeName(networkType));
@@ -1134,9 +1133,12 @@ public class DataConnection extends StateMachine {


    private void updateLinkBandwidthsFromModem(LinkCapacityEstimate lce) {
        if (DBG) log("updateLinkBandwidthsFromModem: lce=" + lce);
        boolean downlinkUpdated = false;
        boolean uplinkUpdated = false;
        if (mPhone.getLceStatus() == RILConstants.LCE_ACTIVE) {
        // LCE status deprecated in IRadio 1.2, so only check for IRadio < 1.2
        if (mPhone.getHalVersion().greaterOrEqual(RIL.RADIO_HAL_VERSION_1_2)
                || mPhone.getLceStatus() == RILConstants.LCE_ACTIVE) {
            if (lce.downlinkCapacityKbps != LinkCapacityEstimate.INVALID) {
                mDownlinkBandwidth = lce.downlinkCapacityKbps;
                downlinkUpdated = true;
@@ -1146,7 +1148,6 @@ public class DataConnection extends StateMachine {
                uplinkUpdated = true;
            }
        }
        if (DBG) log("updateLinkBandwidthsFromModem");
        if (!downlinkUpdated || !uplinkUpdated) {
            String ratName = ServiceState.rilRadioTechnologyToString(mRilRat);
            if (mRilRat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE && isNRConnected()) {
@@ -2074,9 +2075,7 @@ public class DataConnection extends StateMachine {
            mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED,
                    mNetworkInfo.getReason(), null);
            updateTcpBufferSizes(mRilRat);
            if (isBandwidthSourceKey(DctConstants.BANDWIDTH_SOURCE_CARRIER_CONFIG_KEY)) {
            updateLinkBandwidthsFromCarrierConfig(mRilRat);
            }

            final NetworkAgentConfig.Builder configBuilder = new NetworkAgentConfig.Builder();
            configBuilder.setLegacyType(ConnectivityManager.TYPE_MOBILE);
+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;
+18 −26
Original line number Diff line number Diff line
@@ -4340,8 +4340,7 @@ public class DcTracker extends Handler {
        }
    }

    private boolean containsAllApns(ArrayList<ApnSetting> oldApnList,
                                    ArrayList<ApnSetting> newApnList) {
    private boolean containsAllApns(List<ApnSetting> oldApnList, List<ApnSetting> newApnList) {
        for (ApnSetting newApnSetting : newApnList) {
            boolean canHandle = false;
            for (ApnSetting oldApnSetting : oldApnList) {
@@ -4369,39 +4368,32 @@ public class DcTracker extends Handler {
                return;
            }
            for (ApnContext apnContext : mApnContexts.values()) {
                boolean cleanupRequired = false;
                boolean cleanupRequired = true;
                if (!apnContext.isDisconnected()) {
                    ArrayList<ApnSetting> currentWaitingApns = apnContext.getWaitingApns();
                    ArrayList<ApnSetting> waitingApns = buildWaitingApns(
                            apnContext.getApnType(), getDataRat());
                    if (VDBG) log("new waitingApns:" + waitingApns);
                    if ((currentWaitingApns != null)
                            && ((waitingApns.size() != currentWaitingApns.size())
                            // Check if the existing waiting APN list can cover the newly built APN
                            // list. If yes, then we don't need to tear down the existing data call.
                            // TODO: We probably need to rebuild APN list when roaming status
                            //  changes.
                            || !containsAllApns(currentWaitingApns, waitingApns))) {
                        if (VDBG) log("new waiting apn is different for " + apnContext);
                    apnContext.setWaitingApns(waitingApns);
                        ApnSetting apnSetting = apnContext.getApnSetting();
                        if (apnContext.getApnType().equals(PhoneConstants.APN_TYPE_DEFAULT)) {
                            if ((getPreferredApn() == null)
                                    || !apnSetting.equals(getPreferredApn())) {
                                cleanupRequired = true;
                    for (ApnSetting apnSetting : waitingApns) {
                        if (apnSetting.equals(apnContext.getApnSetting(),
                                mPhone.getServiceState().getDataRoamingFromRegistration())) {
                            cleanupRequired = false;
                            break;
                        }
                        } else if (!waitingApns.contains(apnSetting)) {
                            cleanupRequired = true;
                    }

                    if (cleanupRequired) {
                            if (VDBG) log("cleanUpConnectionsOnUpdatedApns for " + apnContext);
                        if (DBG) {
                            log("cleanUpConnectionsOnUpdatedApns: APN type "
                                    + apnContext.getApnType() + " clean up is required. The new "
                                    + "waiting APN list " + waitingApns + " does not cover "
                                    + apnContext.getApnSetting());
                        }
                        apnContext.setReason(reason);
                        cleanUpConnectionInternal(true, RELEASE_TYPE_DETACH, apnContext);
                    }
                }
            }
        }
        }

        if (!isConnected()) {
            stopNetStatPoll();
Loading