Bluetooth Overview - AOSP11

此文描述的是 AOSP11(Android R) 版本的藍(lán)牙內(nèi)容。

1. AOSP11 Bluetooth Relative Repos

Repos Documents Installed Product
packages/apps/Settings/ src/com/android/settings/bluetooth/ Settings.apk
src/com/android/settings/development/bluetooth/ Settings.apk
frameworks/base/ packages/SettingsLib/src/com/android/settingslib/bluetooth/ ??
core/java/android/bluetooth/ framework.jar
services/core/java/com/android/server/ services.jar
packages/apps/Bluetooth/ * (exclude jni/) Bluetooth.apk
jni/ libbluetooth_jni.so
system/bt/ * libbluetooth.so
hardware/interfaces/ bluetooth/ ??
  1. packages/apps/Settings/ 包含藍(lán)牙的設(shè)置和開發(fā)者選項;
  2. frameworks/base/ 包含藍(lán)牙的 API封裝(供設(shè)置等系統(tǒng)應(yīng)用使用)、標(biāo)準(zhǔn)API、system_server中運(yùn)行的常駐藍(lán)牙服務(wù);
  3. packages/apps/Bluetooth/ 包含藍(lán)牙的核心服務(wù)和各種profile服務(wù)等;
  4. system/bt/ 包含藍(lán)牙的協(xié)議棧實現(xiàn)、apex、binder接口定義(AIDL);
  5. hardware/interfaces/ 包含藍(lán)牙的 HAL 層接口定義(AIDL/HIDL)。

2. AOSP11 Bluetooth Architecture

AOSP11 Bluetooth Architecture
  1. 紫色框是進(jìn)程;
  2. 黑色框是模塊(Android 上可獨(dú)立修改安裝的包)。
  3. 由于藍(lán)牙進(jìn)程(com.android.bluetooth)僅在藍(lán)牙開啟時運(yùn)行,因此,在藍(lán)牙進(jìn)程未啟動時,在系統(tǒng)中需要有一個常駐模塊接收并處理 enable bluetooth 操作,該模塊即為 system_server 進(jìn)程中的 BluetoothManagerService。

2.1 AOSP11 Bluetooth Stack Architecture

AOSP11 Bluetooth Stack Architecture

注意:以上名稱主要來自AOSP的目錄名稱,不確保具備通用性。

  1. BTIF:Bluetooth Interface,表示 JNI 與 BTA 之間的接口;
  2. BTA:Bluetooth Application,表示藍(lán)牙應(yīng)用(如 profile或 與profile相關(guān))的實現(xiàn);
  3. STACK:Bluetooth Stack,表示藍(lán)牙核心協(xié)議棧的 Protocol 的實現(xiàn)(可能包含部分 Profile 的實現(xiàn));
  4. BTU:Bluetooth Upper,表示 HCI 的上層,是 HCI 與 Stack 之間的接口,主要是對 HCI 操作的封裝;
  5. HCI:Host Controller Interface,表示藍(lán)牙 Core Spec 描述的 HCI 在AOSP中的實現(xiàn)。

3. AOSP11 Bluetooth Code Description

3.1 system/bt/

Part of Bluetooth Code Description

4 AOSP11 Bluetooth Initialization Arch

Bluetooth initialization - enable in Settings & System_server process
?? Bluetooth initialization - Bluetooth process Initialization - Framework(Java)
?? Bluetooth initialization - Bluetooth process Initialization - Native(Cpp)
Bluetooth initialization - enable in Bluetooth process

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容