ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
บลูทูธ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
โมดูลบลูทูธเป็นโมดูล Mainline ที่ไม่บังคับซึ่งเปิดตัวใน Android 13
ใน Android 16 ขึ้นไป โมดูลจะอัปเดตได้และมีสแต็กโฮสต์บลูทูธแบบดูอัลโหมดที่ได้รับการรับรองอย่างเต็มรูปแบบ ซึ่งช่วยให้อุปกรณ์ Android รองรับทั้งฟังก์ชันบลูทูธแบบคลาสสิกและบลูทูธพลังงานต่ำ (BLE)
แรงจูงใจหลักในการสร้างโมดูล Bluetooth คือการมอบประสบการณ์การใช้งาน Bluetooth ที่มีคุณภาพสูงขึ้น
ให้แก่ผู้ผลิตอุปกรณ์ ผู้ใช้ และนักพัฒนาแอป โดยการดำเนินการต่อไปนี้
เผยแพร่การอัปเดตได้เร็วขึ้นด้วยฟีเจอร์ใหม่ การแก้ไขข้อบกพร่อง การปรับปรุงการทำงานร่วมกัน และแพตช์ความปลอดภัยอย่างรวดเร็วและเป็นประจำ โดยไม่ขึ้นอยู่กับรอบการเผยแพร่ระบบปฏิบัติการ Android
ลดการกระจายตัวและสร้างประสบการณ์การใช้งานที่สอดคล้องกันสำหรับ
ระบบนิเวศ Android ทั้งหมด
ปรับปรุงการพัฒนาของพาร์ทเนอร์โดยการส่งมอบโมดูล Mainline ของบลูทูธที่ผ่านการตรวจสอบของ Android และหลีกเลี่ยงการรีเบสบ่อยๆ เพื่อลดค่าใช้จ่ายในการพัฒนาและการทดสอบ
โมดูลบลูทูธใช้รูปแบบ APEX com.google.android.bt
แพ็กเกจประกอบด้วย APK ของบลูทูธที่กำหนดไว้ใน
packages/modules/Bluetooth/android/app
, ไลบรารีในตัว
libbluetooth_jni.so
, API ภายใต้
packages/modules/Bluetooth/framework/java/android/bluetooth
และอินเทอร์เฟซ HIDL
ขอบเขตของโมดูล
แผนภาพต่อไปนี้แสดงขอบเขตของโมดูลบลูทูธ
รูปที่ 1 ขอบเขตโมดูลบลูทูธ
การขึ้นต่อกัน
โมดูลบลูทูธมีการขึ้นต่อกันกับรายการต่อไปนี้
- การใช้งาน API ขาเข้าและขาออก
@hide
- ต้องมีไลบรารีสำหรับ APK ของบลูทูธ (
libbluetooth.so
)
- การติดตั้งใช้งาน HAL จากผู้ให้บริการชิปเซ็ตบลูทูธ
- เฟรมเวิร์กเสียงของ Android สำหรับการสตรีมเสียง
- การโทรศัพท์ Android สำหรับการโทร
- การปล่อยสัญญาณอินเทอร์เน็ตของ Android สำหรับเครือข่ายส่วนบุคคล (PAN) ของบลูทูธ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","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-07-27 UTC"],[],[],null,["# Bluetooth\n\nThe Bluetooth module is an optional Mainline module introduced in Android 13.\nIn Android 16 and higher, the module is updatable and contains a fully\ncertified dual-mode Bluetooth host stack, enabling Android devices to support\nboth classic Bluetooth and Bluetooth Low Energy (BLE) functionalities.\n\nThe primary motivation for the Bluetooth module is to provide a higher-quality\nBluetooth experience to device manufacturers, users, and app developers by:\n\n- **Delivering faster updates** with new features, bug fixes, interoperability\n enhancements, and security patches quickly and regularly, independently of\n the Android OS release cycle.\n\n- **Reducing fragmentation** and creating a consistent experience for the\n entire Android ecosystem.\n\n- **Streamlining partner development** by delivering Android-validated\n Bluetooth Mainline modules and avoiding frequent rebasing, thus reducing\n development and testing overhead.\n\nPackage format\n--------------\n\nThe Bluetooth module uses the [APEX](/docs/core/ota/apex) format. The `com.google.android.bt`\npackage contains the Bluetooth APK defined in\n`packages/modules/Bluetooth/android/app`, the built-in library\n`libbluetooth_jni.so`, the APIs under\n`packages/modules/Bluetooth/framework/java/android/bluetooth`, and the HIDL\ninterfaces.\n\nModule boundary\n---------------\n\nThe following diagram shows the Bluetooth module boundary:\n\n**Figure 1**. Bluetooth module boundary.\n\nDependencies\n------------\n\nThe Bluetooth module has dependencies on the following:\n\n- Incoming and outgoing `@hide` API usages\n- Library required for the Bluetooth APK (`libbluetooth.so`).\n- HAL implementation from the Bluetooth chipset provider\n- Android Audio Framework for audio streaming\n- Android telephony for phone calls\n- Android tethering for Bluetooth Personal Area Network (PAN)"]]