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 tin chi tiết về kỹ thuật
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.
Sơ đồ sau đây minh hoạ các thành phần hệ thống tương tác với Trình quay số:

Hình 1. Các thành phần tương tác với Trình quay số
-
Giao diện người dùng hệ thống. Hạ thấp phương diện điều hướng để lưu trữ nút Điện thoại, nút này sẽ đăng ký ý định intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;package=com.android.car.dialer;launchFlags=0x10000000;end
.
Thao tác này sẽ bắt đầu hoạt động chính của người dùng, TelecomActivity
.
-
Trình chạy ứng dụng. Quản lý toàn bộ danh sách ứng dụng. Trình quay số khai báo TelecomActivity bằng android.intent.category.LAUNCHER
. Khi chọn ứng dụng điện thoại trong danh sách ứng dụng của trình chạy, bạn sẽ thấy TelecomActivity.
-
Tiện ích trên màn hình chính. Trong tài liệu tham khảo AOSP, không có tiện ích Home (Trang chủ). Các nhà sản xuất thiết bị gốc (OEM) nên cân nhắc việc thêm tiện ích Trang chủ cho Trình quay số để hiển thị trạng thái của điện thoại đang kết nối (cũng như các thông tin khác).
-
Trung tâm thông báo
-
Thông báo quan trọng (HUN) sẽ hiển thị cho các cuộc gọi đến. Khi Trình quay số InCallServiceImpl
nhận được cuộc gọi đến, Trình quay số sẽ đăng một HUN lên Trung tâm thông báo. Trung tâm thông báo này sẽ hiển thị thông tin chi tiết về cuộc gọi, chẳng hạn như số điện thoại hoặc thông tin liên hệ. Trình quay số cũng hiển thị hai nút hành động là Trả lời và Từ chối. Bằng cách nhấn vào nút Trả lời, cuộc gọi sẽ được trả lời và InCallServiceImpl
sẽ xử lý cuộc gọi đang hoạt động để hiển thị giao diện người dùng trong cuộc gọi của Trình quay số và đóng HUN. Khi nhấp vào HUN, trang InCall (Đang gọi) sẽ hiển thị ở chế độ toàn màn hình với các nút Answer (Trả lời) và Reject (Từ chối).
-
Thông báo xuất hiện cho các cuộc gọi nhỡ chưa đọc. Khi nhấp vào thông báo, trang Nhật ký cuộc gọi sẽ hiển thị và đánh dấu cuộc gọi nhỡ là đã đọc. Thao tác nhấn vào nút Quay lại cuộc gọi sẽ thực hiện cuộc gọi và hiển thị giao diện người dùng InCall của Trình quay số.
-
Trợ lý. Người dùng có thể yêu cầu trợ lý thực hiện cuộc gọi có thể hiển thị giao diện người dùng Trình quay số trong cuộc gọi.
-
Google Maps. Khi bạn gọi cho người bán từ Google Maps, ý định DIAL sẽ được gửi cùng với các số điện thoại bổ sung. Thao tác này sẽ khởi động trang Bàn phím quay số để quay số nhanh.
-
CarInputService. Theo dõi phím vật lý của các nút Gọi và Kết thúc cuộc gọi trên vô lăng. Nhấn vào:
-
Nút gọi trên vô lăng khi không có cuộc gọi đến sẽ gửi ý định DIAL và hiển thị trang Bàn phím quay số của Trình quay số.
-
Nút gọi trên vô lăng khi có cuộc gọi đến sẽ khiến TelecomManager trả lời cuộc gọi.
-
Nút Kết thúc cuộc gọi trên vô lăng khi có cuộc gọi đến, TelecomManager sẽ kết thúc cuộc gọi.
-
Bluetooth
-
PBAPClient. Tải danh bạ xuống từ điện thoại và ghi vào nhà cung cấp danh bạ. Đối với mỗi điện thoại được kết nối, hệ thống sẽ tạo một tài khoản có tên là địa chỉ MAC Bluetooth của thiết bị và com.android.bluetooth.pbapsink
(@string/pbap_account_type
được xác định trong packages/apps/Bluetooth
) làm loại tài khoản. Thông tin liên hệ được ghi vào trình cung cấp thông tin liên hệ được ghi bằng thông tin tài khoản và sẽ bị xoá khi điện thoại bị ngắt kết nối. PBAPClient
không tương tác trực tiếp với Trình quay số mà thay vào đó sẽ ghi danh bạ vào Nhà cung cấp danh bạ. Trình quay số
đọc danh bạ từ Trình cung cấp danh bạ.
-
HfpClientConnectionService
. Quản lý cuộc gọi qua Bluetooth thông qua HFP và báo cáo cuộc gọi cho các dịch vụ Viễn thông.
-
Viễn thông. Khung Android Telecom quản lý các cuộc gọi âm thanh và video trên thiết bị Android. Vì Trình quay số là ứng dụng điện thoại mặc định, nên ứng dụng này sẽ triển khai các API InCallService
và InCallController
sẽ liên kết hoạt động triển khai InCallService của Trình quay số để xử lý các cuộc gọi. Để biết thêm thông tin chi tiết, hãy xem phần Tạo ứng dụng điện thoại thay thế và Trở thành ứng dụng điện thoại mặc định.
-
Cài đặt hệ thống. Trình quay số theo dõi danh sách thiết bị được kết nối HFP và hiển thị thông báo lỗi khi không có điện thoại nào được kết nối với trình quay số qua Bluetooth. Trong tài liệu tham khảo AOSP, nút Kết nối với Bluetooth sẽ liên kết người dùng với trang Cài đặt Bluetooth của hệ thống để ghép nối thiết bị mới hoặc kết nối với thiết bị đã ghép nối.
-
Công cụ phân tâm người lái xe. Dịch vụ hệ thống Android này áp dụng các hạn chế về trải nghiệm người dùng dựa trên trạng thái lái xe của ô tô. Trình quay số phải thực thi tất cả các quy định hạn chế về việc gây mất tập trung khi lái xe.Để thực hiện việc này, Trình quay số phải nghe CarUXRestrictionManager và triển khai tất cả các chính sách. Trình quay số phải:
-
Kết nối với thư viện Car và lấy một thực thể của CarUXRestrictionManager.
-
Đăng ký nhận thông tin cập nhật trong danh sách CarUxRestrictions và triển khai các thông tin cập nhật đó như đã ghi nhận.
-
Đặc biệt quan trọng đối với Trình quay số:
-
Trang cài đặt được tối ưu hoá cho xe. Người dùng không thể truy cập vào trang Cài đặt trình quay số khi đang lái xe. Khi nhấn vào trình đơn Cài đặt trên thanh thao tác, một màn hình chặn sẽ xuất hiện để ngăn người dùng truy cập vào phần Cài đặt khi đang lái xe. Nếu trang Cài đặt đã hiển thị, màn hình chặn sẽ bật lên để ngăn người dùng tương tác.
-
Không thể truy cập vào phần cài đặt hệ thống khi đang lái xe. Trên trang Lỗi, khi không có thiết bị Bluetooth nào được kết nối, nút Kết nối với Bluetooth sẽ hiển thị trang cài đặt Bluetooth của hệ thống. UXR của nút này bị hạn chế hoàn toàn.
Khi đang lái xe, nếu nhấp vào nút này, một thông báo lỗi sẽ xuất hiện để thông báo cho người dùng trước tiên hãy đỗ xe rồi mới thực hiện hành động.
-
Người dùng không thể bắt đầu quy trình thêm vào mục yêu thích khi đang lái xe. Nút Thêm mục yêu thích đã bị tắt.
Luồng người dùng
Dialer Main
Dưới đây là các trang khác nhau cho Trình quay số.

