# lineageos/android_vendor_lineage architecture

> Architecture diagram of the GitHub repository lineageos/android_vendor_lineage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lineageos/android_vendor_lineage
- Repository: https://github.com/lineageos/android_vendor_lineage

## Overview

##### Main Components

a. Build System Layer
- Build/ directory components including core, soong, and target
- Tools/ and vars/ directories for build configuration
- Release/ directory for release management

b. Device Support Layer
- Overlay/ directory structure for device-specific customizations
- Prebuilt/ components
- Vars/devices connection to specific device support

c. System Customization Layer
- Config/ directory containing various configuration types
- Bootanimation/ and charger/ customizations
- Spn/ (Service Provider Name) configurations

##### Component Relationships

- Build System → Device Support (compilation flow)
- Device Support → System Customization (device-specific modifications)
- Config → Overlay (system modifications)
- Release → Build System (release management)

##### Architectural Patterns

Following patterns:
- Layered architecture (build → device → customization)
- Modular device support (overlay system)
- Configuration management (config files)
- Build automation (workflows)

##### Key Technologies

- Android build system (soong)
- Device Tree Overlays (RRO/OMS)
- Build configuration (Android.bp, Android.mk)
- Release management tools

##### Implementation Details

- Component name
- Key subcomponents
- Primary responsibilities
- File types handled

##### Additional Elements

Include:
- GitHub workflow integration (.github/workflows)
- Build artifact generation paths
- Configuration inheritance flows
- Device-specific customization paths

This system design should help developers understand how LineageOS components interact to create a custom Android distribution that can be built for multiple device targets while maintaining consistent customization capabilities.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef build fill:#3498db,stroke:#2980b9,color:white
    classDef device fill:#2ecc71,stroke:#27ae60,color:white
    classDef custom fill:#e67e22,stroke:#d35400,color:white
    classDef release fill:#9b59b6,stroke:#8e44ad,color:white
    classDef support fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Build System Layer
    subgraph BuildSystem
        CoreBuild["Core Build System"]:::build
        SoongBuild["Soong Build System"]:::build
        BuildTargets["Build Targets"]:::build
        BuildTools["Build Tools"]:::build
        BuildTasks["Build Tasks"]:::build
    end

    %% Device Support Layer
    subgraph DeviceSupport
        DeviceVars["Device Variables"]:::device
        OverlaySys["Overlay System"]:::device
        Prebuilt["Prebuilt Components"]:::device
        DeviceConfigs["Device-Specific Configs"]:::device
    end

    %% System Customization Layer
    subgraph SystemCustomization
        SysConfig["System Configurations"]:::custom
        BootAnim["Boot Animation"]:::custom
        ChargerCustom["Charger Customization"]:::custom
        SPNConfig["SPN Configuration"]:::custom
    end

    %% Release Management
    subgraph ReleaseManagement
        ReleaseConfig["Release Configs"]:::release
        ReleaseFlags["Release Flags"]:::release
        BuildConfig["Build Configurations"]:::release
    end

    %% CI/CD Integration
    subgraph CICD
        GHWorkflows["GitHub Workflows"]:::support
    end

    %% Device Overlays
    subgraph DeviceOverlays
        RROPackages["RRO Packages"]:::device
        NonRROOverlays["Non-RRO Overlays"]:::device
        TVOverlays["TV-Specific Overlays"]:::device
        WiFiOverlays["WiFi-Only Overlays"]:::device
    end

    %% Relationships
    BuildSystem --> DeviceSupport
    DeviceSupport --> SystemCustomization
    DeviceSupport --> DeviceOverlays
    ReleaseManagement --> BuildSystem
    CICD --> BuildSystem

    %% Click Events
    click CoreBuild "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/build/core/"
    click SoongBuild "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/build/soong/"
    click BuildTargets "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/build/target/"
    click BuildTools "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/build/tools/"
    click BuildTasks "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/build/tasks/"
    click DeviceVars "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/vars/devices/"
    click OverlaySys "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/overlay/common/"
    click Prebuilt "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/prebuilt/common/"
    click DeviceConfigs "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/overlay/common/frameworks/base/core/res/"
    click SysConfig "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/config/"
    click BootAnim "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/bootanimation/"
    click ChargerCustom "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/charger/"
    click SPNConfig "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/spn/"
    click ReleaseConfig "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/release/"
    click ReleaseFlags "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/release/flag_values/"
    click BuildConfig "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/release/build_config/"
    click GHWorkflows "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/.github/workflows/"
    click RROPackages "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/overlay/rro_packages/"
    click NonRROOverlays "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/overlay/no-rro/"
    click TVOverlays "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/overlay/tv/"
    click WiFiOverlays "https://github.com/LineageOS/android_vendor_lineage/tree/lineage-22.1/overlay/wifionly/"

    %% Legend
    subgraph Legend
        BuildL["Build System"]:::build
        DeviceL["Device Support"]:::device
        CustomL["Customization"]:::custom
        ReleaseL["Release Management"]:::release
        SupportL["Support Tools"]:::support
    end
```
