Hello,
The current setting for "enable carrier overrides" does only what Pixel IMS used to do which is override that configuration to allow different settings. This is the equivalent to modifying the .pb files in ./vendor/google_devices/komodo/proprietary/product/etc/CarrierSettings - but it's not enough for 5G.
It seems "Force 5G" basically changes the nr_availabilities key, however it's not enough to override. This is because specifically for 5G NSA, a feature in the modem is also needed to be enabled for it to work EN-DC (EUTRA-New Radio Dual Connectivity). This is controlled by another place, specifically a database of settings and binary blobs located here (at least for komodo): ./vendor/google_devices/komodo/proprietary/vendor/firmware/carrierconfig/cfg.db
The file formats are unknown but cfg.db is itself a simple sqlite3 database. For "non-supported" countries, the settings of the carrier is used whose id is set in the regional_fallback table, which has only 1 record.
Doing the following statement works to fully enable it for me (tested by my own custom builds on komodo in one such "unsupported" region that has no modem config at all):
UPDATE regional_fallback set carrier_id = $FALLBACK_CARRIER_ID
Running this right before starting build, gives me a working 5G. The value of FALLBACK_CARRIER_ID may differ between device and others, but it corresponds to the primary key of the carrier_info table for the record which has mccmnc of 23820 (Telia Denmark). For komodo FALLBACK_CARRIER_ID = 656.
It would be great if we can have a selectable list of "fallback carrier mcc mnc" and graphene loads it into the modem, because very frequently an "unsupported" country has a very similar 5G rollout to neighbors, and very likely it's possible to choose a PLMN of a country with similar enough bands and setup that it works perfectly well.
An alternative way to do this can involve talking to the modem on every startup and/or sim switch to do the same as what the Pixel 5G and Network Signal Guru to enable it. This involves modifying the transient nvitems by AT commands with secret AT+GOOG commands. However this modification is transient and wiped out on any sim change or system update.
Here's the Pixel 5G app: https://github.com/SaeedDev94/pixel-5g
My suspicion is that these "blobs" beside cfg.db are the stock NVITEMS but in some encrypted and/or signed form.
Also, my understanding is that these methods only apply to the "Shannon" family of modems, the older Qualcomm Pixels need a different way.
Thanks for the great work that goes into this OS.