Как добавить пользовательские свойства VHAL в Android Automotive 14Android

Форум для тех, кто программирует под Android
Anonymous
Как добавить пользовательские свойства VHAL в Android Automotive 14

Сообщение Anonymous »

Я добавил следующий путь:
  • hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
    const ConfigDeclaration kVehicleProperties[]{
    {
    .config = {
    .prop = VENDOR_WRITE_PROP,
    .access = VehiclePropertyAccess::READ_WRITE,
    .changeMode = VehiclePropertyChangeMode::ON_CHANGE
    },
    .initialValue = {.int32Values = {123}}},
    //другой реквизит
2.hardware/interfaces/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl

Код: Выделить всё

VENDOR_WRITE_PROP = 0x105 + 0x20000000 + 0x03000000 + 0x00400000,
  • hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v_2_0/PropertyUtils.h
    constexpr int VENDOR_WRITE_PROP = (int)(0x105 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::STRING | VehicleArea::GLOBAL);
4.hardware/interfaces/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperties.json

Код: Выделить всё

  { "property": "TestVendorProperty::VENDOR_WRITE_PROP", "defaultValue": { "stringValue": "Vendor Property" }, "access": "VehiclePropertyAccess::READ_WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"},
Затем создайте и проверьте. Но это свойство недоступно в эмуляторе Android.
Также проверено с помощью приведенной ниже команды: Но это недавно добавленное свойство VHAL недоступно.
adb Shell dumpsys car_service get-property-value
Дайте мне знать, чего мне не хватает?

Подробнее здесь: https://stackoverflow.com/questions/794 ... omotive-14

Вернуться в «Android»