Hình 2. Trang chính của Trình quay số
Xử lý cuộc gọi
Dưới đây là quy trình xử lý cuộc gọi:

Hình 3. Xử lý cuộc gọi
Thông báo
Dưới đây là các trang thông báo:

Hình 4. Thông báo
Trạng thái đang gọi
Dưới đây là luồng trang InCall:

Hình 5. Trang Trong cuộc gọi
Tìm kiếm
Các màn hình Tìm kiếm là:

Hình 6. Tìm kiếm
Cài đặt
Các tuỳ chọn Cài đặt bao gồm:

Hình 7. Cài đặt
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-07-27 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-07-27 UTC."],[],[],null,["# Technical details\n\nThe following diagram illustrates the system components that interact with Dialer:\n\n**Figure 1.** Components that interact with Dialer\n\n- **System UI.** Lower navigation facet to host the Phone button, which\n registers the `intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;package=com.android.car.dialer;launchFlags=0x10000000;end` intent.\n This starts the user's main activity, `TelecomActivity`.\n\n- **App Launcher.** Manages the entire app list. Dialer declares\n TelecomActivity with `android.intent.category.LAUNCHER`. Selecting the phone app from\n the launcher's app list displays TelecomActivity.\n\n- **Home widget.** In AOSP reference, there is no Home widget. OEMs might want to\n consider adding a Home widget for Dialer to display the state of the current connected phone (as\n well as other information).\n\n- **Notification Center**\n\n - **Heads Up Notification (HUN) is displayed for incoming calls.** When the Dialer\n `InCallServiceImpl` receives an incoming call, Dialer posts a HUN to the\n Notification center, which shows the call details, such as phone number or contact info.\n Dialer also displays two action buttons, Answer and Decline. By tapping Answer button,\n the call is answered and `InCallServiceImpl` handles the active call to show\n Dialer's in call UI and dismisses the HUN. Clicking on the HUN displays the fullscreen\n InCall page with the Answer and Reject buttons.\n\n - **Notification appears for unread missed calls.** Clicking on the\n notification displays the Call History page and marks missed calls as read. Tapping the\n Call Back button places a call and displays the Dialer's InCall user interface.\n\n- **Assistant.** Users can ask an assistant to make a call that may display the\n Dialer InCall user interface.\n\n- **Google Maps.**Calling a merchant from Google Maps sends the DIAL\n intent with extras of phone numbers which will start Dialpad page for quick dialing.\n\n- **CarInputService.**Monitors the physical key of the Call and End Call\n buttons on the steering wheel. Pressing the:\n\n - Call button from the steering wheel when there is no incoming call sends the DIAL\n intent and displays the Dialpad page of Dialer.\n\n - Call button from the steering wheel when there is an incoming call causes the\n TelecomManager to answer the call.\n\n - End Call button from the steering wheel when there is an incoming call, the\n TelecomManager ends the call.\n\n- **Bluetooth**\n\n - **PBAPClient.** Downloads contacts from a phone and writes to the\n contacts provider. For each phone connected, an account is created with the device's\n Bluetooth MAC address as the account name and `com.android.bluetooth.pbapsink`\n (`@string/pbap_account_type` defined in `packages/apps/Bluetooth`) as\n the account type. Contacts written to the contacts provider are written with the account\n information and are cleared when the phone is disconnected. `PBAPClient` doesn't\n interact directly with Dialer but instead writes contacts to the Contacts Provider. Dialer\n reads the contacts from the Contacts Provider.\n\n - **`HfpClientConnectionService`.** Manages the Bluetooth call\n through HFP and reports the call to the Telecom services.\n\n- **Telecom.** The Android Telecom framework manages audio and video calls on an\n Android device. Since Dialer is the default phone app, it implements the\n [InCallService](https://developer.android.com/reference/android/telecom/InCallService.html)\n APIs and `InCallController` will bind the Dialer's InCallService implementation to\n handle calls. For more details, see\n [Create\n a replacement phone app](https://developer.android.com/guide/topics/connectivity/telecom#replacePhoneApp) and\n [Becoming\n the Default Phone App](https://developer.android.com/reference/android/telecom/InCallService.html#becoming-the-default-phone-app).\n\n- **System Settings.** Dialer monitors the HFP-connected device list and displays\n an error message when no phones are connected to dialer through Bluetooth. In the AOSP\n reference, the Connect to Bluetooth button links users to the system Bluetooth Settings\n page to pair a new device or to connect to a paired device.\n\n- **Driver Distraction Engine.** This Android system service imposes UX\n restrictions based on the driving state of the car. Dialer must execute all UX driving\n distraction restrictions.To do so, Dialer must listen to the\n [CarUXRestrictionManager](https://developer.android.com/reference/android/car/drivingstate/CarUxRestrictionsManager)\n and implement all policies. Dialer must:\n\n - Connect to the [Car](https://developer.android.com/reference/android/car/Car)\n library and obtain an instance of\n [CarUXRestrictionManager](https://developer.android.com/reference/android/car/drivingstate/CarUxRestrictionsManager).\n\n - Subscribe to updates in the list of\n [CarUxRestrictions](https://developer.android.com/reference/android/car/drivingstate/CarUxRestrictions)\n and implement them as documented.\n\n - Of particular importance to Dialer:\n\n - **Settings page is vehicle-optimized.** User could not access the\n Dialer Settings page when driving. By tapping on the Settings menu from the action bar,\n a blocking screen is displayed to prevent the user from accessing Settings while\n driving. If the Settings page is already displayed, the blocking screen will pop up to\n stop the user interaction.\n\n - **System settings cannot be accessed while driving.** On the Error page,\n when no Bluetooth devices are connected, a Connect to Bluetooth button displays the\n system Bluetooth settings page. The UXR of this button is fully restricted.\n While driving, clicking on this button displays an error message to inform the\n user to park the car first and then perform the action.\n\n - **User cannot start the add-to-favorite flow while driving.** The Add a\n Favorite button is disabled.\n\nUser flows\n----------\n\n### Dialer Main\n\nThe different pages for Dialer are provided below.\n\n**Figure 2.** Main Dialer page\n\n### Call handling\n\nThe call handing process flow is presented below:\n\n**Figure 3.** Call handling\n\n### Notifications\n\nThe different notifications pages are displayed below:\n\n**Figure 4.** Notifications\n\n### InCall status\n\nThe InCall page flow is shown below:\n\n**Figure 5.** InCall page\n\n### Search\n\nThe Search displays are:\n\n**Figure 6.** Search\n\n### Settings\n\nThe Settings options are:\n\n**Figure 7.** Settings"]]