自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
来电通知
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Android 7.0 将与来电通知相关的功能从 Android 平台中的通讯系统 (Telecom) 服务移到了拨号器应用。以前,显示来电相关通知的职责由通讯系统和默认拨号器应用分担,这就导致了行为不一致。在 Android 7.0 中,拨号器承担了处理来电通知的所有职责。
在 Android 6.x 及更低版本中的行为
在之前的 Android 版本中,通讯系统和拨号器分别承担以下职责:
功能 |
由通讯系统执行 |
由拨号器执行 |
来电通知 |
是(响铃、振动) |
是(通知显示、来电显示) |
发送至语音信箱 |
是 |
否 |
自定义铃声 |
是 |
否 |
未接电话通知 |
是 |
否 |
消息等待指示(呼叫语音信箱) |
是(电话) |
否 |
可视语音信息通知 |
否 |
是 |
因这种职责分担导致的不一致行为的示例包括:
- 通讯系统负责启动振铃器/振动器,但拨号器负责显示来电提醒。如果拨号器启动缓慢,则可能导致响铃数秒后才显示来电通知。
- 通讯系统负责显示未接电话通知。由于专有功能(如 Google 来电显示)不适用于这些通知,因此可能会导致通讯系统通知与拨号器界面(如通话记录)不一致。
在 Android 7.0 及更高版本中的行为
Android 开源项目 (AOSP) 拨号器会实施新的功能。如需了解详情,请参阅以下文档:
Android 12 或更高版本中通话的通知样式
对于搭载 Android 12 或更高版本的设备,为了为用户提供一致的通话体验,我们建议应用针对来电和进行中的通话使用 CallStyle
通知样式。如需了解详情,请参阅允许按来电重要性排名的新通话通知。
实现
如果通讯系统/电话组件会公开可供默认拨号器使用的 API,设备实现人员可能需要对这些组件进行更新。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-06-18。
[null,null,["最后更新时间 (UTC):2025-06-18。"],[],[],null,["# Call notifications\n\nAndroid 7.0 moves functionality related to call notifications from the\nTelecom system service in the Android platform to the Dialer app.\nPreviously, the responsibility for displaying call-related notifications was\nsplit between Telecom and the default Dialer app, creating inconsistencies in\nbehavior. In Android 7.0, the Dialer assumes all responsibility for handling\ncall notifications.\n\nBehavior in Android 6.x and lower\n---------------------------------\n\nIn earlier Android releases, Telecom and Dialer split responsibilities as\ndescribed below:\n\n| Functionality | Done by Telecom | Done by Dialer |\n|--------------------------------------------|------------------------|---------------------------------------|\n| Incoming call notification | Yes (ringing, vibrate) | Yes (notification display, caller ID) |\n| Send to voicemail | Yes | No |\n| Custom ringtone | Yes | No |\n| Missed call notifications | Yes | No |\n| Message Waiting Indicator (call voicemail) | Yes (telephony) | No |\n| Visual voicemail notifications | No | Yes |\n\nExamples of inconsistent behavior caused by this responsibility split\nincluded:\n\n- Telecom was responsible for starting the ringer/vibrator, but the dialer was responsible for displaying the incoming call notification. If the dialer is slow to startup, this can result in ringing starting several seconds before the incoming call notification is displayed.\n- Telecom was responsible for displaying missed call notifications. As proprietary features (such as Google caller ID) do not work on these notifications, this could result in inconsistencies between Telecom notifications and Dialer UI (such as the call log).\n\nBehavior in Android 7.0 and higher\n----------------------------------\n\nThe Android Open Source Project (AOSP) Dialer implements the new\nfunctionality. For details, refer to the following documentation:\n\n- Missed call notifications \n [Telecom/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java](https://android.googlesource.com/platform/packages/services/Telecomm/+/android16-release/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java) \n [Dialer/android/dialer/calllog/MissedCallNotificationReceiver.java](https://android.googlesource.com/platform/packages/apps/Dialer/+/android16-release/java/com/android/dialer/app/calllog/MissedCallNotificationReceiver.java) \n [Dialer/android/dialer/calllog/MissedCallNotifier.java](https://android.googlesource.com/platform/packages/apps/Dialer/+/android16-release/java/com/android/dialer/app/calllog/MissedCallNotifier.java)\n- Playing ringtones: \n [frameworks/base/telecomm/java/android/telecom/InCallService.java](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/InCallService.java) \n [Telecom/src/com/android/server/telecom/InCallController.java](https://android.googlesource.com/platform/packages/services/Telecomm/+/android16-release/src/com/android/server/telecom/InCallController.java) \n [Dialer/java/com/android/incallui/ringtone/](https://android.googlesource.com/platform/packages/apps/Dialer/+/android16-release/java/com/android/incallui/ringtone/) \n [Dialer/java/com/android/incallui/StatusBarNotifier.java](https://android.googlesource.com/platform/packages/apps/Dialer/+/android16-release/java/com/android/incallui/StatusBarNotifier.java)\n- VVM notifications \n [frameworks/base/telephony/java/android/telephony/TelephonyManager.java](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telephony/java/android/telephony/TelephonyManager.java) \n [Telephony/src/com/android/phone/PhoneInterfaceManager.java](https://android.googlesource.com/platform/packages/services/Telephony/+/android16-release/src/com/android/phone/PhoneInterfaceManager.java) \n [Dialer/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java](https://android.googlesource.com/platform/packages/apps/Dialer/+/nougat-release/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java)\n\nNotification style for calls in Android 12 or higher\n----------------------------------------------------\n\nFor devices running Android 12 or higher, to provide\na consistent user experience for calls, we recommend that apps use the\n[`CallStyle`](https://developer.android.com/reference/android/app/Notification.CallStyle) notification style for incoming and ongoing calls.\nFor more information, see\n[New phone call notifications allowing for ranking importance of incoming\ncalls](https://developer.android.com/about/versions/12/features#new-calls).\n\nImplementation\n--------------\n\nDevice implementers may need to update Telecom/Telephony components that\nexpose APIs available for use by the default Dialer."]]