Working with VHAL
The Vehicle Hardware Abstraction Layer (VHAL) is Android Automotive's interface to vehicle data. It is what makes a Null Autos emulator behave like a car instead of a tablet: your application reads vehicle properties through standard Android Automotive APIs, and Null Autos lets you set those properties to simulate any vehicle state you need to test.
Why VHAL matters
Automotive apps respond to the vehicle. An IVI app might lock certain controls while driving, a cluster app shows speed and fuel, and a charging app reacts to battery state. To test these behaviors you need to put the vehicle into specific states, which is impossible to do reliably with a real car and trivial with VHAL.
What you can control
VHAL exposes a wide range of vehicle properties, including:
- Motion: speed, RPM, gear selection
- Energy: fuel level, battery level, charging state
- Climate: HVAC temperature, fan, zones
- Body: doors, windows, lights
- and many more standard Android Automotive properties.
Using VHAL in the portal
Open an emulator and use the VHAL inspector:
- Monitor properties live as they change.
- Edit properties with purpose-built controls (dials, toggles, and area selectors for multi-zone properties like HVAC).
- Run scenarios to drive sequences of state changes.
This is the fastest way to explore, and it is great for non-programmatic testing and demos.
Using VHAL programmatically
For automation, VHAL is available over gRPC through the control plane, which forwards your calls to the vehicle HAL server running inside the emulator. The connection carries your authorization and a header identifying the target device.
The VHAL service supports the standard Android Automotive vehicle operations, including reading values, setting values, subscribing to changes, and querying the full property configuration. The platform's frontend SDK includes a VHAL client you can use directly.
Typical test flow
- Launch an emulator and install your app over ADB.
- Set the vehicle into the state under test (for example
speed = 60,gear = DRIVE). - Assert your app behaves correctly.
- Subscribe to a property to verify your app emits the expected changes.