# dobraeuyan/android_device_qcom_msm8909-common architecture

> Architecture diagram of the GitHub repository dobraeuyan/android_device_qcom_msm8909-common, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dobraeuyan/android_device_qcom_msm8909-common
- Repository: https://github.com/dobraeuyan/android_device_qcom_msm8909-common

## Overview

This repository is a collection of Qualcomm/LineageOS device services and supporting runtimes, not one end-user application. Its main workflows expose Bluetooth, thermal, picture-adjustment, and Widevine DRM services; a separate Wi-Fi Display service discovers sinks, establishes a P2P session, and negotiates RTSP. The tree also includes vendor Bluetooth firmware/transport support, diagnostic tools, power and charger components, and compatibility shims. Evidence is limited to the supplied excerpts and source index; connections among unsampled subsystems are omitted where their callers are not shown.

Main entry points: [`bluetooth/vendor_interface.cc`](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/vendor_interface.cc) (Vendor interface), [`wfd/src/org/lineageos/wfd/WfdProviderService.java`](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/WfdProviderService.java) (WFD provider service), [`wfd/src/org/lineageos/wfd/RtspSource.java`](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/RtspSource.java) (RTSP source), [`bt-vendor/libbt-vendor/src/bt_vendor_qcom.c`](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/libbt-vendor/src/bt_vendor_qcom.c) (Qualcomm vendor driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bt["Bluetooth HAL"]
  node_bt_service["Bluetooth service<br/>[service.cpp]"]
  node_bt_hci["Bluetooth HCI<br/>[bluetooth_hci.cc]"]
  node_vendor_if["Vendor interface"]
  node_h4["H4 protocol<br/>[h4_protocol.cc]"]
  node_mct["MCT protocol<br/>[mct_protocol.cc]"]
  node_packetizer["HCI packetizer<br/>[hci_packetizer.cc]"]
  node_async_fd["Async FD watcher"]
  node_address["Bluetooth address"]
end

subgraph group_vendor["Bluetooth Vendor"]
  node_vendor_qcom["Qualcomm vendor driver<br/>[bt_vendor_qcom.c]"]
  node_rome["Rome firmware loader<br/>[hw_rome.c]"]
  node_uart["HCI UART transport<br/>[hci_uart.c]"]
  node_bthost["Bluetooth host IPC<br/>[bthost_ipc.c]"]
  node_btconfig["Bluetooth config tool<br/>[btconfig.c]"]
  node_hidl_client["HCI diagnostic client<br/>[hidl_client.cpp]"]
end

subgraph group_wfd["Wi-Fi Display"]
  node_wfd_service["WFD provider service"]
  node_discovery["P2P discovery<br/>[P2pDiscovery.java]"]
  node_session["WFD session<br/>[WfdSession.java]"]
  node_rtsp["RTSP source<br/>[RtspSource.java]"]
  node_rtsp_test["RTSP self-test<br/>[RtspSelfTest.java]"]
end

subgraph group_media["Media Services"]
  node_drm_service["Widevine DRM service<br/>[service_1_2.cpp]"]
  node_drm_factory["DRM factory proxy"]
  node_drm_plugin["DRM plugin proxy"]
  node_pa_service["Picture adjustment service<br/>[service.cpp]"]
  node_picture_adjustment["Picture adjustment HAL"]
end

subgraph group_device["Device Services"]
  node_thermal_service["Thermal service<br/>[service.cpp]"]
  node_thermal["Thermal HAL<br/>[Thermal.cpp]"]
  node_power["Power HAL<br/>[power-qcom.c]"]
  node_charger["Charger LED<br/>[charger_led.c]"]
  node_shims["Platform shims"]
end

node_framework(("Android framework"))
node_sink(("Wi-Fi Display sink"))
node_drm_delegate(("Widevine delegate"))

node_framework -->|"requests service"| node_bt_service
node_bt_service -->|"registers"| node_bt_hci
node_bt_hci -.->|"uses vendor interface"| node_vendor_if
node_vendor_if -->|"selects protocol"| node_h4
node_vendor_if -->|"selects protocol"| node_mct
node_vendor_if -->|"uses address"| node_address
node_vendor_if -.->|"uses watcher"| node_async_fd
node_h4 -.->|"uses packetizer"| node_packetizer
node_vendor_qcom -.->|"loads chipset firmware"| node_rome
node_vendor_qcom -.->|"uses transport"| node_uart
node_framework -->|"binds provider"| node_wfd_service
node_wfd_service -->|"starts discovery"| node_discovery
node_wfd_service -->|"creates session"| node_session
node_session -->|"starts source"| node_rtsp
node_rtsp -->|"negotiates RTSP"| node_sink
node_wfd_service -->|"runs self-test"| node_rtsp_test
node_rtsp_test -->|"exercises source"| node_rtsp
node_framework -->|"requests service"| node_drm_service
node_drm_service -->|"registers proxy"| node_drm_factory
node_drm_factory -->|"delegates DRM"| node_drm_delegate
node_drm_plugin -.->|"delegates plugin calls"| node_drm_delegate
node_framework -->|"requests service"| node_pa_service
node_pa_service -->|"registers HAL"| node_picture_adjustment
node_framework -->|"requests service"| node_thermal_service
node_thermal_service -->|"registers HAL"| node_thermal

click node_bt_service "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/service.cpp"
click node_bt_hci "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/bluetooth_hci.cc"
click node_vendor_if "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/vendor_interface.cc"
click node_h4 "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/h4_protocol.cc"
click node_mct "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/mct_protocol.cc"
click node_packetizer "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/hci_packetizer.cc"
click node_async_fd "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/async_fd_watcher.cc"
click node_address "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/bluetooth_address.cc"
click node_vendor_qcom "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/libbt-vendor/src/bt_vendor_qcom.c"
click node_rome "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/libbt-vendor/src/hw_rome.c"
click node_uart "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/libbt-vendor/src/hci_uart.c"
click node_bthost "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/bthost_ipc/bthost_ipc.c"
click node_btconfig "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/tools/btconfig/btconfig.c"
click node_hidl_client "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/tools/hidl_client/src/hidl_client.cpp"
click node_wfd_service "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/WfdProviderService.java"
click node_discovery "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/P2pDiscovery.java"
click node_session "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/WfdSession.java"
click node_rtsp "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/RtspSource.java"
click node_rtsp_test "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/RtspSelfTest.java"
click node_drm_service "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/drm/service_1_2.cpp"
click node_drm_factory "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/drm/WvDrmFactoryProxy.cpp"
click node_drm_plugin "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/drm/WvDrmPluginProxy.cpp"
click node_pa_service "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/livedisplay/service.cpp"
click node_picture_adjustment "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/livedisplay/PictureAdjustment.cpp"
click node_thermal_service "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/thermal/service.cpp"
click node_thermal "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/thermal/Thermal.cpp"
click node_power "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/power/power-qcom.c"
click node_charger "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/charger_led/charger_led.c"
click node_shims "https://github.com/dobraeuyan/android_device_qcom_msm8909-common/tree/lineage-17.1/shims"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bt_service,node_bt_hci,node_vendor_if,node_h4,node_mct,node_packetizer,node_async_fd,node_address toneBlue
class node_vendor_qcom,node_rome,node_uart,node_bthost,node_btconfig,node_hidl_client toneAmber
class node_wfd_service,node_discovery,node_session,node_rtsp,node_rtsp_test toneMint
class node_drm_service,node_drm_factory,node_drm_plugin,node_pa_service,node_picture_adjustment toneRose
class node_thermal_service,node_thermal,node_power,node_charger,node_shims,node_framework,node_sink,node_drm_delegate toneIndigo
```

## Components

### Bluetooth HAL

- [Bluetooth service](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/service.cpp): `bluetooth/service.cpp`
- [Bluetooth HCI](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/bluetooth_hci.cc): `bluetooth/bluetooth_hci.cc`
- [Vendor interface](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/vendor_interface.cc): `bluetooth/vendor_interface.cc`
- [H4 protocol](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/h4_protocol.cc): `bluetooth/h4_protocol.cc`
- [MCT protocol](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/mct_protocol.cc): `bluetooth/mct_protocol.cc`
- [HCI packetizer](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/hci_packetizer.cc): `bluetooth/hci_packetizer.cc`
- [Async FD watcher](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/async_fd_watcher.cc): `bluetooth/async_fd_watcher.cc`
- [Bluetooth address](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bluetooth/bluetooth_address.cc): `bluetooth/bluetooth_address.cc`

### Bluetooth Vendor

- [Qualcomm vendor driver](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/libbt-vendor/src/bt_vendor_qcom.c): `bt-vendor/libbt-vendor/src/bt_vendor_qcom.c`
- [Rome firmware loader](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/libbt-vendor/src/hw_rome.c): `bt-vendor/libbt-vendor/src/hw_rome.c`
- [HCI UART transport](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/libbt-vendor/src/hci_uart.c): `bt-vendor/libbt-vendor/src/hci_uart.c`
- [Bluetooth host IPC](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/bthost_ipc/bthost_ipc.c): `bt-vendor/bthost_ipc/bthost_ipc.c`
- [Bluetooth config tool](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/tools/btconfig/btconfig.c): `bt-vendor/tools/btconfig/btconfig.c`
- [HCI diagnostic client](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/bt-vendor/tools/hidl_client/src/hidl_client.cpp): `bt-vendor/tools/hidl_client/src/hidl_client.cpp`

### Wi-Fi Display

- [WFD provider service](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/WfdProviderService.java): `wfd/src/org/lineageos/wfd/WfdProviderService.java`
- [P2P discovery](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/P2pDiscovery.java): `wfd/src/org/lineageos/wfd/P2pDiscovery.java`
- [WFD session](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/WfdSession.java): `wfd/src/org/lineageos/wfd/WfdSession.java`
- [RTSP source](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/RtspSource.java): `wfd/src/org/lineageos/wfd/RtspSource.java`
- [RTSP self-test](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/wfd/src/org/lineageos/wfd/RtspSelfTest.java): `wfd/src/org/lineageos/wfd/RtspSelfTest.java`

### Media Services

- [Widevine DRM service](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/drm/service_1_2.cpp): `drm/service_1_2.cpp`
- [DRM factory proxy](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/drm/WvDrmFactoryProxy.cpp): `drm/WvDrmFactoryProxy.cpp`
- [DRM plugin proxy](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/drm/WvDrmPluginProxy.cpp): `drm/WvDrmPluginProxy.cpp`
- [Picture adjustment service](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/livedisplay/service.cpp): `livedisplay/service.cpp`
- [Picture adjustment HAL](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/livedisplay/PictureAdjustment.cpp): `livedisplay/PictureAdjustment.cpp`

### Device Services

- [Thermal service](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/thermal/service.cpp): `thermal/service.cpp`
- [Thermal HAL](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/thermal/Thermal.cpp): `thermal/Thermal.cpp`
- [Power HAL](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/power/power-qcom.c): `power/power-qcom.c`
- [Charger LED](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/blob/lineage-17.1/charger_led/charger_led.c): `charger_led/charger_led.c`
- [Platform shims](https://github.com/dobraeuyan/android_device_qcom_msm8909-common/tree/lineage-17.1/shims): `shims`

### Other components

- **Android framework**
- **Wi-Fi Display sink**
- **Widevine delegate**

## Connections

- Android framework → Bluetooth service: requests service (evidence: `bluetooth/service.cpp`)
- Bluetooth service → Bluetooth HCI: registers (evidence: `bluetooth/service.cpp`)
- Bluetooth HCI → Vendor interface: uses vendor interface
- Vendor interface → H4 protocol: selects protocol (evidence: `bluetooth/vendor_interface.cc`)
- Vendor interface → MCT protocol: selects protocol (evidence: `bluetooth/vendor_interface.cc`)
- Vendor interface → Bluetooth address: uses address (evidence: `bluetooth/vendor_interface.cc`)
- Vendor interface → Async FD watcher: uses watcher
- H4 protocol → HCI packetizer: uses packetizer
- Qualcomm vendor driver → Rome firmware loader: loads chipset firmware
- Qualcomm vendor driver → HCI UART transport: uses transport
- Android framework → WFD provider service: binds provider (evidence: `wfd/src/org/lineageos/wfd/WfdProviderService.java`)
- WFD provider service → P2P discovery: starts discovery (evidence: `wfd/src/org/lineageos/wfd/WfdProviderService.java`)
- WFD provider service → WFD session: creates session (evidence: `wfd/src/org/lineageos/wfd/WfdProviderService.java`)
- WFD session → RTSP source: starts source (evidence: `wfd/src/org/lineageos/wfd/WfdSession.java`)
- RTSP source → Wi-Fi Display sink: negotiates RTSP
- WFD provider service → RTSP self-test: runs self-test (evidence: `wfd/src/org/lineageos/wfd/WfdProviderService.java`)
- RTSP self-test → RTSP source: exercises source (evidence: `wfd/src/org/lineageos/wfd/RtspSelfTest.java`)
- Android framework → Widevine DRM service: requests service (evidence: `drm/service_1_2.cpp`)
- Widevine DRM service → DRM factory proxy: registers proxy (evidence: `drm/service_1_2.cpp`)
- DRM factory proxy → Widevine delegate: delegates DRM
- DRM plugin proxy → Widevine delegate: delegates plugin calls
- Android framework → Picture adjustment service: requests service (evidence: `livedisplay/service.cpp`)
- Picture adjustment service → Picture adjustment HAL: registers HAL (evidence: `livedisplay/service.cpp`)
- Android framework → Thermal service: requests service (evidence: `thermal/service.cpp`)
- Thermal service → Thermal HAL: registers HAL (evidence: `thermal/service.cpp`)
