自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
紧急电话号码和紧急呼叫
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
紧急呼叫对于设备而言至关重要,因为它们必须可供 Android 用户使用,同时满足全球各种运营商和监管要求。Android 框架可为用户提供快速安全的紧急呼叫体验。
Android 10 通过使用 SIM 卡、网络、调制解调器和数据库中的详细紧急电话号码列表,改进了对本地 Android 平台中紧急呼叫功能、维护和更新的支持。Android 10 还支持基于警察、消防或救护车等紧急服务类型的紧急呼叫。Android 10 通过在 TelephonyManager API 中共享来自多个订阅的紧急电话号码,改进了对多 SIM 设备的支持。
在使用 Radio HAL 1.4 的 Android 10 中,通过在 HAL 接口中将紧急呼叫与正常呼叫分离以优化紧急呼叫路径,以及允许设备拨打在 Android 数据库中配置的相应紧急电话号码来改进紧急呼叫。
实现
如需实现紧急呼叫和紧急电话号码功能,请实现以下 TelephonyManager
和硬件接口 API。
TelephonyManager API
实现以下 API:
紧急电话号码来源的值包括:
EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING
:电话号码来自网络信号
EMERGENCY_NUMBER_SOURCE_SIM
:电话号码来自 SIM 卡
EMERGENCY_NUMBER_SOURCE_DATABASE
:电话号码来自平台维护的数据库
EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG
:电话号码来自调制解调器配置
EMERGENCY_NUMBER_SOURCE_DEFAULT
:默认情况下,可以拨打电话号码。必须始终可以拨打电话号码 112 和 911。没有 SIM 卡时,必须可拨打 000、08、110、999、118 和 119。如需了解详情,请参阅 3GPP TS 22.101 中的第 10 部分:紧急呼叫。。
紧急服务类别的值包括:
UNSPECIFIED
:一般紧急呼叫,所有类别
POLICE
:警察
AMBULANCE
:救护车
FIRE_BRIGADE
:消防队
MARINE_GUARD
:海军陆战队
MOUNTAIN_RESCUE
:山地救援
MIEC
:手动启动的 eCall (MIeC)
AIEC
:自动启动的 eCall (AIeC)
如需了解详情,请参阅 3GPP TS 22.101 中的第 10 部分:紧急呼叫。。
硬件接口 API
在 IRadio.hal
中实现 emergencyDial
。在 IRadioResponse.hal
中实现 emergencyDialResponse
以发送响应,其中包含响应类型、序列号和错误信息。
如需报告紧急电话号码的最新列表,请在 IRadioIndication.hal
中实现 currentEmergencyNumberList
。在 types.hal
中实现 EmergencyNumber
,其中包含有关紧急电话号码的信息,包括电话号码归属地、移动设备国家/地区代码 (MCC)、移动网络代码 (MNC)、紧急服务类别、紧急统一资源名称 (URN) 和紧急电话号码来源。
如需指示如何处理紧急呼叫,请使用 EmergencyCallRouting
。根据需要,可以使用紧急呼叫转接或正常呼叫转接请求紧急呼叫。如果此值为 UNKNOWN
,则根据具体实现决定转接方式。
验证
要验证您的实现,请运行以下 CTS 和 VTS 测试。
CTS 测试
VTS 测试
参考资料
如需详细了解相关技术规范和标准,请参阅:
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Emergency numbers and emergency calling\n\nEmergency calling is fundamental and critical for devices because they must work\nfor Android users while satisfying various carrier and regulatory requirements\nall over the world. The Android framework provides users with a fast and safe\nemergency calling experience.\n\nAndroid 10 provides improved support for emergency call\nfunctions, maintenance, and updates in the local Android platform by using a\ndetailed emergency number list from the SIM, network, modem, and database.\nAndroid 10 also supports emergency calling based on the type of emergency\nservices such as police, fire, or ambulance. Android 10 provides\nimproved support for multi-SIM\ndevices by sharing emergency numbers from multiple subscriptions in\nthe TelephonyManager API.\n\nIn Android 10 with Radio HAL 1.4, emergency calling is\nimproved by separating emergency calls from normal calls in the HAL interface\nto optimize the emergency calling path and allowing devices to dial the\nappropriate emergency number configured in the Android database.\n\nImplementation\n--------------\n\nTo implement the emergency calling and emergency number functions, implement\nthe following\n[`TelephonyManager`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/telephony/java/android/telephony/TelephonyManager.java)\nand hardware interface APIs.\n\n### TelephonyManager APIs\n\nImplement the following APIs:\n\n- Implement [`getEmergencyNumberList`](https://developer.android.com/reference/android/telephony/TelephonyManager.html#getEmergencyNumberList()) to get valid emergency numbers for emergency calling based on the emergency number source including the locale, SIM cards, default, modem, Android database, and network. For each emergency number, specify the corresponding emergency service category such as police, ambulance, and fire.\n- Implement [`isEmergencyNumber`](https://developer.android.com/reference/android/telephony/TelephonyManager.html#isEmergencyNumber(java.lang.String)) to identify whether a phone number is an emergency number.\n- Implement [`isPotentialEmergencyNumber`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/telephony/java/android/telephony/TelephonyManager.java#10554) to identify a number as an emergency number if it has the same starting digits as any of the emergency numbers.\n\nThe values for emergency number sources are:\n\n- `EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING`: Number is from the network signal\n- `EMERGENCY_NUMBER_SOURCE_SIM`: Number is from the SIM card\n- `EMERGENCY_NUMBER_SOURCE_DATABASE`: Number is from the platform-maintained database\n- `EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG`: Number is from the modem configuration\n- `EMERGENCY_NUMBER_SOURCE_DEFAULT`: Number is available by default. The numbers 112 and 911 must always be available. 000, 08, 110, 999, 118, and 119 must be available when no SIM is present. For more details, see *Section 10: Emergency Calls* in [3GPP TS 22.101](https://www.etsi.org/deliver/etsi_ts/122100_122199/122101/09.01.00_60/ts_122101v090100p.pdf).\n\nThe values for emergency service categories are:\n\n- `UNSPECIFIED`: General emergency call, all categories\n- `POLICE`: Police\n- `AMBULANCE`: Ambulance\n- `FIRE_BRIGADE`: Fire brigade\n- `MARINE_GUARD`: Marine Guard\n- `MOUNTAIN_RESCUE`: Mountain Rescue\n- `MIEC`: Manually Initiated eCall (MIeC)\n- `AIEC`: Automatically Initiated eCall (AIeC)\n\nFor more details, see *Section 10: Emergency Calls* in\n[3GPP TS 22.101](https://www.etsi.org/deliver/etsi_ts/122100_122199/122101/09.01.00_60/ts_122101v090100p.pdf).\n\n### Hardware interface APIs\n\nImplement\n[`emergencyDial`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/IRadio.hal#159)\nin `IRadio.hal`. Implement\n[`emergencyDialResponse`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/IRadioResponse.hal#55)\nin `IRadioResponse.hal` to send a response with response type, serial number,\nand error information.\n\nTo report the current list of emergency numbers, implement\n[`currentEmergencyNumberList`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/IRadioIndication.hal#52)\nin `IRadioIndication.hal`. Implement\n[`EmergencyNumber`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/types.hal#99)\nin `types.hal`, which contains information about the emergency number including\nthe number address, the mobile country code (MCC), mobile network code (MNC),\n[emergency service category](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/types.hal#145),\nemergency uniform resource name (URN), and\n[emergency number source](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/types.hal#170).\n\nTo indicate how an emergency call is handled, use\n[`EmergencyCallRouting`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/types.hal#194).\nAn emergency call can be requested using emergency routing or normal call\nrouting as required. If this is `UNKNOWN`, routing is decided based on the\nimplementation.\n\nValidation\n----------\n\nTo validate your implementation, run the following CTS and VTS tests.\n\n### CTS tests\n\n- [`testGetEmergencyNumberList`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java#1235)\n- [`testIsEmergencyNumber`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java#1277)\n- [`testIsPotentialEmergencyNumber`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java#1304)\n\n### VTS tests\n\n- [`emergencyDial`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/vts/functional/radio_hidl_hal_api.cpp#24)\n- [`emergencyDial_withServices`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/vts/functional/radio_hidl_hal_api.cpp#49)\n- [`emergencyDial_withEmergencyRouting`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.4/vts/functional/radio_hidl_hal_api.cpp#75)\n\nReferences\n----------\n\nFor additional information on related technical specifications and standards,\nsee:\n\n- [3GPP TS 22.101](https://www.etsi.org/deliver/etsi_ts/122100_122199/122101/09.01.00_60/ts_122101v090100p.pdf), *Section 10: Emergency Calls*\n- [3GPP TS 24.008](https://www.etsi.org/deliver/etsi_ts/124000_124099/124008/07.15.00_60/ts_124008v071500p.pdf), *Section 9.2.13.4: Emergency Number List*\n- [3GPP TS 23.167](https://www.etsi.org/deliver/etsi_ts/123100_123199/123167/15.04.00_60/ts_123167v150400p.pdf), *Section 6: Functional description*\n- [3GPP TS 24.503](https://www.etsi.org/deliver/etsi_ts/124500_124599/124503/08.22.00_60/ts_124503v082200p.pdf), *Section 5.1.6.8.1: General*\n- [RFC 5031](https://tools.ietf.org/html/rfc5031): *A Uniform\n Resource Name (URN) for Emergency and Other Well-Known Services*"]]