1、问题背景
在手机开发过程中,经常遇见各种紧急号码问题,在此特意总结下紧急号码相关知识。
2、紧急号码来源
在MTK RILD EccNumberSource.h中,定义了如下几种紧急号码来源。
按优先级排序介绍如下
2.1、SOURCE_NETWORK
网络下发,通过DL下发。
可以参考:
https://www.sharetechnote.com/html/Handbook_UMTS_EmergencyNumberList.html
MTK平台通过 +CEN1, +CEN2 来进行上报
//代表 73001 网络支持紧急号码上报
10-20 12:31:53.418255 1430 1443 I AT : [0] AT< +CEN1:1,730,01 (RIL_URC_READER, tid:494604676352)
//网络上报紧急号码 133,Category 为 31 即代表该号码同时为 Police,Ambulance,Fire Brigade, Marine Guard, Marine Guard 的服务台
10-20 12:31:53.418329 1430 1443 I AT : [0] AT< +CEN2:31,133 (RIL_URC_READER, tid:494604676352
2.2、SOURCE_SIM
USIM卡通过+ESIMECC消息上报卡中ECC信息
CSIM卡通过+CECC消息上报ECC信息
12-12 17:43:50.745462 1268 1275 V RtcEccNumberController: [0] [parseSimEcc] line: +ESIMECC: 0
12-12 17:43:50.745484 1268 1275 V RtcEccNumberController: [0] [parseSimEcc] There is no ECC number stored in SIM
2.3、SOURCE_CONFIG
MTK RILD 中默认配置路径来自 EccNumberSource.h
#define ECC_OM_FILE_PATH "/system/vendor/etc/ecc_list.xml"
2.4、SOURCE_DEFAULT
协议规定 3GPP TS 22.101必须是紧急号码
#define ECC_DEFAULT "112,911"
#define ECC_DEFAULT_NO_SIM "112,911,000,08,110,118,119,999"
/**
* Indicates the number is available as default. Per the reference, 112, 911 must always be
* available; additionally, 000, 08, 110, 999, 118 and 119 must be available when sim is not
* present.
*/
SOURCE_DEFAULT = 1 << 3,
2.5、其他来源
暂时没用到,暂时不做处理
/**
* Indicates the number is from the OEM property.
* Will mapping to AOSP source type MODEM_CONFIG
*/
SOURCE_OEM_PROPERTY = 1 << 4,
/**
* Indicates the number is from framework
* Will mapping to AOSP source type MODEM_CONFIG
*/
SOURCE_FRAMEWORK = 1 << 5,
/**
* Indicates the number is from test property which add through
* Engineer Mode -> Telephony -> Emergency Numbers
* Will mapping to AOSP source type MODEM_CONFIG
*/
SOURCE_TEST = 1 << 6
2.6、Android FRAMEWORK
packages\services\Telephony\ecc\input\eccdata.txt
Android Q上google添加了相关ecc紧急号码配置,EmergencyNumber.java
对应EMERGENCY_NUMBER_SOURCE_DATABASE
3、紧急号码来分类
对于"/system/vendor/etc/ecc_list.xml"配置来说
typedef enum {
CONDITION_NO_SIM = 0, // Only ECC when NO SIM
CONDITION_ALWAYS = 1, // Always ECC
CONDITION_MMI = 2, // Fake/Special ECC (normal call setup flow)
CONDITION_SIM_ONLY = 3, // Only ECC when SIM insert
CONDITION_NEVER = 4 // Not ECC in any condition (ex: customer service number)
} EmergencyNumberCondition;
condition 表示紧急号码类型,真紧急,假紧急,无卡紧急
真紧急 ATDE 空口EMERGENCY_SETUP
假紧急 ATD 空口SETUP
enum class EmergencyServiceCategory : int32_t {
/**
* General emergency call, all categories
*/
UNSPECIFIED = 0,
POLICE = 1 /* 1 << 0 */,
AMBULANCE = 2 /* 1 << 1 */,
FIRE_BRIGADE = 4 /* 1 << 2 */,
MARINE_GUARD = 8 /* 1 << 3 */,
MOUNTAIN_RESCUE = 16 /* 1 << 4 */,
/**
* Manually Initiated eCall (MIeC)
*/
MIEC = 32 /* 1 << 5 */,
/**
* Automatically Initiated eCall (AIeC)
*/
AIEC = 64 /* 1 << 6 */,
};
category表示对应的紧急号码类型
相关配置表如下