Skip to main content

Build-tree / Soong adoption

OEM programs adopt Cabin in AOSP build-tree apps — SystemUI, CarLauncher, platform media, and vendor chrome — via Soong (Android.bp), not Gradle. Gradle Maven AARs remain the path for app developers. Both paths compile the same Kotlin/Java/resources source of truth.

Alpha Soong scaffolding lives co-located with each cabin-* module (Android.bp → CabinTokens / CabinCompliance / CabinFoundation / CabinViews / CabinCompose / CabinGauges) plus root CabinAndroidLibraryDefaults. Full on-device SystemUI bar wiring remains partner-tree work; see the SystemUI sketch.

Problem statement​

If Cabin were Gradle-only:

  • SystemUI, CarLauncher, and other Android.bp targets could not depend on Cabin the way platform code depends on other android_library modules.
  • Teams would vendor JARs/AARs ad hoc, drift from source, or fork UI into the tree.
  • “Thin by design” would fail: images would pull Compose or samples just to get Views chrome.

Cabin therefore requires dual consumption: Gradle for apps, Soong for platform. See packaging and architecture.

Dual-path model​

Gradle consumersSoong / build-tree consumers
WhoApp developers, OEM feature APKs built with GradleSystemUI, CarLauncher, platform media, vendor UI in the Android tree
Buildbuild.gradle.kts → Maven AARsAndroid.bp → android_library (and related)
Depend onMaven coordinates (dev.decoupled.cabin:…, planned)Soong module names (CabinViews, …, Alpha scaffolding)
Primary UI stackCompose and/or ViewsViews-first (CabinViews + tokens + compliance)
ComposeFirst-classOptional — only if the platform app already uses Compose; not a gate for SystemUI
Sync into treeNot requiredRepo manifest project (e.g. external/cabin)
ThemingToken overlay modules / theme APIsRROs + optional token overlay bp modules

One source tree; two build graphs. No divergent “platform fork” of Cabin UI.

Views-first for build-tree​

Platform chrome is Views/XML today. Cabin’s primary build-tree surface is:

CabinTokens + CabinCompliance + CabinViews

CabinFoundation is pulled transitively by CabinViews. Never add CabinCompose or CabinGauges to SystemUI static_libs.

Compose (CabinCompose, Experimental Theme + kit scaffold) remains first-class for:

  • Gradle app developers
  • Platform apps that already ship Compose

Compose is not required to adopt Cabin in SystemUI. See views and soong.

Planned repo layout (dual build files)​

Each library module carries both Gradle and Soong metadata beside the same sources:

cabin/ # synced into Android tree via manifest
├── Android.bp # CabinAndroidLibraryDefaults only
├── cabin-tokens/
│ ├── src/main/… # shared source
│ ├── build.gradle.kts # Maven publishing (apps)
│ └── Android.bp # Soong CabinTokens (platform)
├── cabin-compliance/
│ ├── build.gradle.kts
│ └── Android.bp
├── cabin-foundation/
│ ├── build.gradle.kts
│ └── Android.bp
├── cabin-views/
│ ├── build.gradle.kts
│ └── Android.bp
├── cabin-compose/ # apps + Compose-capable platform apps
│ ├── build.gradle.kts
│ └── Android.bp
├── cabin-gauges/ # opt-in cluster; never SystemUI
│ ├── build.gradle.kts
│ └── Android.bp
├── samples/ # Gradle-oriented; not on device images
├── catalog/ # sample only — no Android.bp
├── website/
└── docs/

Illustrative tree paths after sync: external/cabin or packages/apps/Cabin (product choice).

Soong module names (Alpha scaffolding)​

Gradle moduleSoong namePlatform roleIn-repo Android.bp
cabin-tokensCabinTokensAlwayscabin-tokens/Android.bp
cabin-complianceCabinComplianceAlways with UIcabin-compliance/Android.bp
cabin-foundationCabinFoundationTransitive via Views / Composecabin-foundation/Android.bp
cabin-viewsCabinViewsPrimary for SystemUI / chromecabin-views/Android.bp
cabin-composeCabinComposeOpt-in; never required by SystemUIcabin-compose/Android.bp
cabin-gaugesCabinGaugesOpt-in; never SystemUIcabin-gauges/Android.bp

Shared defaults: root Android.bp → CabinAndroidLibraryDefaults (sdk / min sdk only — not an umbrella lib).

Hard rules:

  • CabinViews must not depend on CabinCompose (and vice versa).
  • SystemUI bp must not list CabinCompose, CabinGauges, catalog, samples, or website.
  • Upcoming Views primitives (Button, ListItem, …) stay inside CabinViews — do not invent per-widget Soong module names.
  • catalog/ has no Android.bp (sample-only).

