VHAL Emulator
NXP’s base image ships AOSP’s reference Vehicle HAL (FakeVehicleHardware / android.hardware.automotive.vehicle.IVehicle/default). It exposes a debug interface through dumpsys that lets you read and write vehicle properties from adb shell — useful for poking the cluster app while a real CAN-backed VHAL is not yet wired up.
Connect
Section titled “Connect”adb rootadb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --helpadb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --listProperty names are not accepted by this build — pass the integer/hex property ID. Get IDs from --list, or look them up in the VehiclePropertyIds reference.
Cluster permissions
Section titled “Cluster permissions”The AOSP cluster app (android.car.cluster) subscribes to FUEL_LEVEL, RANGE_REMAINING, and PERF_VEHICLE_SPEED, but the required permissions (CAR_ENERGY, CAR_SPEED) are “dangerous” and not auto-granted to the cluster package. Grant them before the values will appear on the display:
adb shell pm grant android.car.cluster android.car.permission.CAR_ENERGYadb shell pm grant android.car.cluster android.car.permission.CAR_SPEEDThe cluster must restart to pick up the new permissions. After a reboot or force-stop, the properties will be readable and the UI updates.
Reading a property value
Section titled “Reading a property value”Use --get <propId> to read the current value of any property:
adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get 0x11600305Properties that work today
Section titled “Properties that work today”On our current image all of the following properties update the cluster UI when set via dumpsys.
Engine RPM
Section titled “Engine RPM”ENGINE_RPM (0x11600305) — float, global area.
Set the raw value to the RPM you want displayed.
# Display 5000 RPM on the tachadb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default \ --set 0x11600305 -a 0 -f 5000Gear selection
Section titled “Gear selection”GEAR_SELECTION (0x11400400) — int32, global area. Values from VehicleGear:
| Gear | Value |
|---|---|
| NEUTRAL | 1 |
| REVERSE | 2 |
| PARK | 4 |
| DRIVE | 8 |
# Put the vehicle in Driveadb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default \ --set 0x11400400 -a 0 -i 8Fuel level
Section titled “Fuel level”FUEL_LEVEL (0x11600307) — float, global area. The raw value represents fuel volume in milliliters. The cluster calculates the displayed percentage as fuelValue / fuelCapacity * 100.
Default capacity on this image is 15000 (15 L). For a target percentage, multiply the capacity by that fraction:
# 68% fuel: 15000 * 0.68 = 10200adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default \ --set 0x11600307 -a 0 -f 10200You can confirm the current capacity by reading FUEL_CAPACITY (0x11600104) — see Reading a property value.
Range remaining
Section titled “Range remaining”RANGE_REMAINING (0x11600308) — float, global area. The raw value is in meters. The cluster converts to distance units using distance_factor (1609.344 for mi). The display shows the cluster’s locale-dependent unit (mi or km).
# ~250 mi range (402336 meters)adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default \ --set 0x11600308 -a 0 -f 402336Vehicle speed
Section titled “Vehicle speed”PERF_VEHICLE_SPEED (0x11600207) — float, global area. The raw value is in meters per second. The cluster converts using speed_factor (2.2369363 for mi/h). The display shows the cluster’s locale-dependent unit (mi/h or km/h).
# ~65 mi/h: 65 / 2.2369363 ≈ 29.06 m/sadb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default \ --set 0x11600207 -a 0 -f 29.06