← Back to list

AAOS Architecture Explained for Android Engineers

The transition from mobile app development to Embedded Android is a paradigm shift. When you move from building standard Android…

Santosh Mehta · 2026-04-12 16:54 · 29 claps · 6.5 min read paywalled
#aao #android-automotive #android #kotlin #android-development
Open on Medium ↗
Wiki topics: 📱 · Mobile Development 🏛️ · Architecture

AAOS Architecture Explained for Android Engineers

The transition from mobile app development to Embedded Android is a paradigm shift. When you move from building standard Android applications to working on Android Automotive OS (AAOS), you are no longer just interacting with a device in someone’s pocket; you are building the software brain of a two-ton moving machine.

For an Android Platform Engineer, understanding AAOS requires dropping the mobile-first mindset and embracing system-level engineering. AAOS is not Android Auto (which is merely a projection protocol running over USB/Wi-Fi). AAOS is a full-stack, native operating system running directly on the vehicle’s In-Vehicle Infotainment (IVI) hardware.

In this deep dive, we will tear down the AAOS architecture, explore how data flows from a hardware ECU to a user-facing app, and examine the internal mechanics of the Android Framework layers that make a car, well, a car.

The AAOS Architecture Breakdown

At its core, AAOS is built entirely on top of the AOSP (Android Open Source Project) foundation. It introduces specialized automotive layers designed to interact safely and securely with the vehicle network.

Here is a high-level ASCII map of the AAOS stack:

+-------------------------------------------------------------------+
|                        Apps Layer                                 |
|      (OEM System Apps, Media, Navigation, 3rd Party Apps)         |
+-------------------------------------------------------------------+
|                        Car API                                    |
|                   (android.car.* packages)                        |
+-------------------------------------------------------------------+
|                                                                   |
|                        Android Framework                          |
|    (ActivityManager, AudioService, DisplayManager, etc.)          |
|                                                                   |
|    +---------------------------------------------------------+    |
|    |                   Car Service                           |    |
|    | (CarPropertyService, CarPowerManagement, CarAudio...)   |    |
|    +---------------------------------------------------------+    |
+-------------------------------------------------------------------+
|                 System API / Binder IPC / AIDL                    |
+-------------------------------------------------------------------+
|                        Vehicle HAL (VHAL)                         |
|               (Hardware Abstraction Layer - AIDL/HIDL)            |
+-------------------------------------------------------------------+
|                     Vehicle Network / Gateway                     |
|                      (CAN, LIN, Automotive Ethernet)              |
+-------------------------------------------------------------------+
|                   Electronic Control Units (ECUs)                 |
|               (Engine, HVAC, Body Control, Telematics)            |
+-------------------------------------------------------------------+

Let’s dissect these layers from the top down.

1. The Apps Layer (Car Apps)

Unlike mobile Android, where most apps are user-installed, AAOS relies heavily on privileged system apps provided by the OEM. These include the Launcher, HVAC control, Settings, and System UI. Apps built for AAOS must adhere to strict driver distraction guidelines.

2. The Car API (android.car.*)

This is the SDK exposed to developers. It provides managers (e.g., CarPropertyManager, CarSensorManager, CarAudioManager) that act as proxies to the underlying system services. When an app wants to change the cabin temperature, it doesn't talk to the framework directly; it uses the Car API.

3. Car Service (The Brain)

The CarService is the central nervous system of AAOS. While standard system services (like ActivityManager) live inside the SystemServer process, CarService runs as its own persistent privileged process (com.android.car). A bridge service called CarServiceHelperService lives inside SystemServer to grant CarService the necessary framework hooks and permissions.

4. Vehicle HAL (VHAL)

The Vehicle HAL is where Android ends and the OEM’s hardware begins. It is the standardized interface that abstracts the chaotic world of automotive network protocols (CAN bus, LIN, Ethernet) into a uniform, property-based model that Android can understand.

5. ECUs and Hardware Communication

Electronic Control Units (ECUs) govern physical hardware (e.g., brakes, windows, sensors). The vehicle gateway microcontroller translates raw CAN/LIN frames into a format (often via SPI or an internal IPC) that the VHAL running on the main SoC (System on Chip) can digest.

End-to-End Data Flow: Reading Vehicle Speed

