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.
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 12 ra mắt tính năng đồng thời Wi-Fi AP/AP, cho phép các thiết bị tạo 2 giao diện điểm truy cập (AP). Tính năng này cho phép các thiết bị hỗ trợ chia sẻ Internet thông qua điểm phát sóng Wi-Fi (AP mềm) đồng thời hai băng tần (DBS). Để biết thông tin chi tiết về việc hỗ trợ chia sẻ kết nối Internet qua một điểm phát sóng Wi-Fi, hãy xem phần Điểm phát sóng Wi-Fi (Soft AP).
Trang này mô tả hành vi của thiết bị khi tính năng này được bật và thông tin chi tiết về việc triển khai cho các nhà sản xuất và nhà cung cấp thiết bị.
Cách hoạt động
Khi được hỗ trợ tính năng Wi-Fi AP/AP concurrency, thiết bị có thể tạo 2 giao diện AP, ví dụ: một giao diện hoạt động trên băng tần 2, 4 GHz và một giao diện hoạt động trên băng tần 5 GHz. Sau đó, các ứng dụng có thể kết nối với từng giao diện AP.
HAL Wi-Fi tạo một giao diện bắc cầu duy nhất với 2 giao diện AP và hiển thị giao diện này cho Wi-Fi và ngăn xếp kết nối khi ngăn xếp bật AP mềm. Sau khi bật AP mềm, HAL Wi-Fi sẽ cho biết có 2 giao diện và cập nhật thông tin (chẳng hạn như kênh hoạt động, băng thông và BSSID) cho từng AP.
Để tiết kiệm năng lượng, khung sẽ tắt một AP không dùng đến (2, 4 GHz, 5 GHz hoặc 6 GHz) sau một khoảng thời gian không hoạt động. Khung này coi một AP là không hoạt động khi không có máy khách nào kết nối. Các nhà sản xuất thiết bị có thể tuỳ chỉnh khoảng thời gian không hoạt động này. Để biết thêm thông tin, hãy xem bài viết Tuỳ chỉnh khoảng thời gian không hoạt động.
Các thiết bị hỗ trợ Wi-Fi AP/AP đồng thời bằng cách sử dụng một trong các cấu hình AP mềm được bắc cầu sau đây:
Định cấu hình hai băng tần (khung hoặc trình điều khiển sẽ tự động chọn kênh)
Định cấu hình 2 kênh trên AP băng tần kép
Yêu cầu
Để triển khai tính năng đồng thời Wi-Fi AP/AP, các thiết bị phải đáp ứng những yêu cầu sau:
Vi xử lý hoặc chương trình cơ sở Wi-Fi phải hỗ trợ 2 kết nối AP đồng thời. Firmware phải hỗ trợ tất cả các tổ hợp kênh và băng tần cho cả hai kết nối. Để tránh các vấn đề về hiệu suất, bạn nên sử dụng chip Wi-Fi có khả năng DBS 2x2+2x2.
Thiết bị phải hỗ trợ các phương thức sau trong HAL của nhà cung cấp Wi-Fi:
IWifiChip.createBridgedApIface()
IWifiChip.removeIfaceInstanceFromBridgedApIface()
IWifiApIface.resetToFactoryMacAddress()
IWifiApIface.getBridgedInstances()
Triển khai
Để triển khai tính năng đồng thời AP/AP Wi-Fi, hãy làm như sau:
config_wifiBridgedSoftApSupported: Hỗ trợ nhiều AP được kết nối với nhau.
config_wifiStaWithBridgedSoftApConcurrencySupported: Hỗ trợ tính đồng thời của một trạm (STA) và nhiều AP được bắc cầu.
Đối với các thiết bị sử dụng AIDL Wi-Fi HAL hoặc HIDL Wi-Fi HAL 1.6, hãy xác định AP_BRIDGED trong tổ hợp giao diện Wi-Fi HAL. Để biết thêm thông tin chi tiết, hãy xem bài viết Tính năng đồng thời sử dụng nhiều giao diện Wi-Fi.
Định cấu hình cấu hình AP mềm được bắc cầu bằng cách gọi một trong các phương thức sau:
Đăng ký một lệnh gọi lại để lấy thông tin về các chức năng của thiết bị bằng cách sử dụng WifiManager#registerSoftApCallback. Lệnh gọi lại SoftApCallback cung cấp các phương thức sau cho cấu hình AP mềm được bắc cầu:
config_wifiFrameworkSoftApShutDownIdleInstanceInBridgedModeTimeoutMillisecond:
Khoảng thời gian chờ tắt mặc định. Chỉ hợp lệ nếu bạn bật SoftApConfiguration#setBridgedModeOpportunisticShutdownEnabled.
(Có từ phiên bản 13)
config_wifiFrameworkSoftApDisableBridgedModeShutdownIdleInstanceWhenCharging:
Cho biết có tắt bộ hẹn giờ tắt do không hoạt động khi sạc hay khô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-09-02 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-09-02 UTC."],[],[],null,["Android 12 introduces Wi-Fi AP/AP concurrency, which\nlets devices create two access point (AP) interfaces. This feature lets\ndevices support tethering through a dual band simultaneous (DBS) Wi-Fi\nhotspot (soft AP). For details on supporting tethering through a single Wi-Fi\nhotspot, see\n[Wi-Fi hotspot (Soft AP)](/docs/core/connect/wifi-softap).\n\nThis page describes the device behavior when this feature is enabled and\nimplementation details for device manufacturers and vendors.\n\nHow it works **Note:** Android 12 supports the 2.4 GHz and 5 GHz bands for Wi-Fi AP/AP concurrency. Android 13 adds support for the 6 GHz band.\n\nWhen Wi-Fi AP/AP concurrency is supported, the device can create two AP\ninterfaces, for example, one interface working on the 2.4 GHz band and one\non the 5 GHz band. Clients can then connect to each of the AP interfaces.\n\nThe Wi-Fi HAL generates a single bridged interface with the two AP\ninterfaces and exposes it to the Wi-Fi and connectivity stack when the stack\nenables a soft AP. After the soft AP is enabled, the Wi-Fi HAL indicates that\ntwo interfaces are available and updates the information\n(such as operation channel, bandwidth, and BSSID) for each AP.\n\nTo save power, the framework disables an unused AP (2.4 GHz, 5 GHz, or\n6 GHz) after a period of inactivity. The framework considers an AP to be\ninactive when no client is connected. Device manufacturers can customize the\nlength of this inactive period. For more information, see\n[Customize the inactivity period](#customize).\n\nDevices support Wi-Fi AP/AP concurrency by using one of the following\nbridged soft AP configurations:\n\n- Configuring two bands (the channel is automatically selected by the framework or the driver)\n- Configuring two channels on a dual-band AP\n\nRequirements\n\nTo implement Wi-Fi AP/AP concurrency, devices must meet the following\nrequirements:\n\n- The Wi-Fi chip or firmware must support two concurrent AP\n connections. The firmware must support all channel and band combinations\n for both connections. To avoid performance issues, we recommend using\n a 2x2+2x2 DBS capable Wi-Fi chip.\n\n- The device must support the following methods in the Wi-Fi Vendor HAL:\n\n - `IWifiChip.createBridgedApIface()`\n - `IWifiChip.removeIfaceInstanceFromBridgedApIface()`\n - `IWifiApIface.resetToFactoryMacAddress()`\n - `IWifiApIface.getBridgedInstances()`\n\nImplementation\n\nTo implement Wi-Fi AP/AP concurrency, do the following:\n\n1. Enable at least one of the following functions (disabled by default) using\n [runtime resource overlays](/docs/core/architecture/rros):\n\n - `config_wifiBridgedSoftApSupported`: Supports multiple APs that are bridged together.\n - `config_wifiStaWithBridgedSoftApConcurrencySupported`: Supports concurrency of a station (STA) and multiple bridged APs.\n2. For devices using the AIDL Wi-Fi HAL or HIDL Wi-Fi HAL 1.6,\n define `AP_BRIDGED` in the Wi-Fi HAL interface combination. For more\n details, see\n [Wi-Fi multi-interface concurrency](/docs/core/connect/wifi-hal#wifi-multiinterface-concurrency).\n\n3. Configure the bridged soft AP configuration by calling one of the following\n methods:\n\n - [`SoftApConfiguration.Builder#setBands`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Wifi/framework/java/android/net/wifi/SoftApConfiguration.java?q=%22Builder%20setBands%22)\n - [`SoftApConfiguration.Builder#setChannels`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Wifi/framework/java/android/net/wifi/SoftApConfiguration.java?q=%22Builder%20setChannels%22)\n4. Register a callback to obtain the device capabilities using\n `WifiManager#registerSoftApCallback`. The `SoftApCallback` callback\n provides the following methods for a bridged soft AP configuration:\n\n - [`SoftApCallback#onInfoChanged`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Wifi/framework/java/android/net/wifi/WifiManager.java?q=%22void%20onInfoChanged%28@NonNull%20List%22): Provides information about the running soft AP instances.\n - [`SoftApCallback#onConnectedClientsChanged`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Wifi/framework/java/android/net/wifi/WifiManager.java?q=%22onConnectedClientsChanged%28@NonNull%20SoftApInfo%22): Provides a list of connected clients for a soft AP instance.\n\nCustomize the inactivity period\n\nTo customize the length of the inactivity period, configure the following\noverlay, which is found\nin [`packages/modules/Wifi/service/ServiceWifiResources/res/values/config.xml`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Wifi/service/ServiceWifiResources/res/values/config.xml):\n\n- `config_wifiFrameworkSoftApShutDownIdleInstanceInBridgedModeTimeoutMillisecond`:\n The default shutdown timeout interval. Only valid if\n `SoftApConfiguration#setBridgedModeOpportunisticShutdownEnabled` is enabled.\n\n- (Available from 13)\n `config_wifiFrameworkSoftApDisableBridgedModeShutdownIdleInstanceWhenCharging`:\n Indicates whether to disable the inactivity shutdown timer when charging."]]