Repo guard (no AAOS tree required):

python3 tools/check_soong_thin_deps.py

Manifest project (illustrative)​

<!-- Planned — product manifest fragment -->
<project
path="external/cabin"
name="decoupled-dev/cabin"
revision="refs/tags/cabin-x.y.z" />

Products pin a revision/tag; platform Android.bp files static_libs / libs the Soong module names above. App developers continue to use Maven without cloning the full platform tree.

In-repo Android.bp (Alpha)​

Authoritative scaffolding is the co-located module files (same srcs / res as Gradle). Condensed shape:

// Root Android.bp — defaults only (no CabinAll)
java_defaults {
name: "CabinAndroidLibraryDefaults",
sdk_version: "system_current",
min_sdk_version: "29",
}

// cabin-tokens → CabinTokens (res + Kotlin; no UI toolkit deps)
// cabin-compliance → CabinCompliance (static_libs: CabinTokens)
// cabin-views → CabinViews (static_libs: CabinTokens, CabinCompliance,
// androidx.annotation_annotation)
// cabin-compose → CabinCompose (static_libs: tokens + compliance + annotation;
// Compose runtime libs uncommented per host branch — never SystemUI)

Exact sdk_version, Kotlin flags, and Compose static_libs vary by Android branch — see soong.

SystemUI dependency (thin)​

Copy from the sketch sketches/systemui-cabin/:

// Fragment for host SystemUI / chrome Android.bp
static_libs: [
"CabinTokens",
"CabinCompliance",
"CabinViews",
// Do NOT add CabinCompose, catalog, or samples
],

Per-target guidance​

SystemUI / status + system bars​

  • Depend on CabinTokens, CabinCompliance, CabinViews only.
  • Prefer Cabin status/system bar components and slots (system bars, status bars).
  • Brand with RROs / token overlays — not forks.
  • Keep compliance host at a system root so gated interactions are consistent.

CarLauncher​

  • Same thin Views deps for chrome and launcher surfaces built as Views.
  • If a launcher subtree is already Compose, CabinCompose may be added locally to that module — still keep SystemUI free of Compose.

Platform media​

  • Choose stack per existing app: Views → CabinViews; Compose → CabinCompose.
  • Share tokens/compliance either way; do not duplicate restriction logic.
  • Media domain contracts: media.

OEM theming on platform​

MechanismUse
Runtime Resource Overlays (RROs)Remap theme attributes / resources on device images without editing Cabin sources
Token overlay bp moduleOptional OemCabinTokens (planned) that depends on CabinTokens and supplies brand mappings
Policy overlayTighten Restriction Engine baselines in product config (compliance)

Do not remap safety semantic colors for decoration (tokens). Extension stays in product modules (extension model).

Prebuilts (secondary)​

Some vendor partitions cannot sync full source. Cabin allows android_library_import of published AARs as a secondary path:

// Planned — constrained vendor use only
android_library_import {
name: "CabinViews-prebuilt",
aars: ["prebuilts/CabinViews.aar"],
}

Prefer source-in-tree for SystemUI and other privileged chrome so platform branches can patch, overlay, and debug with the rest of the image. Prebuilts must still obey thin-dep rules (no Compose smuggled into SystemUI).

Anti-bloat rules (platform images)​

  1. SystemUI bp lists only tokens + compliance + views.
  2. Never install catalog, samples, or website packages on user/system images.
  3. Do not create an umbrella CabinAll Soong module for platform.
  4. Compose stays opt-in per app module.
  5. Prefer RROs over copying Cabin res into vendor overlays that drift forever.

Relation to car-ui-lib and Car APIs​

Platform teams may already consume Android Automotive libraries such as car-ui-lib (and Car framework APIs) through Soong. Cabin’s consumption shape is intentionally familiar: library modules in the tree, thin static_libs, RRO-friendly resources.

Cabin is not a claim to replace Car framework APIs or to supersede car-ui-lib as a policy. Cabin is an open design language + dual-stack UI kit (tokens, compliance, Compose + Views) that products can adopt beside existing Car APIs. Map CarUxRestrictions (and related signals) into Cabin’s Restriction Engine adapters — do not reimplement vehicle services inside Cabin.

Checklist​

  • Manifest pins Cabin revision into the tree
  • SystemUI depends on Views path only
  • RROs / token overlays own brand
  • No catalog/samples on the image
  • Prebuilts only where source sync is impossible
  • Parity fixtures still apply when a second stack exists in apps
  • python3 tools/check_soong_thin_deps.py green in Cabin CI
  • Host bp matches systemui-cabin sketch