To understand how these layers interact, let’s trace a signal. How does a speedometer app in AAOS know how fast the car is moving?

[Wheel Sensor ECU] 
       | (Raw voltage)
       v
[Powertrain Gateway] 
       | (CAN frame: 0x1A2 [00 1E 00 ...])
       v
[Vehicle Gateway MCU] 
       | (Translates CAN to SPI/IPC payload)
       v
[Vehicle HAL (VHAL)] 
       | (Maps payload to VehicleProperty: PERF_VEHICLE_SPEED)
       v
[CarPropertyService (Car Service)] 
       | (Binder Callback across processes)
       v
[CarPropertyManager (Car API)] 
       | (Dispatches to registered listeners)
       v
[Android Speedometer App]

The Code: Listening to the VHAL in an App

From an application engineer’s perspective, reading the speed looks like this:

Car car = Car.createCar(context);
CarPropertyManager carPropertyManager = 
    (CarPropertyManager) car.getCarManager(Car.PROPERTY_SERVICE);

carPropertyManager.registerCallback(new CarPropertyManager.CarPropertyEventCallback() {
    @Override
    public void onChangeEvent(CarPropertyValue value) {
        if (value.getPropertyId() == VehiclePropertyIds.PERF_VEHICLE_SPEED) {
            float speedMetersPerSec = (Float) value.getValue();
            Log.d("VehicleSpeed", "Current speed: " + speedMetersPerSec + " m/s");
        }
    }

    @Override
    public void onErrorEvent(int propertyId, int zone) {
        Log.e("VehicleSpeed", "Error reading property: " + propertyId);
    }
}, VehiclePropertyIds.PERF_VEHICLE_SPEED, CarPropertyManager.SENSOR_RATE_NORMAL);

Deep Dive: Car Service and SystemServer Integration

The Car Service is a massive component containing dozens of sub-services. Some of the most critical include:

  • CarPropertyService: The router for all VHAL properties. It manages who can read/write which property.
  • CarPowerManagementService: Automotive power states are highly complex (e.g., Garage Mode, Deep Sleep, Suspend-to-RAM). This service coordinates with the VHAL to ensure the system gracefully suspends and resumes without draining the 12V battery.
  • CarUxRestrictionsService: Listens to driving state (Parked, Moving) and broadcasts restrictions to the UI (e.g., disabling keyboard input while moving).

The Vehicle Property Model

The communication between Car Service and VHAL is entirely property-based. A property is defined by:

  1. Property ID: An integer identifier (e.g., INFO_MAKE, HVAC_TEMPERATURE_SET).
  2. Access Mode: READ, WRITE, or READ_WRITE.
  3. Change Mode: STATIC (never changes, like VIN), ON_CHANGE (triggers only when the value shifts, like gear selection), or CONTINUOUS (streams at a specific Hz, like vehicle speed).
  4. Area ID: Vehicles have zones. An HVAC property might have different values for SEAT_ROW_1_LEFT and SEAT_ROW_1_RIGHT.

Vehicle HAL (VHAL): The Bridge to the Metal

The VHAL is the single most important layer for an OEM to implement. Historically, this was implemented using HIDL, but modern AOSP branches (Android 13+) mandate the use of AIDL for the VHAL.

The VHAL exposes a standard interface (IVehicle.aidl). It must support:

  • getValues: Synchronous read of a property.
  • setValues: Synchronous write to a property.
  • subscribe: Asynchronous stream of property changes.

Because the VHAL talks to real hardware, it is heavily guarded. Only system-level components (specifically the Car Service) are allowed to bind to the VHAL interface.

Security, Safety, and Driver Distraction

You cannot build for AAOS without treating safety as a first-class citizen.

Stricter Permissions

In mobile Android, permissions protect user data (Contacts, Camera). In AAOS, permissions protect physical safety. Accessing PERF_VEHICLE_SPEED requires the android.car.permission.CAR_SPEED permission, which is a signature|privileged permission. Only apps signed with the platform key or explicitly allowlisted in privapp-permissions.xml can hold it.

Driver Distraction

The CarUxRestrictionsManager enforces the Distraction Optimized (DO) rules. If a user is typing a destination into the navigation app and the car shifts into Drive, the system broadcasts a UX restriction. The Activity must respond by dismissing the keyboard and reverting to a voice-only or simplified UI. Non-DO optimized apps are entirely blocked from rendering while the vehicle is in motion.

