How nkh-lab/aosp-ncar-vehicle-hal works
Project type and purpose
• This is an Android-based Vehicle Hardware Abstraction Layer (VHAL) example project for AOSP.
• It provides a dummy implementation of Google’s SYSTEM vehicle properties (HIDL v2.0) plus an extension with custom VENDOR properties (HIDL v1.0).
• The service simulates certain property values via timers or by reading Android system properties, exposing them to Car API clients over Android’s Binder IPC.
File structure
• Top level:
– 1.0/Types and build files for the VENDOR‐defined HAL interface (types.hal, Android.bp).
– README.md, vehicle-hal.mk for legacy Make-based builds.
– doc/screenshots for UI examples.
• impl/:
– Android.bp defines the HIDL service module (vendor.nlab.vehicle@1.0-service).
– sepolicy/ for SELinux rules (file_contexts + .te).
– src/:
• VehicleHalImpl.{cpp,h}: the core HIDL service implementation.
• VehicleHalClient.{cpp,h}: client‐side stub for internal calls (if any).
• VehicleService.cpp: the entry point that registers the HIDL service with init.
• hw-clients/Simulator.cpp: simulation backend that generates or updates property values.
• utils/Runnable.h: helper for threading/timers.
– vendor.nlab.vehicle@1.0-service.{rc,xml}: init and manifest entries to start the HAL service at boot.
• vehicle-hal.mk: legacy Android build integration.
README for additional insights
• Confirms separation of SYSTEM vs. VENDOR properties and simulation approach.
• Points to how consumers (e.g., CAR API Hello World app) invoke the HAL.
• Mentions related projects (AOSP manifest, device, and sample apps) but those are external.
Elements
– Client → Binder → HAL Service → Simulator/SystemProp → HAL Service → Binder → Client.
– Init → HAL Service (startup path).
– Android framework components (e.g., binder driver, init).
– HAL interface definitions vs. implementation.
– Internal simulation modules.
– External configuration source (Android system properties).