Where can I find the list of networks considered not roaming? Some time ago, back in the days of CyanogenMod, I stumbled across a list of network combinations which were not considered roaming.
Usually, Android looks at the MCC and MNC of the SIM card and compares them to those of the current network. If they do not match, Android considers itself to be roaming. The status bar icon will report this, and options such as disabling data while roaming take effect.
The list overrides this behavior by specifying combinations of MCC/MNC pairs which are not considered roaming. For example, O2 Germany (262-07) acquired rival E-Plus (262-03) a few years back. Initially, cell towers still used the MCC/MNC of the original operator, but customers could roam between both networks at no extra charge. For cases like these, the list would have had a rule like “if the SIM card has 262-07, consider network 262-03 to be the home network, not a roaming network” (and another one for the opposite case of an E-Plus card being used on an O2 tower).
This list sits somewhere in the source code and is not exposed through settings. Unfortunately, I do not know where to find it (and if it ever was part of AOSP, or added by Cyanogenmod).
Does anyone know where this list is located?
The decision if a SIM is connected to a roaming network (a network of another country, for example) is done by the framework with the information obtained on this network.
First, we need to know that there are two types:

Domestic Roaming -&gt; A network of the same country (same MCC) as the SIM but that it is of other operator (different MNC).
International Roaming -&gt; A network of another country (different MCC)

A lot of OEMs (BQ, Samsung, Xiaomi...) treat Domestic Roaming as not roaming because, for example, all the MVNO use Domestic Roaming.
By default, AOSP has a way to add networks so they will always be considered roaming (as well as adding networks that will never be considered roaming)
For AOSP, it works like this:

In ServiceStateTracker.java of framework/opt/telephony:
/**
 * Do not set roaming state in case of oprators considered non-roaming.
 *
 * Can use mcc or mcc+mnc as item of
 * {@link CarrierConfigManager#KEY_NON_ROAMING_OPERATOR_STRING_ARRAY}.
 * For example, 302 or 21407. If mcc or mcc+mnc match with operator,
 * don't set roaming state.
 *
 * @param s ServiceState hold current ons
 * @return false for roaming state set
 */
private boolean isOperatorConsideredNonRoaming(ServiceState s) {
    String operatorNumeric = s.getOperatorNumeric();
    PersistableBundle config = getCarrierConfig();
    String[] numericArray = config.getStringArray(
            CarrierConfigManager.KEY_NON_ROAMING_OPERATOR_STRING_ARRAY);
    if (ArrayUtils.isEmpty(numericArray) || operatorNumeric == null) {
        return false;
    }
    for (String numeric : numericArray) {
        if (!TextUtils.isEmpty(numeric) &amp;&amp; operatorNumeric.startsWith(numeric)) {
            return true;
        }
    }
    return false;
}

and at the same way:
private boolean isOperatorConsideredRoaming(ServiceState s) {
    String operatorNumeric = s.getOperatorNumeric();
    PersistableBundle config = getCarrierConfig();
    String[] numericArray = config.getStringArray(
            CarrierConfigManager.KEY_ROAMING_OPERATOR_STRING_ARRAY);
    if (ArrayUtils.isEmpty(numericArray) || operatorNumeric == null) {
        return false;
    }
    for (String numeric : numericArray) {
        if (!TextUtils.isEmpty(numeric) &amp;&amp; operatorNumeric.startsWith(numeric)) {
            return true;
        }
    }
    return false;
}

If we search information about KEY_ROAMING_OPERATOR_STRING_ARRAY and KEY_NON_ROAMING_OPERATOR_STRING_ARRAY in Android Developers we found that

So you could add in carrier_config_21407 (Movistar Spain) a list of roaming and not roaming list:
&lt;?xml version='1.0' encoding='utf-8' standalone='yes' ?&gt;
&lt;carrier_config_list&gt;
  &lt;carrier_config&gt;
    &lt;string-array name=&quot;gsm_nonroaming_networks_string_array&quot; num=&quot;1&quot;&gt;
      &lt;item value=&quot;26804&quot; /&gt; //for example, LycaMobile Portugal
    &lt;/string-array&gt;
  &lt;/carrier_config&gt;
&lt;/carrier_config_list&gt;

The carrier config files are found in platform/packages/apps/CarrierConfig. There are two possible formats:

For a carrier that has been assigned a carrier ID in https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/master/assets/latest_carrier_id/carrier_list.textpb, the config file is named carrier_config_carrierid_42_Vodkafone.xml, the last two elements being the carrier ID and its name. This is the preferred form, as it supports a single config file for carriers using multiple MCC/MNC pairs.
Otherwise, the file name is something like carrier_config_mccmnc_55501.xml, where the last element is the MCC followed by the MNC.