Carrier identification (original) (raw)

Devices running Android 9 can recognize subscription carrier information to provide an ID and a carrier name. Android maintains a carrier ID database, with matching rules for each carrier and its unique carrier ID. Android Open Source Project (AOSP) includes the content of the carrier ID database, in the filecarrier_list.textpb. The unified database minimizes duplicate logic in apps that need to identify carriers and limits the exposure of carrier-identifying attributes.

To improve the coverage and accuracy of carrier identification, Android supports out-of-band and carrier ID table updates. Each update comes with a version number and is published to AOSP.

Implementation

If you want to implement out-of-band updates, you can download thecarrier_list.pbbinary from AOSP. To view the readable format of the table, seecarrier_list.textpb.

Place the carrier ID table in the /data/misc/carrierid/ data partition of the device. If the carrier ID table is newer than the existing version, the device persists the table to thecarrier ID database class. The most recent information from the carrier ID database is picked up by the public methodsgetSimCarrierId()andgetSimCarrierIdName().

Add carrier ID information to the database

To add or update a carrier ID to the database, submit a request using theCarrier identification information form.

Your request is reviewed and if approved, the change is pushed to the AOSP codebase atcarrier_list.pb. You can then copy the updated list and incorporate it into your customized build.

Integrate carrier IDs with CarrierConfig

Starting from Android 10,carrier configuration supports using carrier IDs as keys to fetch carrier-specific configurations fromCarrierService.

Integrating carrier IDs with CarrierConfig has the following advantages:

Migrate configuration data to carrier IDs

To migrate configuration data from MCC/MNC pairs to carrier IDs, follow these steps:

  1. Group the carrier_config_mccmnc.xml files from a single carrier together. Usecarrier_list.textpbas a reference to map the MCC, MNC, and MVNO information to a particular carrier.
  2. Merge the configurations into a single file.
  3. (Optional) Inherit data from MNOs. MVNOs inherit configurations from MNOs in the legacy carrier_config_mccmnc.xml file. Because carrier IDs allow all carriers including MVNOs to have a dedicated config file, it's recommended to include MNO data during migration.
  4. If the configuration for an MVNO carrier ID doesn't exist, fetch the configuration from its MNO carrier ID usinggetCarrierIdFromSimMccMnc.
  5. Rename the new file ascarrier_config_carrierid_carrierid_carriername.xmlwhere carrierid must correspond to a canonical_id andcarriername must correspond to a carrier_name incarrier_list.textpb.