Domain-Specific Complexity in AAOS

1. Power Management (Garage Mode & Suspend to RAM)

A phone turns off when the battery dies. A car’s infotainment system cannot. It must boot instantly when the driver opens the door. AAOS uses Suspend-to-RAM (Deep Sleep). When the ignition is turned off, Android halts processes, suspends the kernel, and keeps the RAM powered. Furthermore, AAOS introduces Garage Mode. When the car is turned off, the OS may wake itself up in a low-power state to download OTA updates, sync logs, and perform maintenance, all while keeping the screen off.

2. Multi-Zone Audio Architecture

Standard Android assumes one user, one screen, one audio output. A car might have a driver listening to navigation prompts, a passenger making a phone call, and rear-seat displays playing a movie. The CarAudioService and the Automotive Audio Control HAL implement Audio Zones. Physical speakers are mapped to logical zones, allowing dynamic routing of audio contexts (e.g., USAGE_MEDIA, USAGE_ASSISTANCE_NAVIGATION_GUIDANCE) to specific seats.

AOSP Integration: Where the Code Lives

If you are transitioning to platform engineering, you need to know where to look in the AOSP tree. The AAOS specific code is primarily found in:

  • **packages/services/Car/**: This is the home of CarService, the Car API, and default reference apps (like the AOSP Car Launcher).
  • **hardware/interfaces/automotive/vehicle/**: The AIDL/HIDL definitions for the VHAL. This is the exact contract OEMs must implement.
  • **frameworks/opt/car/**: Framework extensions specifically built for automotive use cases.
  • **frameworks/base/services/core/java/com/android/server/**: Look here for SystemServer modifications and the CarServiceHelperService.

Practical Engineering Insights & Debugging

Debugging Embedded Android is fundamentally different from debugging mobile apps. You rarely use Android Studio’s UI debugger. Instead, you live in the shell.

  1. Dumpsys is your best friend: To see the current state of all vehicle properties, inject mock data, or check power states, you will use dumpsys.
adb shell dumpsys car_service

2. Injecting VHAL Events: You don’t need to drive a car to test speed. You can inject VHAL events directly via ADB to simulate hardware changes:

adb shell cmd car_service inject-vhal-event 0x11600207 25.5

3. LSHAL for HAL debugging: To verify if the VHAL is actually running and registered with hwservicemanager or servicemanager:

adb shell lshal | grep vehicle

How to Get Started

If you want to transition into an Android Automotive OS platform role, follow these steps:

  1. Build AOSP for Car: Download the AOSP source tree and lunch a car target. You don’t need a physical board; you can run the x86 emulator.
source build/envsetup.sh
lunch aosp_car_x86_64-userdebug
m -j$(nproc)
emulator
  1. Explore the Mock VHAL: AOSP provides a DefaultVehicleHal implementation. Read through its C++ code in hardware/interfaces/automotive/vehicle to understand how properties are initialized and updated.
  2. Modify a System Service: Try adding a custom vehicle property to the IVehicle.aidl interface, implement it in the Mock VHAL, expose it through CarPropertyService, and read it in a test application. This end-to-end exercise is the ultimate interview prep.

Conclusion

Android Automotive OS is vastly more complex than standard Android. It requires developers to think about physical safety, rigorous hardware abstraction, complex state machines for power, and IPC mechanisms that span from standard Java apps down to bare-metal C++ microcontroller interfaces.

For an Android Platform Engineer, mastering AAOS offers a fascinating technical playground. You are not just pushing pixels on a screen; you are bridging the gap between high-level software engineering and the physical reality of automotive mechanics. Understand the Vehicle HAL, master the Car Service, get comfortable navigating the AOSP source tree, and you will be well-equipped for the future of connected vehicle engineering.


메타데이터
post_id
c2e39ca1f34e
slug
aaos-architecture-explained-for-android-engineers-c2e39ca1f34e
url
https://medium.com/@santoshmehta9/aaos-architecture-explained-for-android-engineers-c2e39ca1f34e
canonical_url
https://medium.com/@santoshmehta9/aaos-architecture-explained-for-android-engineers-c2e39ca1f34e
author_url
https://medium.com/@santoshmehta9
status
ok
fetched_at
2026-06-12 07:40:50