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.
Ứng dụng đài phát thanh Java mẫu (packages/apps/Car/Radio) đóng vai trò là bản triển khai tham chiếu. Khi dịch vụ ứng dụng khởi động, dịch vụ này sẽ yêu cầu Trình quản lý đài phát thanh mở Trình điều chỉnh đài phát thanh. Sau đó, ứng dụng có thể gửi yêu cầu đến Bộ thu sóng phát thanh, chẳng hạn như điều chỉnh một đài phát thanh, tần số cụ thể hoặc tìm đài phát thanh tiếp theo có sẵn. Ứng dụng nhận thông tin cập nhật từ Trình quản lý đài phát thanh và Bộ thu sóng đài phát thanh trong phần Đài phát thanh, chẳng hạn như thông tin chương trình hiện tại, danh sách chương trình phát thanh, cấu hình và các tham số do nhà cung cấp xác định. Ứng dụng Đài phát thanh tham chiếu chỉ hỗ trợ đài AM và FM. OEM có thể sửa đổi hoặc thay thế ứng dụng Radio theo ý muốn.
Trình quản lý đài phát
Khi ứng dụng yêu cầu Trình quản lý đài phát thanh mở một bộ chỉnh âm, Trình quản lý đài phát thanh (frameworks/base/core/java/android/hardware/radio/RadioManager.java) sẽ yêu cầu Dịch vụ phát thanh truyền tin (BRS) mở một phiên Bộ chỉnh âm, sau đó gói phiên đó trong một Bộ chỉnh âm đài phát thanh (frameworks/base/core/java/android/hardware/radio/RadioTuner.java) được trả về cho ứng dụng. Bộ chỉnh âm đài phát thanh xác định các API (chẳng hạn như điều chỉnh, bước và huỷ) có thể được gọi từ các ứng dụng đài phát thanh và gửi yêu cầu đến BRS. Các phương thức gọi lại (RadioTuner.Callback) được xác định trong Trình điều chỉnh đài phát thanh gửi thông tin cập nhật về HAL đài phát thanh truyền tin, chẳng hạn như thông tin chương trình hiện tại, danh sách chương trình và các tham số do nhà cung cấp xác định, từ BRS đến các ứng dụng.
Dịch vụ phát thanh truyền hình
Dịch vụ phát thanh truyền tin (frameworks/base/services/core/java/com/android/server/broadcastradio) là dịch vụ ứng dụng cho Broadcast Radio HAL. BRS điều phối nhiều Trình quản lý đài phát thanh bằng Broadcast Radio HAL. BRS hỗ trợ ngôn ngữ định nghĩa giao diện HAL (HIDL) và ngôn ngữ định nghĩa giao diện Android (AIDL) phát sóng HAL radio. BRS liên kết với AIDL HAL khi có bất kỳ dịch vụ AIDL HAL nào; nếu không, dịch vụ sẽ liên kết với HIDL HAL. BRS tạo một Mô-đun đài phát thanh cho mỗi thực thể HAL có sẵn (chẳng hạn như AM, FM và DAB).
Mỗi Trình quản lý đài phát thanh có thể yêu cầu BRS tạo một phiên bộ thu trên Mô-đun đài phát thanh tương ứng, dựa trên loại đài phát thanh. Mỗi phiên bộ chỉnh âm có thể gọi các phương thức, chẳng hạn như điều chỉnh, bước và huỷ (được xác định trong giao diện HAL) để thực hiện các thao tác trên thực thể HAL phát thanh tương ứng. Khi một phiên bộ thu nhận lệnh gọi lại từ thực thể HAL trong bản cập nhật HAL, chẳng hạn như thông tin chương trình hiện tại, danh sách chương trình, cờ cấu hình và tham số của nhà cung cấp, lệnh gọi lại về bản cập nhật sẽ được gửi đến tất cả Bộ thu sóng liên kết với cùng một Mô-đun só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-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,["# Overview\n\nThe broadcast radio stack consists of the components illustrated in Figure 1.\n**Figure 1.** Broadcast Radio architecture.\n\nRadio reference app\n-------------------\n\nFor details about how to implement radio control, see\n[Radio control implementation](/docs/automotive/radio/radio-control-implementation).\n\nA sample Java radio app (`packages/apps/Car/Radio`) serves as a reference\nimplementation. When the app service starts, it requests Radio Manager to open a Radio Tuner. Then,\nthe app can send requests to the Radio Tuner, such as tuning to a specific radio station, frequency,\nor to seek the next available radio station. The app receives updates from the Radio Manager and\nRadio Tuner in Radio, such as current program information, radio program lists, configurations, and\nvendor-defined parameters. The reference Radio app only supports AM and FM radio. OEMs can modify or\nreplace the Radio app as desired.\n\nRadio Manager\n-------------\n\nWhen the app requests Radio Manager to open a tuner, the Radio Manager\n(`frameworks/base/core/java/android/hardware/radio/RadioManager.java`) requests the\nBroadcast Radio Service (BRS) to open a Tuner session and then wraps the session in a Radio Tuner\n(`frameworks/base/core/java/android/hardware/radio/RadioTuner.java`), which is returned\nto the app.\n\nThe Radio Tuner defines APIs (such as tune, step, and cancel) that can be called from radio apps\nand send requests to BRS. Callback methods (`RadioTuner.Callback`) defined in Radio\nTuner send updates about the broadcast radio HAL, such as current program information, program\nlists, and vendor-defined parameters, from the BRS to apps.\n\nBroadcast Radio Service\n-----------------------\n\nThe Broadcast Radio Service\n(`frameworks/base/services/core/java/com/android/server/broadcastradio`) is the client\nservice for Broadcast Radio HAL. The BRS coordinates multiple Radio Managers with Broadcast Radio\nHALs. The BRS supports\n[HAL interface definition language (HIDL)](/docs/core/architecture/hidl) and\n[Android interface definition language (AIDL)](/docs/core/architecture/aidl) broadcast\nradio HALs. The BRS links to the AIDL HAL when any AIDL HAL service exists;\notherwise, the service links to the HIDL HAL. The BRS creates a Radio Module\nfor each available HAL instance (such as AM, FM, and DAB).\n\nEach Radio Manager can request the BRS to create a tuner session on the\ncorresponding Radio Module, based on the type of radio. Each tuner session can call methods, such\nas tune, step, and cancel (defined in HAL interfaces) to perform operations on the\ncorresponding broadcast radio HAL instance. When one tuner session receives a callback from the HAL\ninstance on a HAL update, such as current program info, program list, configuration flags and,\nvendor parameters, callbacks about the update are sent to all Radio Tuners linked to the same\nRadio Module.\n\nBroadcast Radio HAL\n-------------------\n\n| In Android 13 and lower, versions of the BRS are provided in HIDL and AIDL. New features are added **only** to releases of Android 14 and higher.\n\nTo learn more about the HIDL and AIDL interfaces of broadcast radio and the differences between\nthe two, see\n[Broadcast Radio HAL interface](/docs/automotive/radio/broadcast-radio-hal)."]]