Search code examples
androidcan-busandroid-automotive

Is there a way to read/write directly from/to the can-bus in android automotive?


Assume I have a vehicle containing a screen that is connected to the vehicles can-bus and that the screen is using the android automotive OS. Disregard Google play store. Is it possible to create a third party app for android automotive that can read and send can-packets directly to the can-bus? The purpose is controlling physical third party addons connected to the can-bus, not to access functions already used by the vehicle like accelleration, engine-state and so on.


Solution

  • Direct access to can-bus is not possible. Android Automotive uses Vehicle HAL - Vehicle HAL is a lower layer that interacts with the vehicle, communicating with in-vehicle networks and other vehicular hardware.

    Also, access to VHAL is restricted to system application.

    Copied from s.a.c document

    The vehicle HAL is the only component in Android Automotive connected to the IVI system, either via direct Application Processor/MicroController connection or gated through a VMCU. Access to the Vehicle HAL should be restricted to system applications using SELinux rules and proper permissions on kernel interfaces.

    PTAL https://developer.android.com/reference/android/car/VehiclePropertyIds for more detail.