我要评分
获取效率
正确性
完整性
易理解

Example Configuration

This section provides an example of configuring Telephony properties.

  1. Call the setprop method to set the IMEI value.
    1
    setprop persist.sys.prop.writeimei 861456987456321
    

    Restart the container and enter *#06# on the dialing screen.

  2. Call the setprop method to set the network operator name and code.
    1
    2
    setprop persist.gsm.operator.alphacph "China Telecom"
    setprop persist.gsm.operator.numericcph 46011
    

    Restart the container and query the setting result in the application.

    In AOSP 15, the network operator code 46000 is bound to the network operator name China Mobile. If the network operator code is 46000, the network operator name cannot be changed separately. For other network operator codes, you can change the operator name separately.

  3. Call the setprop method to set IMSI and SIM card operator name.

    The AOSP source package contains the packages/providers/TelephonyProvider/assets/latest_carrier_id/carrier_list.textpb file.

    This file maintains the mapping between some SIM card operator codes and SIM card operator names. The mapping cannot be manually modified through Telephony mock. The values that are not maintained in the file can be configured as required.

    1
    2
    setprop persist.sys.prop.writeimsi 460100123456789
    setprop persist.gsm.sim.operator.alphacph "China test1"
    

    Restart the container, enter *#*#4636#*#* on the dialing screen, and query the mobile phone information. The IMSI can be queried.

    The SIM card operator name and SIM card operator code are displayed.

  4. Call the setprop method to set the SIM card serial number.
    1
    setprop persist.sys.prop.writesimserial 89864567890123456789
    

    Restart the container and run the following command to query the setting result:

    1
    dumpsys isub | grep -i iccid
    

    1. The SIM card serial number must be set to a number starting with 8986. Otherwise, the SIM card serial number will be left empty.
    2. If you use the following command during Android image compilation:
      1
      lunch kbox_arm64-trunk_staging-user
      

      Due to the information security mechanism of the user mode, the end of the queried SIM card serial number is blocked by an asterisk (*). This is normal and does not affect the actual functions. You can use related applications for verification.

      If you use the following command to specify the userdebug mode during Android image compilation, the complete serial number can be displayed.

      lunch kbox_arm64-trunk_staging-userdebug
  5. Call the setprop method to set the phone number.
    1
    setprop persist.sys.prop.writephonenum 12345678901
    

    Restart the container and query the setting result in the application.