自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
信号强度报告
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
电话框架会通过各种类型的信号测量手段报告移动网络的信号强度。然后,您可以利用报告的这些信号强度控制信号强度条在设备上的显示方式,并自定义从调制解调器报告信号强度的标准。从 Android 11 开始,您可以自定义电话框架用于报告 4G LTE 和 5G NR 无线接入网络 (RAN) 信号强度的多种信号测量类型。
框架使用三种函数来报告信号强度:信号强度报告标准、信号强度阈值和信号电平。
这些函数会影响 Android 与调制解调器硬件的通信方式,例如,防止调制解调器进行不必要的信号强度报告,以便减少耗电量并改善系统运行状况。函数的定义如下:
- 信号强度报告标准:Android 定义的从调制解调器报告信号强度的触发条件。
- 信号强度阈值:一个由四个整数构成的列表,表示信号电平和信号强度报告标准的建议值。
- 信号电平:与信号强度相对应的五级电平(
NONE
、POOR
、MODERATE
、GOOD
和 GREAT
)。
支持多种信号测量类型
在搭载 Android 11 或更高版本的设备上,可为 NGRAN (5G LTE) 和 EUTRAN (4G LTE) 网络自定义以下信号测量类型。这些测量类型可用于信号强度报告标准、信号强度阈值和信号电平函数。
- NGRAN (5G NR):SSRSRP、SSRSRQ、SSSINR
- EUTRAN (4G LTE):RSRP、RSRQ、RSSNR
实现
如需让设备为每个 RAN 设置信号强度报告标准,请实现 setSignalStrengthReportingCriteria_1_5
硬件接口。每个 RAN 支持多种信号测量类型。如果没有为 RAN 启用任何测量类型的报告标准,那么该 RAN 的报告标准由 Android 框架定义。为 RAN 启用某种测量类型的报告标准后,其他测量类型的报告标准将被停用。
如需定义 4G 和 5G 网络的信号强度阈值,请使用以下运营商配置密钥:
如需为 RAN 选择多种测量类型,请使用以下运营商配置密钥:
验证
如需验证您的实现方式,请使用 CarrierConfigManagerTest
中的 testGetConfig
CTS 测试,使用 VTS 测试 setSignalStrengthReportingCriteria_1_5_*
。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-04-06。
[null,null,["最后更新时间 (UTC):2025-04-06。"],[],[],null,["# Signal strength reporting\n\nThe telephony framework reports cellular network signal strength using various\nsignal measurement types. You can then use these reported signal strengths to\ncontrol how signal bars are displayed on your device and customize the signal\nstrength reporting criteria from the modem. Starting from Android\n11, you can customize\nmultiple signal measurement types that the framework uses to report the signal\nstrength of 4G LTE and 5G NR radio access networks (RANs).\n\nThe framework uses three functions for reporting signal strength: signal\nstrength reporting criteria, signal strength thresholds, and signal levels.\nThese functions affect how Android communicates with the modem hardware, for\nexample, preventing unnecessary signal strength reporting by the modem to reduce\npower usage and improve system health. The functions are defined as:\n\n- **Signal strength reporting criteria:** The conditions defined by Android to trigger signal strength reporting from the modem.\n- **Signal strength thresholds:** A list of four integers used for suggesting signal level and signal strength reporting criteria.\n- **Signal levels:** Five levels (`NONE`, `POOR`, `MODERATE`, `GOOD`, `GREAT`) that correspond to signal strength.\n\nSupport for multiple signal measurement types\n---------------------------------------------\n\nFor devices running Android 11 or higher, the\nfollowing signal measurement types\nare customizable for NGRAN (5G LTE) and EUTRAN (4G LTE) networks. These\nmeasurements are used for the signal strength reporting criteria, signal\nstrength thresholds, and signal levels functions.\n\n- **NGRAN (5G NR):** SSRSRP, SSRSRQ, SSSINR\n- **EUTRAN (4G LTE):** RSRP, RSRQ, RSSNR\n\nImplementation\n--------------\n\nTo enable the device to set the signal strength reporting criteria for each RAN,\nimplement the\n[`setSignalStrengthReportingCriteria_1_5`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/radio/1.5/IRadio.hal#68)\nhardware interface. For each RAN, multiple signal measurement types are\nsupported. If none of the reporting criteria for a measurement type is enabled\nfor a RAN, the reporting criteria for that RAN is defined by the Android\nframework. When the reporting criteria of a measurement type is enabled for a\nRAN, the reporting criteria of other measurement types are disabled.\n\nTo define the signal strength thresholds for 4G and 5G networks, use the\nfollowing carrier config keys:\n\n- [`KEY_5G_NR_SSRSRP_THRESHOLDS_INT_ARRAY`](https://developer.android.com/reference/android/telephony/CarrierConfigManager#KEY_5G_NR_SSRSRP_THRESHOLDS_INT_ARRAY)\n- [`KEY_5G_NR_SSRSRQ_THRESHOLDS_INT_ARRAY`](https://developer.android.com/reference/android/telephony/CarrierConfigManager#KEY_5G_NR_SSRSRQ_THRESHOLDS_INT_ARRAY)\n- [`KEY_5G_NR_SSSINR_THRESHOLDS_INT_ARRAY`](https://developer.android.com/reference/android/telephony/CarrierConfigManager#KEY_5G_NR_SSSINR_THRESHOLDS_INT_ARRAY)\n- [`KEY_LTE_RSRQ_THRESHOLDS_INT_ARRAY`](https://developer.android.com/reference/android/telephony/CarrierConfigManager#KEY_LTE_RSRQ_THRESHOLDS_INT_ARRAY)\n- [`KEY_LTE_RSSNR_THRESHOLDS_INT_ARRAY`](https://developer.android.com/reference/android/telephony/CarrierConfigManager#KEY_LTE_RSSNR_THRESHOLDS_INT_ARRAY)\n\nTo select multiple measurements for a RAN, use the following carrier config\nkeys:\n\n- [`KEY_PARAMETERS_USED_FOR_LTE_SIGNAL_BAR_INT`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/telephony/java/android/telephony/CarrierConfigManager.java#2379)\n- [`KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/telephony/java/android/telephony/CarrierConfigManager.java#2461)\n\nValidation\n----------\n\nTo validate your implementation, use the\n[`testGetConfig`](https://android.googlesource.com/platform/cts/+/112b1be/tests/tests/telephony/src/android/telephony/cts/CarrierConfigManagerTest.java#70)\nCTS test in\n[`CarrierConfigManagerTest`](https://android.googlesource.com/platform/cts/+/112b1be/tests/tests/telephony/src/android/telephony/cts/CarrierConfigManagerTest.java).\nUse [VTS](/docs/core/tests/vts) for testing\n`setSignalStrengthReportingCriteria_1_5_*`."]]