If you have worked on vehicle HAL, Kindly help me out with the below query.
AOSP: How to initialize the VehicleProperty::AUDIO_VOLUME property (.initialValues in the DefaultConfig.h) in vehicl hal ?
Trying to add AUDIO_VOLUME property to the demo vehicle hal code present in /hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/
File name: DefaultConfig.h
tried adding like below, but it is crashing.
{.config =
{
.prop = toInt(VehicleProperty::AUDIO_VOLUME),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = { toInt(VehicleAudioContextFlag::MUSIC_FLAG), toInt(VehicleAudioVolumeCapabilityFlag::MASTER_VOLUME_ONLY),0,0,100 },
},
.initialValue = {.int32Values = { toInt(VehicleAudioContextFlag::MUSIC_FLAG), 80, toInt(VehicleAudioVolumeState::STATE_OK) } }
},
AUDIO_VOLUME property as defined in /hardware/interfaces/automotive/vehicle/2.0/types.hal
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
* @config_flags all audio contexts supported.
*/
AUDIO_VOLUME = (
0x0901
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32_VEC
| VehicleArea:GLOBAL),
reference OSP code available in
http://androidxref.com/8.0.0_r4/xref/Thanks in advance.!!