Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

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

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

Approve changes

m vendor.android.hardware.automotive.vehicle.property-update-api
m android.car-module.stubs.source-update-current-api
m android.car-stubs-docs-update-current-api

This will (re-)generate:

<aosp_workspace>/hardware/interfaces/automotive/vehicle/aidl_property/aidl_api/vendor.android.hardware.automotive.vehicle.property/current/vendor/android/hardware/automotive/vehicle/VehiclePropertyOem.aidl
<aosp_workspace>/packages/services/Car/car-lib/api/current.txt
<aosp_workspace>/packages/services/Car/car-lib-module/api/current.txt

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
# 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 --git-dir="$ANDROID_BUILD_TOP/hardware/interfaces/.git" \
    --work-tree="$ANDROID_BUILD_TOP/hardware/interfaces" \
    restore \
    "$ANDROID_BUILD_TOP/hardware/interfaces/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java" \
    "$ANDROID_BUILD_TOP/hardware/interfaces/automotive/vehicle/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

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors