Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Thông báo cuộc gọi
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Android 7.0 di chuyển chức năng liên quan đến thông báo cuộc gọi từ dịch vụ hệ thống Viễn thông trong nền tảng Android sang ứng dụng Trình quay số. Trước đây, trách nhiệm hiển thị thông báo liên quan đến cuộc gọi được phân chia giữa Viễn thông và ứng dụng Trình quay số mặc định, tạo ra sự không nhất quán trong hành vi. Trong Android 7.0, Trình quay số chịu mọi trách nhiệm xử lý thông báo cuộc gọi.
Hành vi trong Android 6.x trở xuống
Trong các bản phát hành Android trước, Telecom và Dialer chia sẻ trách nhiệm như mô tả dưới đây:
Chức năng |
Do Telecom thực hiện |
Do Trình quay số thực hiện |
Thông báo khi có cuộc gọi đến |
Có (đổ chuông, rung) |
Có (hiển thị thông báo, tên nhận dạng người gọi) |
Gửi tới thư thoại |
Có |
Không |
Nhạc chuông tuỳ chỉnh |
Có |
Không |
Thông báo cuộc gọi nhỡ |
Có |
Không |
Chỉ báo tin nhắn chờ (thư thoại) |
Có (viễn thông) |
Không |
Thông báo về thư thoại kèm theo hình ảnh |
Không |
Có |
Sau đây là ví dụ về hành vi không nhất quán do việc phân chia trách nhiệm này gây ra:
- Telecom chịu trách nhiệm khởi động chuông/máy rung, nhưng trình quay số chịu trách nhiệm hiển thị thông báo cuộc gọi đến. Nếu trình quay số khởi động chậm, thì chuông có thể bắt đầu đổ vài giây trước khi thông báo cuộc gọi đến hiển thị.
- Nhà mạng chịu trách nhiệm hiển thị thông báo cuộc gọi nhỡ. Vì các tính năng độc quyền (chẳng hạn như tính năng nhận dạng người gọi của Google) không hoạt động trên các thông báo này, nên điều này có thể dẫn đến sự không nhất quán giữa thông báo viễn thông và giao diện người dùng của Trình quay số (chẳng hạn như nhật ký cuộc gọi).
Hành vi trong Android 7.0 trở lên
Trình quay số Dự án nguồn mở Android (AOSP) triển khai chức năng mới. Để biết thông tin chi tiết, hãy tham khảo tài liệu sau:
Kiểu thông báo cho cuộc gọi trên Android 12 trở lên
Đối với các thiết bị chạy Android 12 trở lên, để mang lại trải nghiệm nhất quán cho người dùng đối với các cuộc gọi, các ứng dụng nên sử dụng kiểu thông báo
CallStyle
cho các cuộc gọi đến và đang diễn ra.
Để biết thêm thông tin, hãy xem bài viết
Thông báo cuộc gọi điện thoại mới cho phép xếp hạng mức độ quan trọng của cuộc gọi đến.
Triển khai
Người triển khai thiết bị có thể cần cập nhật các thành phần Điện thoại/Viễn thông hiển thị các API có sẵn để Trình quay số mặc định sử dụng.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-06-18 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-06-18 UTC."],[],[],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."]]