From cfbfa1361d13219dc142df170abf08ca53fd0146 Mon Sep 17 00:00:00 2001 From: Kai Date: Wed, 10 Mar 2021 16:34:04 -0800 Subject: [PATCH] Correct Vehicle properties permissions Some properties has different documentation in types.hal and propertyHalIds. fix the inconsistency Add e2e test for system properties' permission Bug: 156660899 Test: atest VehicleHalTest Change-Id: I5cf77cf039508a383b0b2ea5836b3a29bca9e514 --- .../vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h | 10 +++++++++- automotive/vehicle/2.0/types.hal | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h index 73513f4e4c..961f750bea 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h @@ -488,6 +488,14 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.int32Values = {1}}}, + {.config = + { + .prop = toInt(VehicleProperty::PARKING_BRAKE_AUTO_APPLY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {1}}}, + {.config = { .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW), @@ -1050,7 +1058,7 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { .prop = toInt(VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION), - .access = VehiclePropertyAccess::READ_WRITE, + .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {kMixedTypePropertyForTest, diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index e3fd16de57..20c2848547 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -688,7 +688,7 @@ enum VehicleProperty : int32_t { * Parking brake state. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE + * @access VehiclePropertyAccess:READ */ PARKING_BRAKE_ON = ( 0x0402 @@ -700,7 +700,7 @@ enum VehicleProperty : int32_t { * Auto-apply parking brake. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE + * @access VehiclePropertyAccess:READ */ PARKING_BRAKE_AUTO_APPLY = ( 0x0403