To migrate an existing HIDL VHAL implementation to an AIDL VHAL,
use the
AIDL reference implementation
structure to implement the IVehicleHardware interface.
If the existing HIDL implementation also follows
HIDL reference implementation,
the vendor has implemented the When migrating from the HIDL VHAL to the AIDL VHAL, consider these differences. As a result, you must include all header files for the types you need. A helper file,
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. Last updated 2025-04-04 UTC.VehicleHal class. IVehicleHardware is
very similar to VehicleHal.
HIDL VHAL
AIDL VHAL
getAllPropertyConfigs()Same as
VehicleHal.listProperties()
getValues(callback, requests)Can call VehicleHal.get() for each request and can call callbacks.
dump()Same as
VehicleHal.dump()
checkHealth()Can return
VehicleHal.get()
registerPropertyChangeCallback()Similar to setting
VehicleHal.mOnHalEventType differences in AIDL
types.h) for all types generated from
types.hal. AIDL generates one header file for each type. For example,
VehiclePropValue.h from VehiclePropValue.aidl.
VehicleHalTypes.h in the VehicleHalUtils library contains most of
the common types.
Instead of ...
Use
hidl_vecstd::vector
hidl_stringstd::string
android::spstd::shared_ptr
android::wpstd::weak_ptrtypes.hal are the same in AIDL except for:
SubscribeFlags is removed as it's not used because
onPropertySet is removedUserFlags is now defined in UserInfo.aidl and should be defined
as a flag instead of an enum. A user flag field is an integer that has multiple
UserInfo.USER_FLAG_XXX bit-or together.RawValue in VehiclePropValue is renamed as
RawPropValuebytes in RawValue is renamed as byteValues

