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

Commit b9d1d942 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8591367 from f0e1c6de to tm-d1-release

Change-Id: Ic3eead9fc25980c0edb17abca1cb8788ff537e74
parents a9ef6782 f0e1c6de
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -455,6 +455,8 @@ public class RadioConfig extends Handler {
     */
    public void setPreferredDataModem(int modemId, Message result) {
        RadioConfigProxy proxy = getRadioConfigProxy(null);
        if (proxy.isEmpty()) return;

        if (!isSetPreferredDataCommandSupported()) {
            if (result != null) {
                AsyncResult.forMessage(result, null,
@@ -481,7 +483,9 @@ public class RadioConfig extends Handler {
     */
    public void getPhoneCapability(Message result) {
        RadioConfigProxy proxy = getRadioConfigProxy(null);
        if (proxy.isEmpty() || proxy.getVersion().less(RADIO_CONFIG_HAL_VERSION_1_1)) {
        if (proxy.isEmpty()) return;

        if (proxy.getVersion().less(RADIO_CONFIG_HAL_VERSION_1_1)) {
            if (result != null) {
                AsyncResult.forMessage(result, null,
                        CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
@@ -538,7 +542,9 @@ public class RadioConfig extends Handler {
     */
    public void setNumOfLiveModems(int numOfLiveModems, Message result) {
        RadioConfigProxy proxy = getRadioConfigProxy(result);
        if (proxy.isEmpty() || proxy.getVersion().less(RADIO_CONFIG_HAL_VERSION_1_1)) {
        if (proxy.isEmpty()) return;

        if (proxy.getVersion().less(RADIO_CONFIG_HAL_VERSION_1_1)) {
            if (result != null) {
                AsyncResult.forMessage(
                        result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
@@ -582,7 +588,9 @@ public class RadioConfig extends Handler {
     */
    public void getHalDeviceCapabilities(Message result) {
        RadioConfigProxy proxy = getRadioConfigProxy(Message.obtain(result));
        if (proxy.isEmpty() || proxy.getVersion().less(RADIO_CONFIG_HAL_VERSION_1_3)) {
        if (proxy.isEmpty()) return;

        if (proxy.getVersion().less(RADIO_CONFIG_HAL_VERSION_1_3)) {
            if (result != null) {
                if (DBG) {
                    logd("RIL_REQUEST_GET_HAL_DEVICE_CAPABILITIES > REQUEST_NOT_SUPPORTED");
+9 −9
Original line number Diff line number Diff line
@@ -898,7 +898,7 @@ public class ServiceStateTracker extends Handler {
        if (nrs != null) {
            int rat = ServiceState.networkTypeToRilRadioTechnology(
                    nrs.getAccessNetworkTechnology());
            int drs = regCodeToServiceState(nrs.getRegistrationState());
            int drs = regCodeToServiceState(nrs.getInitialRegistrationState());
            return new Pair<>(drs, rat);
        }
        return null;
@@ -2195,14 +2195,14 @@ public class ServiceStateTracker extends Handler {
        if (wlanPsRegState != null
                && wlanPsRegState.getAccessNetworkTechnology()
                == TelephonyManager.NETWORK_TYPE_IWLAN
                && wlanPsRegState.getRegistrationState()
                && wlanPsRegState.getInitialRegistrationState()
                == NetworkRegistrationInfo.REGISTRATION_STATE_HOME
                && isIwlanPreferred) {
            serviceState.setDataRegState(ServiceState.STATE_IN_SERVICE);
        } else if (wwanPsRegState != null) {
            // If the device is not camped on IWLAN, then we use cellular PS registration state
            // to compute reg state and rat.
            int regState = wwanPsRegState.getRegistrationState();
            int regState = wwanPsRegState.getInitialRegistrationState();
            serviceState.setDataRegState(regCodeToServiceState(regState));
        }
        if (DBG) {
@@ -2218,7 +2218,7 @@ public class ServiceStateTracker extends Handler {
                VoiceSpecificRegistrationInfo voiceSpecificStates =
                        networkRegState.getVoiceSpecificInfo();

                int registrationState = networkRegState.getRegistrationState();
                int registrationState = networkRegState.getInitialRegistrationState();
                int cssIndicator = voiceSpecificStates.cssSupported ? 1 : 0;
                int newVoiceRat = ServiceState.networkTypeToRilRadioTechnology(
                        networkRegState.getAccessNetworkTechnology());
@@ -2300,7 +2300,7 @@ public class ServiceStateTracker extends Handler {
                mNewSS.addNetworkRegistrationInfo(networkRegState);
                DataSpecificRegistrationInfo dataSpecificStates =
                        networkRegState.getDataSpecificInfo();
                int registrationState = networkRegState.getRegistrationState();
                int registrationState = networkRegState.getInitialRegistrationState();
                int serviceState = regCodeToServiceState(registrationState);
                int newDataRat = ServiceState.networkTypeToRilRadioTechnology(
                        networkRegState.getAccessNetworkTechnology());
@@ -3539,9 +3539,9 @@ public class ServiceStateTracker extends Handler {
                anyDataRatChanged = true;
            }

            int oldRegState = oldNrs != null ? oldNrs.getRegistrationState()
            int oldRegState = oldNrs != null ? oldNrs.getInitialRegistrationState()
                    : NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN;
            int newRegState = newNrs != null ? newNrs.getRegistrationState()
            int newRegState = newNrs != null ? newNrs.getInitialRegistrationState()
                    : NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN;
            hasDataRegStateChanged.put(transport, oldRegState != newRegState);
            if (oldRegState != newRegState) {
@@ -4253,7 +4253,7 @@ public class ServiceStateTracker extends Handler {
    }

    /**
     * Do not set roaming state in case of oprators considered non-roaming.
     * Do not set roaming state in case of operators considered non-roaming.
     *
     * Can use mcc or mcc+mnc as item of
     * {@link CarrierConfigManager#KEY_NON_ROAMING_OPERATOR_STRING_ARRAY}.
@@ -5672,7 +5672,7 @@ public class ServiceStateTracker extends Handler {
                NetworkRegistrationInfo wlanNri = new NetworkRegistrationInfo.Builder()
                        .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN)
                        .setDomain(NetworkRegistrationInfo.DOMAIN_PS)
                        .setRegistrationState(wwanNri.getRegistrationState())
                        .setRegistrationState(wwanNri.getInitialRegistrationState())
                        .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN)
                        .setRejectCause(wwanNri.getRejectCause())
                        .setEmergencyOnly(wwanNri.isEmergencyEnabled())
+62 −5
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ import com.android.internal.util.ArrayUtils;
import com.android.internal.util.IState;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import com.android.net.module.util.LinkPropertiesUtils;
import com.android.net.module.util.NetUtils;
import com.android.net.module.util.NetworkCapabilitiesUtils;
import com.android.telephony.Rlog;

@@ -1690,6 +1692,41 @@ public class DataNetwork extends StateMachine {
        }
    }

    /**
     * Check if the new link properties are compatible with the old link properties. For example,
     * if IP changes, that's considered incompatible.
     *
     * @param oldLinkProperties Old link properties.
     * @param newLinkProperties New Link properties.
     *
     * @return {@code true} if the new link properties is compatible with the old link properties.
     */
    private boolean isLinkPropertiesCompatible(@NonNull LinkProperties oldLinkProperties,
            @NonNull LinkProperties newLinkProperties) {
        if (Objects.equals(oldLinkProperties, newLinkProperties)) return true;

        if (!LinkPropertiesUtils.isIdenticalAddresses(oldLinkProperties, newLinkProperties)) {
            // If the same address type was removed and added we need to cleanup.
            LinkPropertiesUtils.CompareOrUpdateResult<Integer, LinkAddress> result =
                    new LinkPropertiesUtils.CompareOrUpdateResult<>(
                            oldLinkProperties.getLinkAddresses(),
                            newLinkProperties.getLinkAddresses(),
                            linkAddress -> Objects.hash(linkAddress.getAddress(),
                                    linkAddress.getPrefixLength(), linkAddress.getScope()));
            log("isLinkPropertiesCompatible: old=" + oldLinkProperties
                    + " new=" + newLinkProperties + " result=" + result);
            for (LinkAddress added : result.added) {
                for (LinkAddress removed : result.removed) {
                    if (NetUtils.addressTypeMatches(removed.getAddress(), added.getAddress())) {
                        return false;
                    }
                }
            }
        }

        return true;
    }

    /**
     * Check if there are immutable capabilities changed. The connectivity service is not able
     * to handle immutable capabilities changed, but in very rare scenarios, immutable capabilities
@@ -2209,10 +2246,29 @@ public class DataNetwork extends StateMachine {
        }

        if (!linkProperties.equals(mLinkProperties)) {
            // If the new link properties is not compatible (e.g. IP changes, interface changes),
            // then we should de-register the network agent and re-create a new one.
            if ((isConnected() || isHandoverInProgress())
                    && !isLinkPropertiesCompatible(linkProperties, mLinkProperties)) {
                logl("updateDataNetwork: Incompatible link properties detected. Re-create the "
                        + "network agent. Changed from " + mLinkProperties + " to "
                        + linkProperties);

                mLinkProperties = linkProperties;

                // Abandon the network agent because we are going to create a new one.
                mNetworkAgent.abandon();
                // Update the link properties first so the new network agent would be created with
                // the new link properties.
                mLinkProperties = linkProperties;
                mNetworkAgent = createNetworkAgent();
                mNetworkAgent.markConnected();
            } else {
                mLinkProperties = linkProperties;
                log("sendLinkProperties " + mLinkProperties);
                mNetworkAgent.sendLinkProperties(mLinkProperties);
            }
        }

        updateNetworkCapabilities();
    }
@@ -2361,8 +2417,9 @@ public class DataNetwork extends StateMachine {
    private void onTearDown(@TearDownReason int reason) {
        logl("onTearDown: reason=" + tearDownReasonToString(reason));

        // track frequent networkUnwanted call of IMS and INTERNET
        if ((isConnected())
        // track frequent NetworkAgent.onNetworkUnwanted() call of IMS and INTERNET
        if (reason == TEAR_DOWN_REASON_CONNECTIVITY_SERVICE_UNWANTED
                && isConnected()
                && (mNetworkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_IMS)
                || mNetworkCapabilities.hasCapability(
                        NetworkCapabilities.NET_CAPABILITY_INTERNET))) {
+6 −10
Original line number Diff line number Diff line
@@ -2242,21 +2242,17 @@ public class DataNetworkController extends Handler {
    }

    /**
     * There have been several bugs where a RECONNECT loop kicks off where a DataConnection
     * connects to the Network, ConnectivityService indicates that the Network is unwanted,
     * and then the DataConnection reconnects. By the time we get the bug report it's too late
     * because there have already been hundreds of RECONNECTS.  This is meant to capture the issue
     * when it first starts.
     *
     * The unwanted counter is configured to only take an anomaly report in extreme cases.
     * This is to avoid having the anomaly message show up on several devices.
     *
     * There have been several bugs where a RECONNECT loop kicks off where a data network
     * is brought up, but connectivity service indicates that the network is unwanted so telephony
     * tears down the network. But later telephony bring up the data network again and becomes an
     * infinite loop. By the time we get the bug report it's too late because there have already
     * been hundreds of bring up/tear down. This is meant to capture the issue when it first starts.
     */
    private void onTrackNetworkUnwanted() {
        if (mNetworkUnwantedCounter.addOccurrence()) {
            reportAnomaly("Network Unwanted called "
                            + mNetworkUnwantedCounter.getFrequencyString(),
                    "9f3bc55b-bfa6-4e26-afaa-5031426a66d2");
                    "9f3bc55b-bfa6-4e26-afaa-5031426a66d3");
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public class DataStallRecoveryManager extends Handler {

    /**
     * Add the RECOVERY_ACTION_REREGISTER to align the RecoveryActions between
     * DataStallRecoveryManager and Westworld. In Android T, This action will not process because
     * DataStallRecoveryManager and atoms.proto. In Android T, This action will not process because
     * the boolean array for skip recovery action is default true in carrier config setting.
     *
     * @deprecated Do not use.
Loading