Skip to content

COVESA/aosp_vendor_car

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vendor Car

Generate VSS based OEM VHAL

The following will show how to generate OEM VHAL sources from VSS tree using VSS Tools.

Prerequisites

The below example assumes ANDROID_BUILD_TOP environment variable. Run the following commands to set ANDROID_BUILD_TOP:

cd <aosp_workspace>
source build/envsetup.sh
lunch sdk_car_x86_64-trunk_staging-userdebug

To get the latest vss-tools-*.whl clone vss-tools, then run the command:

# within cloned vss-tools
uv build # This will build the vss_tools-*.whl file under dist/
cp dist/vss_tools-*.whl <aosp_workspace>/vendor/car/tools/vss_tools/

or use the sources:

# within cloned vss-tools
python -m venv .venv
source .venv/bin/activate

For further information see: https://github.com/COVESA/vss-tools?tab=readme-ov-file#installation

Generating VSS based code

To (re-)generate VSS based AOSP sources run:

vspec export vhal --no-extend-new \
  --vspec path/to/vehicle_signal_specification/spec/VehicleSignalSpecification.vspec \
  --vhal-map $ANDROID_BUILD_TOP/device/generic/car/emulator/vhalmap/value_map.json \ 
  --aosp-workspace-path $ANDROID_BUILD_TOP

This will (re-)generate the following files:

<aosp_workspace>/device/generic/car/emulator/vhalmap/value_map.json
<aosp_workspace>/vendor/car/packages/services/Oem/oem-service/AndroidManifest.xml
<aosp_workspace>/vendor/car/packages/services/Oem/oem-service/res/values/strings.xml
<aosp_workspace>/vendor/car/packages/services/Car/car-lib/src/android/car/oem/OemPermissions.java
<aosp_workspace>/vendor/car/packages/services/Car/car-lib/src/android/car/oem/VehiclePropertyIdsOem.java
<aosp_workspace>/vendor/car/hardware/interfaces/automotive/vehicle/aidl_property/vendor/android/hardware/automotive/vehicle/VehiclePropertyOem.aidl

Generating annotation enums (post processing)

Running hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py

python $ANDROID_BUILD_TOP/hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py
cd $ANDROID_BUILD_TOP/hardware/interfaces/automotive/vehicle/
# Revert changes made by generate_annotation_enums.py to the Java files.
# These two files are used only by fakevhal, which is not used here.
# They contain a map with more than 1,400 entries, which exceeds the JVM bytecode size limit.
# This causes the runtime error "Cannot load updatable package code" when CarService starts.
git restore aidl/generated_lib/4/java/AccessForVehicleProperty.java
git restore aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java

This will update the following files:

<aosp_workspace>/hardware/interfaces/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h
<aosp_workspace>/hardware/interfaces/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h
<aosp_workspace>/hardware/interfaces/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h

VehiclePropertyIdsParser (post processing)

Running packages/services/Car/tools/vehiclepropertyidsparser/prebuilt/VehiclePropertyIdsParser.jar:

java -jar $ANDROID_BUILD_TOP/packages/services/Car/tools/vehiclepropertyidsparser/prebuilt/VehiclePropertyIdsParser.jar \
  $ANDROID_BUILD_TOP/packages/services/Car/car-lib/src \
  $ANDROID_BUILD_TOP/vendor/car/packages/services/Car/car-lib/src \
  $ANDROID_BUILD_TOP/packages/services/Car/car-lib/generated-prop-config/CarSvcProps.json

This will (re-) generate:

<aosp_workspace>/packages/services/Car/car-lib/generated-prop-config/CarSvcProps.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages