如何在android Automotive VHAL中创建自定义车辆属性?
如何生成PropertyID以及如何从CarPropertyManager访问它?
我找到了下面的参考,但我不清楚这一点:
https://source.android.com/devices/automotive/properties#prop_custom](https://source.android.com/devices/automotive/properties#prop_custom]1)
发布于 2020-02-28 11:36:05
带注释
Vendors are allowed to extend this enum with their own properties
In this case they must use VehiclePropertyGroup:VENDOR flag when property is
declared.
您必须扩展枚举VehicleProperty,然后通过CarPropertyManager使其可用,并通过CarPropertyValue获取值
发布于 2020-11-02 19:46:01
使用以下属性自定义车辆属性:
EXAMPLE_PROPERTY = (
0xXXXX
| VehiclePropertyGroup:VENDOR
| VehiclePropertyType:STRING
| VehicleArea:GLOBAL),
可以通过CarPropertyManager访问自定义属性。我们为所有的供应商属性定义了一个权限: Car.PERMISSION_VENDOR_EXTENDSION (Android10)
检查此https://source.android.com/devices/automotive/vhal/properties#handling-custom-properties
在Android11上,vehicle hal支持通过SUPPORT_CUSTOMIZE_VENDOR_PERMISSION定制供应商权限功能
/**
* Support customize permissions for vendor properties
*
* Implement this property if vehicle hal support customize vendor permissions feature.
* VehiclePropConfig.configArray is used to indicate vendor properties and permissions
* which selected for this vendor property. The permission must be one of enum in
* VehicleVendorPermission.
* The configArray is set as follows:
* configArray[n] = propId : property ID for the vendor property
* configArray[n+1] = one of enums in VehicleVendorPermission. It indicates the permission
* for reading value of the property.
* configArray[n+2] = one of enums in VehicleVendorPermission. It indicates the permission
* for writing value of the property.
*
* For example:
* configArray = {
* vendor_prop_1, PERMISSION_VENDOR_SEAT_READ, PERMISSION_VENDOR_SEAT_WRITE,
* vendor_prop_2, PERMISSION_VENDOR_INFO, PERMISSION_NOT_ACCESSIBLE,
* }
* If vendor properties are not in this array, they will have the default vendor permission.
* If vendor chose PERMISSION_NOT_ACCESSIBLE, android will not have access to the property. In
* the example, Android can not write value for vendor_prop_2.
*
* @change_mode VehiclePropertyChangeMode:STATIC
* @access VehiclePropertyAccess:READ
*/
SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = (
0x0F05
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
| VehicleArea:GLOBAL),
https://stackoverflow.com/questions/60273871
复制相似问题