自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
來電通知
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android 7.0 將與通話通知相關的功能從 Android 平台的電信系統服務移至撥號程式應用程式。先前,顯示與通話相關通知的責任分散在電信和預設撥號程式應用程式之間,導致行為不一致。在 Android 7.0 中,撥號應用程式會負責處理所有通話通知。
Android 6.x 以下版本的行為
在舊版 Android 版本中,Telecom 和 Dialer 的職責分工如下所述:
功能 |
由電信公司完成 |
由撥號程式完成 |
來電通知 |
是 (鈴聲、震動) |
是 (通知顯示、來電顯示) |
轉入語音信箱 |
是 |
否 |
自訂鈴聲 |
是 |
否 |
未接來電通知 |
是 |
否 |
待處理訊息指標 (撥打語音留言服務) |
是 (電信) |
否 |
視覺化語音信箱通知 |
否 |
是 |
這項責任分割作業造成的行為不一致情形包括:
- Telecom 負責啟動鈴聲/震動器,但撥號程式負責顯示來電通知。如果撥號程式啟動速度緩慢,可能會導致鈴聲在顯示來電通知前幾秒就開始響起。
- 電信業者負責顯示未接來電通知。由於專屬功能 (例如 Google 來電者 ID) 無法在這些通知中運作,因此可能會導致電信通知和撥號應用程式介面 (例如通話記錄) 之間出現不一致的情形。
Android 7.0 以上版本的行為
Android 開放原始碼計畫 (AOSP) 撥號應用程式會實作新功能。詳情請參閱以下說明文件:
Android 12 以上版本的通話通知樣式
針對搭載 Android 12 以上版本的裝置,為了提供一致的通話使用者體驗,我們建議應用程式使用
CallStyle
通知樣式,用於顯示來電和通話中狀態。詳情請參閱
新款電話通知功能,可讓您將來電的重要性排序。
實作
裝置導入者可能需要更新 Telecom/Telephony 元件,以便公開可供預設撥號應用程式使用的 API。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-06-18 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間: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."]]