Merge "Add gralloc VTS for SMPTE 2094-10 metadata"
diff --git a/audio/common/6.0/Android.bp b/audio/common/6.0/Android.bp
index fc54caf..91721fc 100644
--- a/audio/common/6.0/Android.bp
+++ b/audio/common/6.0/Android.bp
@@ -20,4 +20,8 @@
],
gen_java: true,
gen_java_constants: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
}
diff --git a/authsecret/1.0/vts/functional/OWNERS b/authsecret/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..ec8c304
--- /dev/null
+++ b/authsecret/1.0/vts/functional/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 186411
+chengyouho@google.com
+frankwoo@google.com
diff --git a/automotive/audiocontrol/1.0/Android.bp b/automotive/audiocontrol/1.0/Android.bp
index 628793b..53ed78b 100644
--- a/automotive/audiocontrol/1.0/Android.bp
+++ b/automotive/audiocontrol/1.0/Android.bp
@@ -20,4 +20,8 @@
"android.hidl.base@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
}
diff --git a/automotive/audiocontrol/2.0/Android.bp b/automotive/audiocontrol/2.0/Android.bp
index 4d1fdbc..413cf48 100644
--- a/automotive/audiocontrol/2.0/Android.bp
+++ b/automotive/audiocontrol/2.0/Android.bp
@@ -24,4 +24,8 @@
"android.hidl.safe_union@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
}
diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp
index 4acfd82..5e69429 100644
--- a/automotive/audiocontrol/aidl/Android.bp
+++ b/automotive/audiocontrol/aidl/Android.bp
@@ -17,6 +17,11 @@
backend: {
java: {
sdk_version: "module_current",
+ min_sdk_version: "31",
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
},
},
versions: ["1"],
diff --git a/automotive/can/1.0/vts/functional/OWNERS b/automotive/can/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..85257a3
--- /dev/null
+++ b/automotive/can/1.0/vts/functional/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 533426
+twasilczyk@google.com
+chrisweir@google.com
diff --git a/automotive/occupant_awareness/aidl/Android.bp b/automotive/occupant_awareness/aidl/Android.bp
index 288dc6d..6ddc127 100644
--- a/automotive/occupant_awareness/aidl/Android.bp
+++ b/automotive/occupant_awareness/aidl/Android.bp
@@ -17,6 +17,11 @@
backend: {
java: {
sdk_version: "module_current",
+ min_sdk_version: "31",
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
},
ndk: {
vndk: {
diff --git a/automotive/vehicle/2.0/Android.bp b/automotive/vehicle/2.0/Android.bp
index e2164b1..5c2e0ea 100644
--- a/automotive/vehicle/2.0/Android.bp
+++ b/automotive/vehicle/2.0/Android.bp
@@ -21,4 +21,8 @@
"android.hidl.base@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
}
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 e025d1e..cfbbbd3 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
@@ -1036,7 +1036,7 @@
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
- .initialValue = {.int32Values = {0 /* ClusterHome */, -1 /* ClusterNone */}},
+ .initialValue = {.int32Values = {0 /* ClusterHome */}},
},
{
.config =
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index b964991..7c8e1f5 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -487,8 +487,11 @@
* int64Values[3] = rear right ticks
* int64Values[4] = rear left ticks
*
- * configArray is used to indicate the micrometers-per-wheel-tick value and
- * which wheels are supported. configArray is set as follows:
+ * configArray is used to indicate the micrometers-per-wheel-tick values and
+ * which wheels are supported. Each micrometers-per-wheel-tick value is static (i.e. will not
+ * update based on wheel's status) and a best approximation. For example, if a vehicle has
+ * multiple rim/tire size options, the micrometers-per-wheel-tick values are set to those for
+ * the typically expected rim/tire size. configArray is set as follows:
*
* configArray[0], bits [0:3] = supported wheels. Uses enum Wheel.
* configArray[1] = micrometers per front left wheel tick
diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp
index ca8afb0..1ca62ac 100644
--- a/automotive/vehicle/aidl/Android.bp
+++ b/automotive/vehicle/aidl/Android.bp
@@ -34,6 +34,11 @@
},
java: {
sdk_version: "module_current",
+ min_sdk_version: "31",
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
},
},
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
index 472b23b..7e48eba 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
@@ -36,4 +36,5 @@
enum VehicleApPowerStateConfigFlag {
ENABLE_DEEP_SLEEP_FLAG = 1,
CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2,
+ ENABLE_HIBERNATION_FLAG = 3,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
index 1ca3b50..fc669ec 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
@@ -42,4 +42,6 @@
ON = 6,
SHUTDOWN_PREPARE = 7,
SHUTDOWN_CANCELLED = 8,
+ HIBERNATION_ENTRY = 9,
+ HIBERNATION_EXIT = 10,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
index 3e0f4e8..3fde1c7 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
@@ -38,4 +38,6 @@
CAN_SLEEP = 2,
SHUTDOWN_ONLY = 3,
SLEEP_IMMEDIATELY = 4,
+ HIBERNATE_IMMEDIATELY = 5,
+ CAN_HIBERNATE = 6,
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
index 7cb5db3..4d8e2f5 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl
@@ -20,8 +20,10 @@
@Backing(type="int")
enum VehicleApPowerStateConfigFlag {
/**
- * AP can enter deep sleep state. If not set, AP will always shutdown from
- * VehicleApPowerState#SHUTDOWN_PREPARE power state.
+ * AP can enter deep sleep state. If not set, AP will shutdown from
+ * VehicleApPowerState#SHUTDOWN_PREPARE power state when deep sleep is requested
+ * (via VehicleApPowerStateShutdownParam#CAN_SLEEP or
+ * VehicleApPowerStateShutdownParam#SLEEP_IMMEDIATELY flags)/
*/
ENABLE_DEEP_SLEEP_FLAG = 0x1,
/**
@@ -29,4 +31,11 @@
* specified in VehicleApPowerSet VEHICLE_AP_POWER_SET_SHUTDOWN_READY message.
*/
CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2,
+ /**
+ * AP can enter hibernation state. If not set, AP will shutdown from
+ * VehicleApPowerState#SHUTDOWN_PREPARE when hibernation is requested
+ * (via VehicleApPowerStateShutdownParam#CAN_HIBERNATE or
+ * VehicleApPowerStateShutdownParam#HIBERNATE_IMMEDIATELY flags)
+ */
+ ENABLE_HIBERNATION_FLAG = 0x3,
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
index f1d741f..e94fc76 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl
@@ -89,4 +89,22 @@
* VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored.
*/
SHUTDOWN_CANCELLED = 0x8,
+ /**
+ * AP is ready to hibernate.
+ * The AP will not send any more state reports after this.
+ * After reporting this state, AP will accept VehicleApPowerStateReq#FINISHED.
+ * Other power state requests are ignored.
+ *
+ * int32Values[1]: Time to turn AP back on, in seconds. Power controller should turn on
+ * AP after the specified time has elapsed, so AP can run tasks like
+ * update. If this value is 0, no wake up is requested. The power
+ * controller may not necessarily support timed wake-up.
+ */
+ HIBERNATION_ENTRY = 0x9,
+ /**
+ * AP is exiting from hibernation state.
+ * After reporting this state, AP will accept VehicleApPowerStateReq#ON or
+ * VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored.
+ */
+ HIBERNATION_EXIT = 0xA,
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
index 7b682b5..a863d14 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
@@ -36,4 +36,13 @@
* Postponing is not allowed.
*/
SLEEP_IMMEDIATELY = 4,
+ /**
+ * AP must hibernate (suspend to disk) immediately. Postponing is not allowed.
+ * Depending on the actual implementation, it may shut down immediately
+ */
+ HIBERNATE_IMMEDIATELY = 5,
+ /**
+ * AP can enter hibernation (suspend to disk) instead of shutting down completely.
+ */
+ CAN_HIBERNATE = 6,
}
diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h
index 411075d..12a5691 100644
--- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h
+++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h
@@ -22,6 +22,7 @@
#include <VehicleHalTypes.h>
#include <map>
+#include <vector>
namespace android {
namespace hardware {
@@ -35,6 +36,7 @@
using ::aidl::android::hardware::automotive::vehicle::EvsServiceState;
using ::aidl::android::hardware::automotive::vehicle::EvsServiceType;
using ::aidl::android::hardware::automotive::vehicle::FuelType;
+using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig;
@@ -52,116 +54,107 @@
using ::aidl::android::hardware::automotive::vehicle::VehicleUnit;
using ::aidl::android::hardware::automotive::vehicle::VehicleVendorPermission;
-} // namespace defaultconfig_impl
-
struct ConfigDeclaration {
- defaultconfig_impl::VehiclePropConfig config;
+ VehiclePropConfig config;
// This value will be used as an initial value for the property. If this field is specified for
// property that supports multiple areas then it will be used for all areas unless particular
// area is overridden in initialAreaValue field.
- ::aidl::android::hardware::automotive::vehicle::RawPropValues initialValue;
+ RawPropValues initialValue;
// Use initialAreaValues if it is necessary to specify different values per each area.
- std::map<int32_t, ::aidl::android::hardware::automotive::vehicle::RawPropValues>
- initialAreaValues;
+ std::map<int32_t, RawPropValues> initialAreaValues;
};
-const ConfigDeclaration kVehicleProperties[]{
+const std::vector<ConfigDeclaration> kVehicleProperties = {
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_FUEL_CAPACITY),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.floatValues = {15000.0f}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_FUEL_TYPE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_FUEL_TYPE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
- .initialValue = {.int32Values = {toInt(
- defaultconfig_impl::FuelType::FUEL_TYPE_UNLEADED)}}},
+ .initialValue = {.int32Values = {toInt(FuelType::FUEL_TYPE_UNLEADED)}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::INFO_EV_BATTERY_CAPACITY),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_EV_BATTERY_CAPACITY),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.floatValues = {150000.0f}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_EV_CONNECTOR_TYPE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_EV_CONNECTOR_TYPE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
- .initialValue = {.int32Values = {toInt(
- defaultconfig_impl::EvConnectorType::IEC_TYPE_1_AC)}}},
+ .initialValue = {.int32Values = {toInt(EvConnectorType::IEC_TYPE_1_AC)}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::INFO_FUEL_DOOR_LOCATION),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_FUEL_DOOR_LOCATION),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.int32Values = {FUEL_DOOR_REAR_LEFT}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_EV_PORT_LOCATION),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_EV_PORT_LOCATION),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT, CHARGE_PORT_REAR_LEFT}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MAKE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_MAKE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.stringValue = "Toy Vehicle"}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MODEL),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_MODEL),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.stringValue = "Speedy Model"}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MODEL_YEAR),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_MODEL_YEAR),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.int32Values = {2020}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::INFO_EXTERIOR_DIMENSIONS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_EXTERIOR_DIMENSIONS),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialValue = {.int32Values = {1776, 4950, 2008, 2140, 2984, 1665, 1667, 11800}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_VEHICLE_SPEED),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 10.0f,
},
@@ -169,68 +162,61 @@
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .configArray =
- {toInt(defaultconfig_impl::VehicleUnit::METER_PER_SEC),
- toInt(defaultconfig_impl::VehicleUnit::MILES_PER_HOUR),
- toInt(defaultconfig_impl::VehicleUnit::KILOMETERS_PER_HOUR)},
+ .prop = toInt(VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {toInt(VehicleUnit::METER_PER_SEC),
+ toInt(VehicleUnit::MILES_PER_HOUR),
+ toInt(VehicleUnit::KILOMETERS_PER_HOUR)},
},
- .initialValue = {.int32Values = {toInt(
- defaultconfig_impl::VehicleUnit::KILOMETERS_PER_HOUR)}}},
+ .initialValue = {.int32Values = {toInt(VehicleUnit::KILOMETERS_PER_HOUR)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::SEAT_OCCUPANCY),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs =
- {defaultconfig_impl::VehicleAreaConfig{.areaId = (SEAT_1_LEFT)},
- defaultconfig_impl::VehicleAreaConfig{.areaId = (SEAT_1_RIGHT)}},
+ .prop = toInt(VehicleProperty::SEAT_OCCUPANCY),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = (SEAT_1_LEFT)},
+ VehicleAreaConfig{.areaId = (SEAT_1_RIGHT)}},
},
- .initialAreaValues =
- {{SEAT_1_LEFT,
- {.int32Values = {toInt(defaultconfig_impl::VehicleSeatOccupancyState::VACANT)}}},
- {SEAT_1_RIGHT,
- {.int32Values = {toInt(
- defaultconfig_impl::VehicleSeatOccupancyState::VACANT)}}}}},
+ .initialAreaValues = {{SEAT_1_LEFT,
+ {.int32Values = {toInt(VehicleSeatOccupancyState::VACANT)}}},
+ {SEAT_1_RIGHT,
+ {.int32Values = {toInt(VehicleSeatOccupancyState::VACANT)}}}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_DRIVER_SEAT),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
// this was a zoned property on an old vhal, but it is meant to be global
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = (0)}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
},
.initialValue = {.int32Values = {SEAT_1_LEFT}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_ODOMETER),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::PERF_ODOMETER),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 10.0f,
},
.initialValue = {.floatValues = {0.0f}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_STEERING_ANGLE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::PERF_STEERING_ANGLE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 10.0f,
},
.initialValue = {.floatValues = {0.0f}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::PERF_REAR_STEERING_ANGLE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::PERF_REAR_STEERING_ANGLE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 10.0f,
},
@@ -238,10 +224,9 @@
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_RPM),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::ENGINE_RPM),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 10.0f,
},
@@ -250,9 +235,9 @@
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_LEVEL),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::FUEL_LEVEL),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 100.0f,
},
@@ -260,17 +245,17 @@
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_DOOR_OPEN),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::FUEL_DOOR_OPEN),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::EV_BATTERY_LEVEL),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::EV_BATTERY_LEVEL),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 100.0f,
},
@@ -278,27 +263,25 @@
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::EV_CHARGE_PORT_OPEN),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::EV_CHARGE_PORT_OPEN),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::EV_CHARGE_PORT_CONNECTED),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::EV_CHARGE_PORT_CONNECTED),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::
- EV_BATTERY_INSTANTANEOUS_CHARGE_RATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 10.0f,
},
@@ -306,9 +289,9 @@
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::RANGE_REMAINING),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::RANGE_REMAINING),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 2.0f,
},
@@ -316,25 +299,25 @@
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::TIRE_PRESSURE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{
+ .prop = toInt(VehicleProperty::TIRE_PRESSURE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
+ .areaConfigs = {VehicleAreaConfig{
.areaId = WHEEL_FRONT_LEFT,
.minFloatValue = 193.0f,
.maxFloatValue = 300.0f,
},
- defaultconfig_impl::VehicleAreaConfig{
+ VehicleAreaConfig{
.areaId = WHEEL_FRONT_RIGHT,
.minFloatValue = 193.0f,
.maxFloatValue = 300.0f,
},
- defaultconfig_impl::VehicleAreaConfig{
+ VehicleAreaConfig{
.areaId = WHEEL_REAR_LEFT,
.minFloatValue = 193.0f,
.maxFloatValue = 300.0f,
},
- defaultconfig_impl::VehicleAreaConfig{
+ VehicleAreaConfig{
.areaId = WHEEL_REAR_RIGHT,
.minFloatValue = 193.0f,
.maxFloatValue = 300.0f,
@@ -346,10 +329,9 @@
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
+ .prop = toInt(VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
},
.initialAreaValues = {{WHEEL_FRONT_LEFT, {.floatValues = {137.0f}}},
{WHEEL_FRONT_RIGHT, {.floatValues = {137.0f}}},
@@ -358,78 +340,73 @@
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .configArray = {toInt(defaultconfig_impl::VehicleUnit::KILOPASCAL),
- toInt(defaultconfig_impl::VehicleUnit::PSI),
- toInt(defaultconfig_impl::VehicleUnit::BAR)},
+ .prop = toInt(VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {toInt(VehicleUnit::KILOPASCAL), toInt(VehicleUnit::PSI),
+ toInt(VehicleUnit::BAR)},
},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::PSI)}}},
+ .initialValue = {.int32Values = {toInt(VehicleUnit::PSI)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::CURRENT_GEAR),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .configArray = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK),
- toInt(defaultconfig_impl::VehicleGear::GEAR_NEUTRAL),
- toInt(defaultconfig_impl::VehicleGear::GEAR_REVERSE),
- toInt(defaultconfig_impl::VehicleGear::GEAR_1),
- toInt(defaultconfig_impl::VehicleGear::GEAR_2),
- toInt(defaultconfig_impl::VehicleGear::GEAR_3),
- toInt(defaultconfig_impl::VehicleGear::GEAR_4),
- toInt(defaultconfig_impl::VehicleGear::GEAR_5)},
+ .prop = toInt(VehicleProperty::CURRENT_GEAR),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {toInt(VehicleGear::GEAR_PARK),
+ toInt(VehicleGear::GEAR_NEUTRAL),
+ toInt(VehicleGear::GEAR_REVERSE),
+ toInt(VehicleGear::GEAR_1), toInt(VehicleGear::GEAR_2),
+ toInt(VehicleGear::GEAR_3), toInt(VehicleGear::GEAR_4),
+ toInt(VehicleGear::GEAR_5)},
},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK)}}},
+ .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::PARKING_BRAKE_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::PARKING_BRAKE_ON),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {1}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::PARKING_BRAKE_AUTO_APPLY),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::PARKING_BRAKE_AUTO_APPLY),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {1}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_LEVEL_LOW),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::HW_KEY_INPUT),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HW_KEY_INPUT),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0, 0, 0}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::HW_ROTARY_INPUT),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HW_ROTARY_INPUT),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0, 0, 0}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::HW_CUSTOM_INPUT),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HW_CUSTOM_INPUT),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0, 0, 0, 3, 0, 0, 0, 0, 0},
},
.initialValue =
@@ -437,106 +414,98 @@
.int32Values = {0, 0, 0},
}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_POWER_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_POWER_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}},
// TODO(bryaneyler): Ideally, this is generated dynamically from
// kHvacPowerProperties.
- .configArray =
- {toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_SPEED),
- toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION)}},
+ .configArray = {toInt(VehicleProperty::HVAC_FAN_SPEED),
+ toInt(VehicleProperty::HVAC_FAN_DIRECTION)}},
.initialValue = {.int32Values = {1}}},
{
- .config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_DEFROSTER),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .config = {.prop = toInt(VehicleProperty::HVAC_DEFROSTER),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs =
- {defaultconfig_impl::VehicleAreaConfig{
- .areaId = toInt(defaultconfig_impl::VehicleAreaWindow::
- FRONT_WINDSHIELD)},
- defaultconfig_impl::VehicleAreaConfig{
- .areaId = toInt(defaultconfig_impl::VehicleAreaWindow::
- REAR_WINDSHIELD)}}},
+ {VehicleAreaConfig{
+ .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)},
+ VehicleAreaConfig{
+ .areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD)}}},
.initialValue = {.int32Values = {0}} // Will be used for all areas.
},
{
- .config = {.prop = toInt(
- defaultconfig_impl::VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .config = {.prop = toInt(VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs =
- {defaultconfig_impl::VehicleAreaConfig{
- .areaId = toInt(defaultconfig_impl::VehicleAreaWindow::
- FRONT_WINDSHIELD)},
- defaultconfig_impl::VehicleAreaConfig{
- .areaId = toInt(defaultconfig_impl::VehicleAreaWindow::
- REAR_WINDSHIELD)}}},
+ {VehicleAreaConfig{
+ .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)},
+ VehicleAreaConfig{
+ .areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD)}}},
.initialValue = {.int32Values = {0}} // Will be used for all areas.
},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_MAX_DEFROST_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_DEFROST_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_RECIRC_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {1}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AUTO_RECIRC_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AC_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {1}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_MAX_AC_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_AC_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AUTO_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {1}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_DUAL_ON),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_DUAL_ON),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_SPEED),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{
+ {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{
.areaId = HVAC_ALL, .minInt32Value = 1, .maxInt32Value = 7}}},
.initialValue = {.int32Values = {3}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
- .initialValue = {.int32Values = {toInt(
- defaultconfig_impl::VehicleHvacFanDirection::FACE)}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}},
- {.config = {.prop = toInt(
- defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {FAN_DIRECTION_FACE, FAN_DIRECTION_FLOOR,
FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR,
FAN_DIRECTION_DEFROST,
@@ -544,15 +513,15 @@
FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST,
FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST |
FAN_DIRECTION_FACE}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_SEAT_VENTILATION),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{
+ {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_VENTILATION),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{
.areaId = SEAT_1_LEFT,
.minInt32Value = 0,
.maxInt32Value = 3,
},
- defaultconfig_impl::VehicleAreaConfig{
+ VehicleAreaConfig{
.areaId = SEAT_1_RIGHT,
.minInt32Value = 0,
.maxInt32Value = 3,
@@ -560,38 +529,38 @@
.initialValue =
{.int32Values = {0}}}, // 0 is off and +ve values indicate ventilation level.
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_STEERING_WHEEL_HEAT),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{
+ {.config = {.prop = toInt(VehicleProperty::HVAC_STEERING_WHEEL_HEAT),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{
.areaId = (0), .minInt32Value = -2, .maxInt32Value = 2}}},
.initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_SEAT_TEMPERATURE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{
+ {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_TEMPERATURE),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{
.areaId = SEAT_1_LEFT,
.minInt32Value = -2,
.maxInt32Value = 2,
},
- defaultconfig_impl::VehicleAreaConfig{
+ VehicleAreaConfig{
.areaId = SEAT_1_RIGHT,
.minInt32Value = -2,
.maxInt32Value = 2,
}}},
.initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_TEMPERATURE_SET),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {160, 280, 5, 605, 825, 10},
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{
+ .areaConfigs = {VehicleAreaConfig{
.areaId = HVAC_LEFT,
.minFloatValue = 16,
.maxFloatValue = 32,
},
- defaultconfig_impl::VehicleAreaConfig{
+ VehicleAreaConfig{
.areaId = HVAC_RIGHT,
.minFloatValue = 16,
.maxFloatValue = 32,
@@ -601,99 +570,90 @@
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
- .initialValue = {.floatValues = {66.2f, (float)defaultconfig_impl::VehicleUnit::FAHRENHEIT,
- 19.0f, 66.5f}}},
+ .initialValue = {.floatValues = {66.2f, (float)VehicleUnit::FAHRENHEIT, 19.0f, 66.5f}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::ENV_OUTSIDE_TEMPERATURE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
+ .prop = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE),
+ .access = VehiclePropertyAccess::READ,
// TODO(bryaneyler): Support ON_CHANGE as well.
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 1.0f,
.maxSampleRate = 2.0f,
},
.initialValue = {.floatValues = {25.0f}}},
- {.config = {.prop = toInt(
- defaultconfig_impl::VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .configArray = {toInt(defaultconfig_impl::VehicleUnit::FAHRENHEIT),
- toInt(defaultconfig_impl::VehicleUnit::CELSIUS)}},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::FAHRENHEIT)}}},
+ {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {toInt(VehicleUnit::FAHRENHEIT), toInt(VehicleUnit::CELSIUS)}},
+ .initialValue = {.int32Values = {toInt(VehicleUnit::FAHRENHEIT)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::DISTANCE_DISPLAY_UNITS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = (0)}},
- .configArray = {toInt(defaultconfig_impl::VehicleUnit::KILOMETER),
- toInt(defaultconfig_impl::VehicleUnit::MILE)},
+ .prop = toInt(VehicleProperty::DISTANCE_DISPLAY_UNITS),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
+ .configArray = {toInt(VehicleUnit::KILOMETER), toInt(VehicleUnit::MILE)},
},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::MILE)}}},
+ .initialValue = {.int32Values = {toInt(VehicleUnit::MILE)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::NIGHT_MODE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::NIGHT_MODE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::GEAR_SELECTION),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .configArray = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK),
- toInt(defaultconfig_impl::VehicleGear::GEAR_NEUTRAL),
- toInt(defaultconfig_impl::VehicleGear::GEAR_REVERSE),
- toInt(defaultconfig_impl::VehicleGear::GEAR_DRIVE),
- toInt(defaultconfig_impl::VehicleGear::GEAR_1),
- toInt(defaultconfig_impl::VehicleGear::GEAR_2),
- toInt(defaultconfig_impl::VehicleGear::GEAR_3),
- toInt(defaultconfig_impl::VehicleGear::GEAR_4),
- toInt(defaultconfig_impl::VehicleGear::GEAR_5)},
+ .prop = toInt(VehicleProperty::GEAR_SELECTION),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {toInt(VehicleGear::GEAR_PARK),
+ toInt(VehicleGear::GEAR_NEUTRAL),
+ toInt(VehicleGear::GEAR_REVERSE),
+ toInt(VehicleGear::GEAR_DRIVE), toInt(VehicleGear::GEAR_1),
+ toInt(VehicleGear::GEAR_2), toInt(VehicleGear::GEAR_3),
+ toInt(VehicleGear::GEAR_4), toInt(VehicleGear::GEAR_5)},
},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK)}}},
+ .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::TURN_SIGNAL_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::TURN_SIGNAL_STATE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleTurnSignal::NONE)}}},
+ .initialValue = {.int32Values = {toInt(VehicleTurnSignal::NONE)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::IGNITION_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::IGNITION_STATE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleIgnitionState::ON)}}},
+ .initialValue = {.int32Values = {toInt(VehicleIgnitionState::ON)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_OIL_LEVEL),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleOilLevel::NORMAL)}}},
+ .initialValue = {.int32Values = {toInt(VehicleOilLevel::NORMAL)}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_OIL_TEMP),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .prop = toInt(VehicleProperty::ENGINE_OIL_TEMP),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 0.1, // 0.1 Hz, every 10 seconds
.maxSampleRate = 10, // 10 Hz, every 100 ms
},
@@ -701,8 +661,8 @@
{
.config = {.prop = kMixedTypePropertyForTest,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0}},
.initialValue =
{
@@ -712,70 +672,69 @@
},
},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DOOR_LOCK),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_LEFT},
- defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT},
- defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_LEFT},
- defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}},
+ {.config = {.prop = toInt(VehicleProperty::DOOR_LOCK),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT},
+ VehicleAreaConfig{.areaId = DOOR_1_RIGHT},
+ VehicleAreaConfig{.areaId = DOOR_2_LEFT},
+ VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}},
.initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}},
{DOOR_1_RIGHT, {.int32Values = {1}}},
{DOOR_2_LEFT, {.int32Values = {1}}},
{DOOR_2_RIGHT, {.int32Values = {1}}}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DOOR_POS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ {.config = {.prop = toInt(VehicleProperty::DOOR_POS),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs =
- {defaultconfig_impl::VehicleAreaConfig{
+ {VehicleAreaConfig{
.areaId = DOOR_1_LEFT, .minInt32Value = 0, .maxInt32Value = 1},
- defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT,
- .minInt32Value = 0,
- .maxInt32Value = 1},
- defaultconfig_impl::VehicleAreaConfig{
+ VehicleAreaConfig{.areaId = DOOR_1_RIGHT,
+ .minInt32Value = 0,
+ .maxInt32Value = 1},
+ VehicleAreaConfig{
.areaId = DOOR_2_LEFT, .minInt32Value = 0, .maxInt32Value = 1},
- defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT,
- .minInt32Value = 0,
- .maxInt32Value = 1},
- defaultconfig_impl::VehicleAreaConfig{
+ VehicleAreaConfig{.areaId = DOOR_2_RIGHT,
+ .minInt32Value = 0,
+ .maxInt32Value = 1},
+ VehicleAreaConfig{
.areaId = DOOR_REAR, .minInt32Value = 0, .maxInt32Value = 1}}},
.initialValue = {.int32Values = {0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::WINDOW_LOCK),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{
- .areaId = WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT}}},
+ {.config = {.prop = toInt(VehicleProperty::WINDOW_LOCK),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_RIGHT | WINDOW_2_LEFT |
+ WINDOW_2_RIGHT}}},
.initialAreaValues = {{WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT,
{.int32Values = {0}}}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::WINDOW_POS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_1_LEFT,
- .minInt32Value = 0,
- .maxInt32Value = 10},
- defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_1_RIGHT,
- .minInt32Value = 0,
- .maxInt32Value = 10},
- defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_2_LEFT,
- .minInt32Value = 0,
- .maxInt32Value = 10},
- defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_2_RIGHT,
- .minInt32Value = 0,
- .maxInt32Value = 10},
- defaultconfig_impl::VehicleAreaConfig{
- .areaId = WINDOW_ROOF_TOP_1,
- .minInt32Value = -10,
- .maxInt32Value = 10}}},
+ {.config = {.prop = toInt(VehicleProperty::WINDOW_POS),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_LEFT,
+ .minInt32Value = 0,
+ .maxInt32Value = 10},
+ VehicleAreaConfig{.areaId = WINDOW_1_RIGHT,
+ .minInt32Value = 0,
+ .maxInt32Value = 10},
+ VehicleAreaConfig{.areaId = WINDOW_2_LEFT,
+ .minInt32Value = 0,
+ .maxInt32Value = 10},
+ VehicleAreaConfig{.areaId = WINDOW_2_RIGHT,
+ .minInt32Value = 0,
+ .maxInt32Value = 10},
+ VehicleAreaConfig{.areaId = WINDOW_ROOF_TOP_1,
+ .minInt32Value = -10,
+ .maxInt32Value = 10}}},
.initialValue = {.int32Values = {0}}},
{.config =
{
.prop = WHEEL_TICK,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.configArray = {ALL_WHEELS, 50000, 50000, 50000, 50000},
.minSampleRate = 1.0f,
.maxSampleRate = 10.0f,
@@ -783,371 +742,324 @@
.initialValue = {.int64Values = {0, 100000, 200000, 300000, 400000}}},
{.config = {.prop = ABS_ACTIVE,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE},
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
.initialValue = {.int32Values = {0}}},
{.config = {.prop = TRACTION_CONTROL_ACTIVE,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE},
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
.initialValue = {.int32Values = {0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::AP_POWER_STATE_REQ),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {3}},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleApPowerStateReq::ON),
- 0}}},
+ .initialValue = {.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::AP_POWER_STATE_REPORT),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE},
- .initialValue =
- {.int32Values =
- {toInt(defaultconfig_impl::VehicleApPowerStateReport::WAIT_FOR_VHAL),
- 0}}},
+ {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
+ .initialValue = {.int32Values = {toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL), 0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DISPLAY_BRIGHTNESS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.minInt32Value = 0,
- .maxInt32Value = 100}}},
+ {.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.minInt32Value = 0, .maxInt32Value = 100}}},
.initialValue = {.int32Values = {100}}},
{
.config = {.prop = OBD2_LIVE_FRAME,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0, 0}},
},
{
.config = {.prop = OBD2_FREEZE_FRAME,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0, 0}},
},
{
.config = {.prop = OBD2_FREEZE_FRAME_INFO,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE},
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
},
{
.config = {.prop = OBD2_FREEZE_FRAME_CLEAR,
- .access = defaultconfig_impl::VehiclePropertyAccess::WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {1}},
},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::HEADLIGHTS_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HEADLIGHTS_STATE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {LIGHT_STATE_ON}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::HIGH_BEAM_LIGHTS_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_STATE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {LIGHT_STATE_ON}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::FOG_LIGHTS_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::FOG_LIGHTS_STATE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {LIGHT_STATE_ON}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::HAZARD_LIGHTS_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HAZARD_LIGHTS_STATE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {LIGHT_STATE_ON}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::HEADLIGHTS_SWITCH),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HEADLIGHTS_SWITCH),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}},
{.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::FOG_LIGHTS_SWITCH),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::FOG_LIGHTS_SWITCH),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::HAZARD_LIGHTS_SWITCH),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::HAZARD_LIGHTS_SWITCH),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::EVS_SERVICE_REQUEST),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::EVS_SERVICE_REQUEST),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
- .initialValue = {.int32Values = {toInt(defaultconfig_impl::EvsServiceType::REARVIEW),
- toInt(defaultconfig_impl::EvsServiceState::OFF)}}},
+ .initialValue = {.int32Values = {toInt(EvsServiceType::REARVIEW),
+ toInt(EvsServiceState::OFF)}}},
{.config = {.prop = VEHICLE_MAP_SERVICE,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}},
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE}},
// Example Vendor Extension properties for testing
{.config = {.prop = VENDOR_EXTENSION_BOOLEAN_PROPERTY,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_LEFT},
- defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT},
- defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_LEFT},
- defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}},
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT},
+ VehicleAreaConfig{.areaId = DOOR_1_RIGHT},
+ VehicleAreaConfig{.areaId = DOOR_2_LEFT},
+ VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}},
.initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}},
{DOOR_1_RIGHT, {.int32Values = {1}}},
{DOOR_2_LEFT, {.int32Values = {0}}},
{DOOR_2_RIGHT, {.int32Values = {0}}}}},
{.config = {.prop = VENDOR_EXTENSION_FLOAT_PROPERTY,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_LEFT,
- .minFloatValue = -10,
- .maxFloatValue = 10},
- defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_RIGHT,
- .minFloatValue = -10,
- .maxFloatValue = 10}}},
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_LEFT,
+ .minFloatValue = -10,
+ .maxFloatValue = 10},
+ VehicleAreaConfig{.areaId = HVAC_RIGHT,
+ .minFloatValue = -10,
+ .maxFloatValue = 10}}},
.initialAreaValues = {{HVAC_LEFT, {.floatValues = {1}}},
{HVAC_RIGHT, {.floatValues = {2}}}}},
{.config = {.prop = VENDOR_EXTENSION_INT_PROPERTY,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs =
- {defaultconfig_impl::VehicleAreaConfig{
- .areaId = toInt(defaultconfig_impl::VehicleAreaWindow::
- FRONT_WINDSHIELD),
- .minInt32Value = -100,
- .maxInt32Value = 100},
- defaultconfig_impl::VehicleAreaConfig{
- .areaId = toInt(defaultconfig_impl::VehicleAreaWindow::
- REAR_WINDSHIELD),
- .minInt32Value = -100,
- .maxInt32Value = 100},
- defaultconfig_impl::VehicleAreaConfig{
- .areaId = toInt(
- defaultconfig_impl::VehicleAreaWindow::ROOF_TOP_1),
- .minInt32Value = -100,
- .maxInt32Value = 100}}},
- .initialAreaValues = {{toInt(defaultconfig_impl::VehicleAreaWindow::FRONT_WINDSHIELD),
- {.int32Values = {1}}},
- {toInt(defaultconfig_impl::VehicleAreaWindow::REAR_WINDSHIELD),
- {.int32Values = {0}}},
- {toInt(defaultconfig_impl::VehicleAreaWindow::ROOF_TOP_1),
- {.int32Values = {-1}}}}},
+ {VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD),
+ .minInt32Value = -100,
+ .maxInt32Value = 100},
+ VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD),
+ .minInt32Value = -100,
+ .maxInt32Value = 100},
+ VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::ROOF_TOP_1),
+ .minInt32Value = -100,
+ .maxInt32Value = 100}}},
+ .initialAreaValues = {{toInt(VehicleAreaWindow::FRONT_WINDSHIELD), {.int32Values = {1}}},
+ {toInt(VehicleAreaWindow::REAR_WINDSHIELD), {.int32Values = {0}}},
+ {toInt(VehicleAreaWindow::ROOF_TOP_1), {.int32Values = {-1}}}}},
{.config = {.prop = VENDOR_EXTENSION_STRING_PROPERTY,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE},
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
.initialValue = {.stringValue = "Vendor String Property"}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::
- ELECTRONIC_TOLL_COLLECTION_CARD_TYPE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE},
+ {.config = {.prop = toInt(VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
.initialValue = {.int32Values = {0}}},
- {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::
- ELECTRONIC_TOLL_COLLECTION_CARD_STATUS),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE},
+ {.config = {.prop = toInt(VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
.initialValue = {.int32Values = {0}}},
{.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::
- SUPPORT_CUSTOMIZE_VENDOR_PERMISSION),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
- .configArray =
- {kMixedTypePropertyForTest,
- toInt(defaultconfig_impl::
- VehicleVendorPermission::
- PERMISSION_GET_VENDOR_CATEGORY_INFO),
- toInt(defaultconfig_impl::
- VehicleVendorPermission::
- PERMISSION_SET_VENDOR_CATEGORY_INFO),
- VENDOR_EXTENSION_INT_PROPERTY,
- toInt(defaultconfig_impl::
- VehicleVendorPermission::
- PERMISSION_GET_VENDOR_CATEGORY_SEAT),
- toInt(defaultconfig_impl::
- VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE),
- VENDOR_EXTENSION_FLOAT_PROPERTY,
- toInt(defaultconfig_impl::
- VehicleVendorPermission::PERMISSION_DEFAULT),
- toInt(defaultconfig_impl::
- VehicleVendorPermission::PERMISSION_DEFAULT)},
+ .prop = toInt(VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {kMixedTypePropertyForTest,
+ toInt(VehicleVendorPermission::
+ PERMISSION_GET_VENDOR_CATEGORY_INFO),
+ toInt(VehicleVendorPermission::
+ PERMISSION_SET_VENDOR_CATEGORY_INFO),
+ VENDOR_EXTENSION_INT_PROPERTY,
+ toInt(VehicleVendorPermission::
+ PERMISSION_GET_VENDOR_CATEGORY_SEAT),
+ toInt(VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE),
+ VENDOR_EXTENSION_FLOAT_PROPERTY,
+ toInt(VehicleVendorPermission::PERMISSION_DEFAULT),
+ toInt(VehicleVendorPermission::PERMISSION_DEFAULT)},
},
.initialValue = {.int32Values = {1}}},
{
.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::INITIAL_USER_INFO),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::INITIAL_USER_INFO),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::SWITCH_USER),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::SWITCH_USER),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::CREATE_USER),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::CREATE_USER),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::REMOVE_USER),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::REMOVE_USER),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::
- USER_IDENTIFICATION_ASSOCIATION),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::POWER_POLICY_REQ),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::POWER_POLICY_REQ),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::
- POWER_POLICY_GROUP_REQ),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::POWER_POLICY_GROUP_REQ),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::CURRENT_POWER_POLICY),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::CURRENT_POWER_POLICY),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::EPOCH_TIME),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::EPOCH_TIME),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::WATCHDOG_ALIVE),
- .access = defaultconfig_impl::VehiclePropertyAccess::WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::WATCHDOG_ALIVE),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::
- WATCHDOG_TERMINATED_PROCESS),
- .access = defaultconfig_impl::VehiclePropertyAccess::WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::WATCHDOG_TERMINATED_PROCESS),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::VHAL_HEARTBEAT),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::VHAL_HEARTBEAT),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::CLUSTER_SWITCH_UI),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::CLUSTER_SWITCH_UI),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
- .initialValue = {.int32Values = {0 /* ClusterHome */, -1 /* ClusterNone */}},
+ .initialValue = {.int32Values = {0 /* ClusterHome */}},
},
{
.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::CLUSTER_DISPLAY_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::CLUSTER_DISPLAY_STATE),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1,
-1, -1 /* Insets */}},
@@ -1155,41 +1067,34 @@
{
.config =
{
- .prop = toInt(
- defaultconfig_impl::VehicleProperty::CLUSTER_REPORT_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::CLUSTER_REPORT_STATE),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16},
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::
- CLUSTER_REQUEST_DISPLAY),
- .access = defaultconfig_impl::VehiclePropertyAccess::WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::CLUSTER_REQUEST_DISPLAY),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
- .prop = toInt(defaultconfig_impl::VehicleProperty::
- CLUSTER_NAVIGATION_STATE),
- .access = defaultconfig_impl::VehiclePropertyAccess::WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .prop = toInt(VehicleProperty::CLUSTER_NAVIGATION_STATE),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
.prop = PLACEHOLDER_PROPERTY_INT,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0}},
},
@@ -1197,9 +1102,8 @@
.config =
{
.prop = PLACEHOLDER_PROPERTY_FLOAT,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.floatValues = {0.0f}},
},
@@ -1207,9 +1111,8 @@
.config =
{
.prop = PLACEHOLDER_PROPERTY_BOOLEAN,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0 /* false */}},
},
@@ -1217,9 +1120,8 @@
.config =
{
.prop = PLACEHOLDER_PROPERTY_STRING,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.stringValue = {"Test"}},
},
@@ -1229,27 +1131,24 @@
.config =
{
.prop = VENDOR_CLUSTER_SWITCH_UI,
- .access = defaultconfig_impl::VehiclePropertyAccess::WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
.prop = VENDOR_CLUSTER_DISPLAY_STATE,
- .access = defaultconfig_impl::VehiclePropertyAccess::WRITE,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
.prop = VENDOR_CLUSTER_REPORT_STATE,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16},
},
.initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1,
@@ -1260,9 +1159,8 @@
.config =
{
.prop = VENDOR_CLUSTER_REQUEST_DISPLAY,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {0 /* ClusterHome */}},
},
@@ -1270,14 +1168,26 @@
.config =
{
.prop = VENDOR_CLUSTER_NAVIGATION_STATE,
- .access = defaultconfig_impl::VehiclePropertyAccess::READ,
- .changeMode =
- defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
#endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING
};
+} // namespace defaultconfig_impl
+
+// public namespace
+namespace defaultconfig {
+
+typedef defaultconfig_impl::ConfigDeclaration ConfigDeclaration;
+
+inline constexpr const std::vector<ConfigDeclaration>& getDefaultConfigs() {
+ return defaultconfig_impl::kVehicleProperties;
+}
+
+} // namespace defaultconfig
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp b/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp
index 6385ac1..baaae75 100644
--- a/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp
+++ b/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp
@@ -22,17 +22,19 @@
namespace hardware {
namespace automotive {
namespace vehicle {
+namespace defaultconfig {
namespace test {
TEST(DefaultConfigTest, loadDefaultConfigs) {
- for (ConfigDeclaration config : kVehicleProperties) {
+ for (ConfigDeclaration config : getDefaultConfigs()) {
ASSERT_NE(0, config.config.prop);
}
}
} // namespace test
+} // namespace defaultconfig
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
new file mode 100644
index 0000000..7670c25
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_library {
+ name: "VehicleHalProtoMessageConverter",
+ srcs: [
+ "src/*.cpp",
+ ],
+ vendor: true,
+ local_include_dirs: ["include"],
+ export_include_dirs: ["include"],
+ shared_libs: ["libprotobuf-cpp-full"],
+ static_libs: [
+ "VehicleHalProtos",
+ "VehicleHalUtils",
+ ],
+ defaults: ["VehicleHalDefaults"],
+ export_static_lib_headers: ["VehicleHalUtils"],
+}
+
+cc_test {
+ name: "VehicleHalProtoMessageConverterTest",
+ srcs: [
+ "test/*.cpp",
+ ],
+ vendor: true,
+ defaults: ["VehicleHalDefaults"],
+ shared_libs: ["libprotobuf-cpp-full"],
+ static_libs: [
+ "VehicleHalProtoMessageConverter",
+ "VehicleHalProtos",
+ "VehicleHalUtils",
+ "libgtest",
+ ],
+ header_libs: ["VehicleHalDefaultConfig"],
+ test_suites: ["device-tests"],
+}
diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h
new file mode 100644
index 0000000..1c26fe8
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_
+#define android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_
+
+#include <VehicleHalTypes.h>
+#include <android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h>
+#include <android/hardware/automotive/vehicle/VehiclePropConfig.pb.h>
+#include <android/hardware/automotive/vehicle/VehiclePropValue.pb.h>
+#include <android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.h>
+#include <android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.h>
+#include <android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.h>
+
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+namespace proto_msg_converter {
+
+// Convert AIDL VehiclePropConfig to Protobuf VehiclePropConfig.
+void aidlToProto(
+ const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& inAidlConfig,
+ ::android::hardware::automotive::vehicle::proto::VehiclePropConfig* outProtoConfig);
+// Convert Protobuf VehiclePropConfig to AIDL VehiclePropConfig.
+void protoToAidl(
+ const ::android::hardware::automotive::vehicle::proto::VehiclePropConfig& inProtoConfig,
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* outAidlConfig);
+// Convert AIDL VehiclePropValue to Protobuf VehiclePropValue.
+void aidlToProto(const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& inAidlVal,
+ ::android::hardware::automotive::vehicle::proto::VehiclePropValue* outProtoVal);
+// Convert Protobuf VehiclePropValue to AIDL VehiclePropValue.
+void protoToAidl(
+ const ::android::hardware::automotive::vehicle::proto::VehiclePropValue& inProtoVal,
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropValue* outAidlVal);
+
+} // namespace proto_msg_converter
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
+
+#endif // android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_
diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
new file mode 100644
index 0000000..6cbc7e5
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "ProtoMsgConverter"
+
+#include "ProtoMessageConverter.h"
+
+#include <VehicleUtils.h>
+
+#include <memory>
+#include <vector>
+
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+namespace proto_msg_converter {
+
+namespace aidl_vehicle = ::aidl::android::hardware::automotive::vehicle;
+namespace proto = ::android::hardware::automotive::vehicle::proto;
+
+// Copy the vector PROTO_VECNAME of protobuf class PROTO_VALUE to
+// VHAL_TYPE_VALUE->VHAL_TYPE_VECNAME, every element of PROTO_VECNAME is casted by CAST.
+#define CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE(PROTO_VALUE, PROTO_VECNAME, VHAL_TYPE_VALUE, \
+ VHAL_TYPE_VECNAME, CAST) \
+ do { \
+ (VHAL_TYPE_VALUE)->VHAL_TYPE_VECNAME.resize(PROTO_VALUE.PROTO_VECNAME##_size()); \
+ size_t idx = 0; \
+ for (auto& value : PROTO_VALUE.PROTO_VECNAME()) { \
+ VHAL_TYPE_VALUE->VHAL_TYPE_VECNAME[idx++] = CAST(value); \
+ } \
+ } while (0)
+
+// Copying the vector PROTO_VECNAME of protobuf class PROTO_VALUE to
+// VHAL_TYPE_VALUE->VHAL_TYPE_VECNAME.
+#define COPY_PROTOBUF_VEC_TO_VHAL_TYPE(PROTO_VALUE, PROTO_VECNAME, VHAL_TYPE_VALUE, \
+ VHAL_TYPE_VECNAME) \
+ CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE( \
+ PROTO_VALUE, PROTO_VECNAME, VHAL_TYPE_VALUE, VHAL_TYPE_VECNAME, /*NO CAST*/)
+
+void aidlToProto(const aidl_vehicle::VehiclePropConfig& in, proto::VehiclePropConfig* out) {
+ out->set_prop(in.prop);
+ out->set_access(static_cast<proto::VehiclePropertyAccess>(toInt(in.access)));
+ out->set_change_mode(static_cast<proto::VehiclePropertyChangeMode>(toInt(in.changeMode)));
+ out->set_config_string(in.configString.c_str(), in.configString.size());
+ out->set_min_sample_rate(in.minSampleRate);
+ out->set_max_sample_rate(in.maxSampleRate);
+
+ for (auto& configElement : in.configArray) {
+ out->add_config_array(configElement);
+ }
+
+ out->clear_area_configs();
+ for (auto& areaConfig : in.areaConfigs) {
+ auto* protoACfg = out->add_area_configs();
+ protoACfg->set_area_id(areaConfig.areaId);
+ protoACfg->set_min_int64_value(areaConfig.minInt64Value);
+ protoACfg->set_max_int64_value(areaConfig.maxInt64Value);
+ protoACfg->set_min_float_value(areaConfig.minFloatValue);
+ protoACfg->set_max_float_value(areaConfig.maxFloatValue);
+ protoACfg->set_min_int32_value(areaConfig.minInt32Value);
+ protoACfg->set_max_int32_value(areaConfig.maxInt32Value);
+ }
+}
+
+void protoToAidl(const proto::VehiclePropConfig& in, aidl_vehicle::VehiclePropConfig* out) {
+ out->prop = in.prop();
+ out->access = static_cast<aidl_vehicle::VehiclePropertyAccess>(in.access());
+ out->changeMode = static_cast<aidl_vehicle::VehiclePropertyChangeMode>(in.change_mode());
+ out->configString = in.config_string();
+ out->minSampleRate = in.min_sample_rate();
+ out->maxSampleRate = in.max_sample_rate();
+
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, config_array, out, configArray);
+
+ auto cast_to_acfg = [](const proto::VehicleAreaConfig& protoAcfg) {
+ return aidl_vehicle::VehicleAreaConfig{
+ .areaId = protoAcfg.area_id(),
+ .minInt32Value = protoAcfg.min_int32_value(),
+ .maxInt32Value = protoAcfg.max_int32_value(),
+ .minInt64Value = protoAcfg.min_int64_value(),
+ .maxInt64Value = protoAcfg.max_int64_value(),
+ .minFloatValue = protoAcfg.min_float_value(),
+ .maxFloatValue = protoAcfg.max_float_value(),
+ };
+ };
+ CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, area_configs, out, areaConfigs, cast_to_acfg);
+}
+
+void aidlToProto(const aidl_vehicle::VehiclePropValue& in, proto::VehiclePropValue* out) {
+ out->set_prop(in.prop);
+ out->set_timestamp(in.timestamp);
+ out->set_status(static_cast<proto::VehiclePropertyStatus>(in.status));
+ out->set_area_id(in.areaId);
+ out->set_string_value(in.value.stringValue);
+ out->set_byte_values(in.value.byteValues.data(), in.value.byteValues.size());
+
+ for (auto& int32Value : in.value.int32Values) {
+ out->add_int32_values(int32Value);
+ }
+
+ for (auto& int64Value : in.value.int64Values) {
+ out->add_int64_values(int64Value);
+ }
+
+ for (auto& floatValue : in.value.floatValues) {
+ out->add_float_values(floatValue);
+ }
+}
+
+void protoToAidl(const proto::VehiclePropValue& in, aidl_vehicle::VehiclePropValue* out) {
+ out->prop = in.prop();
+ out->timestamp = in.timestamp();
+ out->status = static_cast<aidl_vehicle::VehiclePropertyStatus>(in.status());
+ out->areaId = in.area_id();
+ out->value.stringValue = in.string_value();
+ for (const char& byte : in.byte_values()) {
+ out->value.byteValues.push_back(byte);
+ }
+
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, int32_values, out, value.int32Values);
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, int64_values, out, value.int64Values);
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, float_values, out, value.floatValues);
+}
+
+#undef COPY_PROTOBUF_VEC_TO_VHAL_TYPE
+#undef CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE
+
+} // namespace proto_msg_converter
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp
new file mode 100644
index 0000000..d5f2373
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vector>
+
+#include <DefaultConfig.h>
+#include <ProtoMessageConverter.h>
+#include <VehicleHalTypes.h>
+#include <android-base/format.h>
+#include <android/hardware/automotive/vehicle/VehiclePropConfig.pb.h>
+#include <android/hardware/automotive/vehicle/VehiclePropValue.pb.h>
+#include <gtest/gtest.h>
+
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+namespace proto_msg_converter {
+
+namespace {
+
+namespace proto = ::android::hardware::automotive::vehicle::proto;
+namespace aidl_vehicle = ::aidl::android::hardware::automotive::vehicle;
+
+std::vector<aidl_vehicle::VehiclePropConfig> prepareTestConfigs() {
+ std::vector<aidl_vehicle::VehiclePropConfig> configs;
+ for (auto& property : defaultconfig::getDefaultConfigs()) {
+ configs.push_back(property.config);
+ }
+ return configs;
+}
+
+std::vector<aidl_vehicle::VehiclePropValue> prepareTestValues() {
+ std::vector<aidl_vehicle::VehiclePropValue> values;
+ long timestamp = 1;
+ for (auto& property : defaultconfig::getDefaultConfigs()) {
+ values.push_back({
+ .timestamp = timestamp,
+ .areaId = 123,
+ .prop = property.config.prop,
+ .value = property.initialValue,
+ .status = aidl_vehicle::VehiclePropertyStatus::ERROR,
+ });
+ }
+ return values;
+}
+
+class PropConfigConversionTest : public testing::TestWithParam<aidl_vehicle::VehiclePropConfig> {};
+
+class PropValueConversionTest : public testing::TestWithParam<aidl_vehicle::VehiclePropValue> {};
+
+} // namespace
+
+TEST_P(PropConfigConversionTest, testConversion) {
+ proto::VehiclePropConfig protoCfg;
+ aidl_vehicle::VehiclePropConfig aidlCfg;
+
+ aidlToProto(GetParam(), &protoCfg);
+ protoToAidl(protoCfg, &aidlCfg);
+
+ EXPECT_EQ(aidlCfg, GetParam());
+}
+
+TEST_P(PropValueConversionTest, testConversion) {
+ proto::VehiclePropValue protoVal;
+ aidl_vehicle::VehiclePropValue aidlVal;
+
+ aidlToProto(GetParam(), &protoVal);
+ protoToAidl(protoVal, &aidlVal);
+
+ EXPECT_EQ(aidlVal, GetParam());
+}
+
+INSTANTIATE_TEST_SUITE_P(DefaultConfigs, PropConfigConversionTest,
+ ::testing::ValuesIn(prepareTestConfigs()),
+ [](const ::testing::TestParamInfo<aidl_vehicle::VehiclePropConfig>& info) {
+ return ::fmt::format("property_{:d}", info.param.prop);
+ });
+
+INSTANTIATE_TEST_SUITE_P(TestValues, PropValueConversionTest,
+ ::testing::ValuesIn(prepareTestValues()),
+ [](const ::testing::TestParamInfo<aidl_vehicle::VehiclePropValue>& info) {
+ return ::fmt::format("property_{:d}", info.param.prop);
+ });
+
+} // namespace proto_msg_converter
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
diff --git a/automotive/vehicle/aidl/impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/hardware/Android.bp
new file mode 100644
index 0000000..edb0f29
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/hardware/Android.bp
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_library_headers {
+ name: "IVehicleHardware",
+ vendor: true,
+ export_include_dirs: [
+ "include",
+ ],
+ header_libs: [
+ "VehicleHalUtilHeaders",
+ ],
+ export_header_lib_headers: [
+ "VehicleHalUtilHeaders",
+ ],
+}
diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
new file mode 100644
index 0000000..981088a
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_automotive_vehicle_aidl_impl_hardware_include_IVehicleHardware_H_
+#define android_hardware_automotive_vehicle_aidl_impl_hardware_include_IVehicleHardware_H_
+
+#include <VehicleHalTypes.h>
+
+#include <vector>
+
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+
+// A structure used to return dumped information.
+struct DumpResult {
+ // If callerShouldDumpState is true, caller would print the information in buffer and
+ // continue to dump its state, otherwise would just dump the buffer and skip its own
+ // dumping logic.
+ bool callerShouldDumpState;
+ // The dumped information for the caller to print.
+ std::string buffer;
+};
+
+// A request type for 'setValues' or 'getValues' method.
+struct VehiclePropValueRequest {
+ // A unique request ID set by the sender.
+ int requestId;
+ // The property to get/set.
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropValue value;
+};
+
+// A structure to represent a set value error event reported from vehicle.
+struct SetValueErrorEvent {
+ ::aidl::android::hardware::automotive::vehicle::StatusCode errorCode;
+ int32_t propId;
+ int32_t areaId;
+};
+
+// An abstract interface to access vehicle hardware.
+// For virtualized VHAL, GrpcVehicleHardware would communicate with a VehicleHardware
+// implementation in another VM through GRPC. For non-virtualzied VHAL, VHAL directly communicates
+// with a VehicleHardware through this interface.
+class IVehicleHardware {
+ public:
+ virtual ~IVehicleHardware() = default;
+
+ // Get all the property configs.
+ virtual std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
+ getAllPropertyConfigs() const = 0;
+
+ // Set property values asynchronously. Server could return before the property set requests
+ // are sent to vehicle bus or before property set confirmation is received. The callback is
+ // safe to be called after the function returns and is safe to be called in a different thread.
+ virtual ::aidl::android::hardware::automotive::vehicle::StatusCode setValues(
+ std::function<void(const std::vector<
+ ::aidl::android::hardware::automotive::vehicle::SetValueResult>&)>&&
+ callback,
+ const std::vector<VehiclePropValueRequest>& requests) = 0;
+
+ // Get property values asynchronously. Server could return before the property values are ready.
+ // The callback is safe to be called after the function returns and is safe to be called in a
+ // different thread.
+ virtual ::aidl::android::hardware::automotive::vehicle::StatusCode getValues(
+ std::function<void(const std::vector<
+ ::aidl::android::hardware::automotive::vehicle::GetValueResult>&)>&&
+ callback,
+ const std::vector<VehiclePropValueRequest>& requests) const = 0;
+
+ // Dump debug information in the server.
+ virtual DumpResult dump(const std::vector<std::string>& options) = 0;
+
+ // Check whether the system is healthy, return {@code StatusCode::OK} for healthy.
+ virtual ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() = 0;
+
+ // Register a callback that would be called when there is a property change event from vehicle.
+ virtual void registerOnPropertyChangeEvent(
+ std::function<void(const std::vector<::aidl::android::hardware::automotive::vehicle::
+ VehiclePropValue>&)>&& callback) = 0;
+
+ // Register a callback that would be called when there is a property set error event from
+ // vehicle.
+ virtual void registerOnPropertySetErrorEvent(
+ std::function<void(const std::vector<SetValueErrorEvent>&)>&& callback) = 0;
+};
+
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
+
+#endif // android_hardware_automotive_vehicle_aidl_impl_hardware_include_IVehicleHardware_H_
diff --git a/automotive/vehicle/aidl/impl/proto/Android.bp b/automotive/vehicle/aidl/impl/proto/Android.bp
new file mode 100644
index 0000000..709307d
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/Android.bp
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+filegroup {
+ name: "VehicleHalProtoFiles",
+ srcs: ["**/*.proto"],
+ visibility: ["//hardware/interfaces/automotive/vehicle:__subpackages__"],
+}
+
+genrule {
+ name: "VehicleProtoStub_h",
+ tools: [
+ "aprotoc",
+ "protoc-gen-grpc-cpp-plugin",
+ ],
+ cmd: "$(location aprotoc) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
+ srcs: [
+ ":VehicleHalProtoFiles",
+ ],
+ out: [
+ "android/hardware/automotive/vehicle/DumpResult.pb.h",
+ "android/hardware/automotive/vehicle/StatusCode.pb.h",
+ "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h",
+ "android/hardware/automotive/vehicle/VehiclePropConfig.pb.h",
+ "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.h",
+ "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.h",
+ "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.h",
+ "android/hardware/automotive/vehicle/VehiclePropValue.pb.h",
+ "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.h",
+ ],
+}
+
+genrule {
+ name: "VehicleProtoStub_cc",
+ tools: [
+ "aprotoc",
+ "protoc-gen-grpc-cpp-plugin",
+ ],
+ cmd: "$(location aprotoc) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
+ srcs: [
+ ":VehicleHalProtoFiles",
+ ],
+ out: [
+ "android/hardware/automotive/vehicle/DumpResult.pb.cc",
+ "android/hardware/automotive/vehicle/StatusCode.pb.cc",
+ "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.cc",
+ "android/hardware/automotive/vehicle/VehiclePropConfig.pb.cc",
+ "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.cc",
+ "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.cc",
+ "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.cc",
+ "android/hardware/automotive/vehicle/VehiclePropValue.pb.cc",
+ "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.cc",
+ ],
+}
+
+cc_library_static {
+ name: "VehicleHalProtos",
+ vendor: true,
+ host_supported: true,
+ include_dirs: [
+ "external/protobuf/src",
+ ],
+ generated_headers: [
+ "VehicleProtoStub_h",
+ ],
+ export_generated_headers: [
+ "VehicleProtoStub_h",
+ ],
+ generated_sources: [
+ "VehicleProtoStub_cc",
+ ],
+ shared_libs: [
+ "libgrpc++_unsecure",
+ ],
+ cflags: [
+ "-Wno-unused-parameter",
+ ],
+}
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpResult.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpResult.proto
new file mode 100644
index 0000000..25bb7d4
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpResult.proto
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+message DumpResult {
+ /* If callerShouldDumpState is true, caller would print the information in buffer and
+ * continue to dump its state, otherwise would just dump the buffer and skip its own
+ * dumping logic. */
+ bool caller_should_dump_state = 1;
+ /* The dumped information for the caller to print. */
+ string buffer = 2;
+}
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto
new file mode 100644
index 0000000..97cb0f8
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+/* Must be in sync with StatusCode.aidl. */
+enum StatusCode {
+ OK = 0;
+
+ /* Try again. */
+ TRY_AGAIN = 1;
+
+ /* Invalid argument provided. */
+ INVALID_ARG = 2;
+
+ /* This code must be returned when device that associated with the vehicle
+ * property is not available. For example, when client tries to set HVAC
+ * temperature when the whole HVAC unit is turned OFF. */
+ NOT_AVAILABLE = 3;
+
+ /* Access denied */
+ ACCESS_DENIED = 4;
+
+ /* Something unexpected has happened in Vehicle HAL */
+ INTERNAL_ERROR = 5;
+};
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
new file mode 100644
index 0000000..b5b7e80
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+/* Must be in sync with VehicleAreaConfig.aidl. */
+message VehicleAreaConfig {
+ /* Area id is ignored for VehiclePropertyGroup:GLOBAL properties. */
+ int32 area_id = 1;
+
+ /* If the property has @data_enum, leave the range to zero.
+ *
+ * Range will be ignored in the following cases:
+ * - The VehiclePropertyType is not INT32, INT64 or FLOAT.
+ * - Both of min value and max value are zero. */
+ int32 min_int32_value = 2;
+ int32 max_int32_value = 3;
+
+ int64 min_int64_value = 4;
+ int64 max_int64_value = 5;
+
+ float min_float_value = 6;
+ float max_float_value = 7;
+};
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropConfig.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropConfig.proto
new file mode 100644
index 0000000..e230d15
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropConfig.proto
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+import "android/hardware/automotive/vehicle/VehicleAreaConfig.proto";
+import "android/hardware/automotive/vehicle/VehiclePropertyAccess.proto";
+import "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto";
+
+/* Must be in sync with VehiclePropConfig.aidl. */
+message VehiclePropConfig {
+ /* Property identifier */
+ int32 prop = 1;
+
+ /* Defines if the property is read or write or both. */
+ VehiclePropertyAccess access = 2;
+
+ /* Defines the change mode of the property. */
+ VehiclePropertyChangeMode change_mode = 3;
+
+ /* Contains per-area configuration. */
+ repeated VehicleAreaConfig area_configs = 4;
+
+ /* Contains additional configuration parameters */
+ repeated int32 config_array = 5;
+
+ /* Some properties may require additional information passed over this
+ * string. Most properties do not need to set this. */
+ bytes config_string = 6;
+
+ /* Min sample rate in Hz.
+ * Must be defined for VehiclePropertyChangeMode::CONTINUOUS */
+ float min_sample_rate = 7;
+
+ /* Must be defined for VehiclePropertyChangeMode::CONTINUOUS
+ * Max sample rate in Hz. */
+ float max_sample_rate = 8;
+};
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto
new file mode 100644
index 0000000..80c73cb
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+import "android/hardware/automotive/vehicle/VehiclePropertyStatus.proto";
+
+/* Must be in sync with VehiclePropValue.aidl. */
+message VehiclePropValue {
+ /* Time is elapsed nanoseconds since boot */
+ int64 timestamp = 1;
+
+ /* Area type(s) for non-global property it must be one of the value from
+ * VehicleArea* enums or 0 for global properties. */
+ int32 area_id = 2;
+
+ /* Property identifier */
+ int32 prop = 3;
+
+ /* Status of the property */
+ VehiclePropertyStatus status = 4;
+
+ /* This is used for properties of types VehiclePropertyType#INT
+ * and VehiclePropertyType#INT_VEC */
+ repeated int32 int32_values = 5;
+
+ /* This is used for properties of types VehiclePropertyType#FLOAT
+ * and VehiclePropertyType#FLOAT_VEC */
+ repeated float float_values = 6;
+
+ /* This is used for properties of type VehiclePropertyType#INT64 */
+ repeated int64 int64_values = 7;
+
+ /* This is used for properties of type VehiclePropertyType#BYTES */
+ bytes byte_values = 8;
+
+ /* This is used for properties of type VehiclePropertyType#STRING */
+ string string_value = 9;
+};
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto
new file mode 100644
index 0000000..b16daa8
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+import "android/hardware/automotive/vehicle/VehiclePropValue.proto";
+
+message VehiclePropValueRequest {
+ int32 request_id = 1;
+ VehiclePropValue value = 2;
+};
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyAccess.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyAccess.proto
new file mode 100644
index 0000000..55840f0
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyAccess.proto
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+/* Must be in sync with VehiclePropertyAccess.aidl. */
+enum VehiclePropertyAccess {
+ NONE = 0;
+ READ = 1;
+ WRITE = 2;
+ READ_WRITE = 3;
+};
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto
new file mode 100644
index 0000000..c681e3b
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+/* Must be in sync with VehiclePropertyChangeMode.aidl. */
+enum VehiclePropertyChangeMode {
+ /* Property of this type must never be changed. Subscription is not supported
+ * for these properties. */
+ STATIC = 0;
+
+ /* Properties of this type must report when there is a change.
+ * IVehicle#get call must return the current value.
+ * Set operation for this property is assumed to be asynchronous. When the
+ * property is read (using IVehicle#get) after IVehicle#set, it may still
+ * return old value until underlying H/W backing this property has actually
+ * changed the state. Once state is changed, the property must dispatch
+ * changed value as event. */
+ ON_CHANGE = 1;
+
+ /* Properties of this type change continuously and require a fixed rate of
+ * sampling to retrieve the data. Implementers may choose to send extra
+ * notifications on significant value changes. */
+ CONTINUOUS = 2;
+};
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyStatus.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyStatus.proto
new file mode 100644
index 0000000..a44c8f0
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyStatus.proto
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+/* Must be in sync with VehiclePropertyStatus.aidl. */
+enum VehiclePropertyStatus {
+ /* Property is available and behaving normally */
+ AVAILABLE = 0;
+ /* A property in this state is not available for reading and writing. This
+ * is a transient state that depends on the availability of the underlying
+ * implementation (e.g. hardware or driver). It MUST NOT be used to
+ * represent features that this vehicle is always incapable of. A get() of
+ * a property in this state MAY return an undefined value, but MUST
+ * correctly describe its status as UNAVAILABLE A set() of a property in
+ * this state MAY return NOT_AVAILABLE. The HAL implementation MUST ignore
+ * the value of the status field when writing a property value coming from
+ * Android. */
+ UNAVAILABLE = 1;
+ /* There is an error with this property. */
+ ERROR = 2;
+};
diff --git a/automotive/vehicle/aidl/impl/utils/common/Android.bp b/automotive/vehicle/aidl/impl/utils/common/Android.bp
index 001280f..ace505d 100644
--- a/automotive/vehicle/aidl/impl/utils/common/Android.bp
+++ b/automotive/vehicle/aidl/impl/utils/common/Android.bp
@@ -20,9 +20,7 @@
cc_library {
name: "VehicleHalUtils",
- srcs: [
- "src/*.cpp",
- ],
+ srcs: ["src/*.cpp"],
vendor: true,
local_include_dirs: ["include"],
export_include_dirs: ["include"],
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h
new file mode 100644
index 0000000..61e475a
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h
@@ -0,0 +1,294 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef android_hardware_automotive_vehicle_utils_include_VehicleObjectPool_H_
+#define android_hardware_automotive_vehicle_utils_include_VehicleObjectPool_H_
+
+#include <deque>
+#include <map>
+#include <memory>
+#include <mutex>
+
+#include <VehicleHalTypes.h>
+
+#include <android-base/thread_annotations.h>
+
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+
+// Handy metric mostly for unit tests and debug.
+#define INC_METRIC_IF_DEBUG(val) PoolStats::instance()->val++;
+
+struct PoolStats {
+ std::atomic<uint32_t> Obtained{0};
+ std::atomic<uint32_t> Created{0};
+ std::atomic<uint32_t> Recycled{0};
+ std::atomic<uint32_t> Deleted{0};
+
+ static PoolStats* instance() {
+ static PoolStats inst;
+ return &inst;
+ }
+};
+
+template <typename T>
+struct Deleter {
+ using OnDeleteFunc = std::function<void(T*)>;
+
+ explicit Deleter(const OnDeleteFunc& f) : mOnDelete(f){};
+
+ Deleter() = default;
+ Deleter(const Deleter&) = default;
+
+ void operator()(T* o) { mOnDelete(o); }
+
+ private:
+ OnDeleteFunc mOnDelete;
+};
+
+// This is std::unique_ptr<> with custom delete operation that typically moves the pointer it holds
+// back to ObjectPool.
+template <typename T>
+using recyclable_ptr = typename std::unique_ptr<T, Deleter<T>>;
+
+// Generic abstract object pool class. Users of this class must implement {@Code createObject}.
+//
+// This class is thread-safe. Concurrent calls to {@Code obtain} from multiple threads is OK, also
+// client can obtain an object in one thread and then move ownership to another thread.
+template <typename T>
+class ObjectPool {
+ public:
+ using GetSizeFunc = std::function<size_t(const T&)>;
+
+ ObjectPool(size_t maxPoolObjectsSize, GetSizeFunc getSizeFunc)
+ : mMaxPoolObjectsSize(maxPoolObjectsSize), mGetSizeFunc(getSizeFunc){};
+ virtual ~ObjectPool() = default;
+
+ virtual recyclable_ptr<T> obtain() {
+ std::lock_guard<std::mutex> lock(mLock);
+ INC_METRIC_IF_DEBUG(Obtained)
+ if (mObjects.empty()) {
+ INC_METRIC_IF_DEBUG(Created)
+ return wrap(createObject());
+ }
+
+ auto o = wrap(mObjects.front().release());
+ mObjects.pop_front();
+ mPoolObjectsSize -= mGetSizeFunc(*o);
+ return o;
+ }
+
+ ObjectPool& operator=(const ObjectPool&) = delete;
+ ObjectPool(const ObjectPool&) = delete;
+
+ protected:
+ virtual T* createObject() = 0;
+
+ virtual void recycle(T* o) {
+ std::lock_guard<std::mutex> lock(mLock);
+ size_t objectSize = mGetSizeFunc(*o);
+
+ if (objectSize > mMaxPoolObjectsSize ||
+ mPoolObjectsSize > mMaxPoolObjectsSize - objectSize) {
+ INC_METRIC_IF_DEBUG(Deleted)
+
+ // We have no space left in the pool.
+ delete o;
+ return;
+ }
+
+ INC_METRIC_IF_DEBUG(Recycled)
+
+ mObjects.push_back(std::unique_ptr<T>{o});
+ mPoolObjectsSize += objectSize;
+ }
+
+ const size_t mMaxPoolObjectsSize;
+
+ private:
+ const Deleter<T>& getDeleter() {
+ if (!mDeleter.get()) {
+ Deleter<T>* d =
+ new Deleter<T>(std::bind(&ObjectPool::recycle, this, std::placeholders::_1));
+ mDeleter.reset(d);
+ }
+ return *mDeleter.get();
+ }
+
+ recyclable_ptr<T> wrap(T* raw) { return recyclable_ptr<T>{raw, getDeleter()}; }
+
+ mutable std::mutex mLock;
+ std::deque<std::unique_ptr<T>> mObjects GUARDED_BY(mLock);
+ std::unique_ptr<Deleter<T>> mDeleter;
+ size_t mPoolObjectsSize GUARDED_BY(mLock);
+ GetSizeFunc mGetSizeFunc;
+};
+
+#undef INC_METRIC_IF_DEBUG
+
+// This class provides a pool of recyclable VehiclePropertyValue objects.
+//
+// It has only one overloaded public method - obtain(...), users must call this method when new
+// object is needed with given VehiclePropertyType and vector size (for vector properties). This
+// method returns a recyclable smart pointer to VehiclePropertyValue, essentially this is a
+// std::unique_ptr with custom delete function, so recyclable object has only one owner and
+// developers can safely pass it around. Once this object goes out of scope, it will be returned to
+// the object pool.
+//
+// Some objects are not recyclable: strings and vector data types with vector
+// length > maxRecyclableVectorSize (provided in the constructor). These objects will be deleted
+// immediately once the go out of scope. There's no synchronization penalty for these objects since
+// we do not store them in the pool.
+//
+// This class is thread-safe. Users can obtain an object in one thread and pass it to another.
+//
+// Sample usage:
+//
+// VehiclePropValuePool pool;
+// auto v = pool.obtain(VehiclePropertyType::INT32);
+// v->propId = VehicleProperty::HVAC_FAN_SPEED;
+// v->areaId = VehicleAreaSeat::ROW_1_LEFT;
+// v->timestamp = elapsedRealtimeNano();
+// v->value->int32Values[0] = 42;
+class VehiclePropValuePool {
+ public:
+ using RecyclableType =
+ recyclable_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>;
+
+ // Creates VehiclePropValuePool
+ //
+ // @param maxRecyclableVectorSize - vector value types (e.g. VehiclePropertyType::INT32_VEC)
+ // with size equal or less to this value will be stored in the pool. If users tries to obtain
+ // value with vector size greater than maxRecyclableVectorSize, user will receive a regular
+ // unique pointer instead of a recyclable pointer. The object would not be recycled once it
+ // goes out of scope, but would be deleted.
+ // @param maxPoolObjectsSize - The approximate upper bound of memory each internal recycling
+ // pool could take. We have 4 different type pools, each with 4 different vector size, so
+ // approximately this pool would at-most take 4 * 4 * 10240 = 160k memory.
+ VehiclePropValuePool(size_t maxRecyclableVectorSize = 4, size_t maxPoolObjectsSize = 10240)
+ : mMaxRecyclableVectorSize(maxRecyclableVectorSize),
+ mMaxPoolObjectsSize(maxPoolObjectsSize){};
+
+ // Obtain a recyclable VehiclePropertyValue object from the pool for the given type. If the
+ // given type is not MIXED or STRING, the internal value vector size would be set to 1.
+ // If the given type is MIXED or STRING, all the internal vector sizes would be initialized to
+ // 0.
+ RecyclableType obtain(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type);
+
+ // Obtain a recyclable VehiclePropertyValue object from the pool for the given type. If the
+ // given type is *_VEC or BYTES, the internal value vector size would be set to vectorSize. If
+ // the given type is BOOLEAN, INT32, FLOAT, or INT64, the internal value vector size would be
+ // set to 1. If the given type is MIXED or STRING, all the internal value vector sizes would be
+ // set to 0. vectorSize must be larger than 0.
+ RecyclableType obtain(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ size_t vectorSize);
+ // Obtain a recyclable VehicePropertyValue object that is a copy of src. If src does not contain
+ // any value or the src property type is not valid, this function would return an empty
+ // VehiclePropValue.
+ RecyclableType obtain(
+ const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& src);
+ // Obtain a recyclable boolean object.
+ RecyclableType obtainBoolean(bool value);
+ // Obtain a recyclable int32 object.
+ RecyclableType obtainInt32(int32_t value);
+ // Obtain a recyclable int64 object.
+ RecyclableType obtainInt64(int64_t value);
+ // Obtain a recyclable float object.
+ RecyclableType obtainFloat(float value);
+ // Obtain a recyclable float object.
+ RecyclableType obtainString(const char* cstr);
+ // Obtain a recyclable mixed object.
+ RecyclableType obtainComplex();
+
+ VehiclePropValuePool(VehiclePropValuePool&) = delete;
+ VehiclePropValuePool& operator=(VehiclePropValuePool&) = delete;
+
+ private:
+ static inline bool isSingleValueType(
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
+ return type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::
+ BOOLEAN ||
+ type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32 ||
+ type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64 ||
+ type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT;
+ }
+
+ static inline bool isComplexType(
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
+ return type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED ||
+ type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING;
+ }
+
+ bool isDisposable(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ size_t vectorSize) const {
+ return vectorSize > mMaxRecyclableVectorSize || isComplexType(type);
+ }
+
+ RecyclableType obtainDisposable(
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType valueType,
+ size_t vectorSize) const;
+ RecyclableType obtainRecyclable(
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ size_t vectorSize);
+
+ class InternalPool
+ : public ObjectPool<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> {
+ public:
+ InternalPool(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ size_t vectorSize, size_t maxPoolObjectsSize,
+ ObjectPool::GetSizeFunc getSizeFunc)
+ : ObjectPool(maxPoolObjectsSize, getSizeFunc),
+ mPropType(type),
+ mVectorSize(vectorSize) {}
+
+ protected:
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropValue* createObject() override;
+ void recycle(::aidl::android::hardware::automotive::vehicle::VehiclePropValue* o) override;
+
+ private:
+ bool check(::aidl::android::hardware::automotive::vehicle::RawPropValues* v);
+
+ template <typename VecType>
+ bool check(std::vector<VecType>* vec, bool isVectorType) {
+ return vec->size() == (isVectorType ? mVectorSize : 0);
+ }
+
+ private:
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType mPropType;
+ size_t mVectorSize;
+ };
+ const Deleter<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>
+ mDisposableDeleter{
+ [](::aidl::android::hardware::automotive::vehicle::VehiclePropValue* v) {
+ delete v;
+ }};
+
+ mutable std::mutex mLock;
+ const size_t mMaxRecyclableVectorSize;
+ const size_t mMaxPoolObjectsSize;
+ // A map with 'property_type' | 'value_vector_size' as key and a recyclable object pool as
+ // value. We would create a recyclable pool for each property type and vector size combination.
+ std::map<int32_t, std::unique_ptr<InternalPool>> mValueTypePools GUARDED_BY(mLock);
+};
+
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
+
+#endif // android_hardware_automotive_vehicle_utils_include_VehicleObjectPool_H_
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
index c4bf1d3..b02aaf7 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
@@ -18,6 +18,7 @@
#define android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleUtils_H_
#include <VehicleHalTypes.h>
+#include <utils/Log.h>
namespace android {
namespace hardware {
@@ -81,6 +82,104 @@
return nullptr;
}
+inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>
+createVehiclePropValueVec(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ size_t vecSize) {
+ auto val = std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>(
+ new ::aidl::android::hardware::automotive::vehicle::VehiclePropValue);
+ switch (type) {
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32:
+ [[fallthrough]];
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN:
+ vecSize = 1;
+ [[fallthrough]];
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC:
+ val->value.int32Values.resize(vecSize);
+ break;
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT:
+ vecSize = 1;
+ [[fallthrough]];
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC:
+ val->value.floatValues.resize(vecSize);
+ break;
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64:
+ vecSize = 1;
+ [[fallthrough]];
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC:
+ val->value.int64Values.resize(vecSize);
+ break;
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES:
+ val->value.byteValues.resize(vecSize);
+ break;
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING:
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED:
+ break; // Valid, but nothing to do.
+ default:
+ ALOGE("createVehiclePropValue: unknown type: %d", toInt(type));
+ val.reset(nullptr);
+ }
+ return val;
+}
+
+inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>
+createVehiclePropValue(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
+ return createVehiclePropValueVec(type, 1);
+}
+
+inline size_t getVehicleRawValueVectorSize(
+ const ::aidl::android::hardware::automotive::vehicle::RawPropValues& value,
+ ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
+ switch (type) {
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32: // fall
+ // through
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::
+ BOOLEAN: // fall through
+ return std::min(value.int32Values.size(), static_cast<size_t>(1));
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT:
+ return std::min(value.floatValues.size(), static_cast<size_t>(1));
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64:
+ return std::min(value.int64Values.size(), static_cast<size_t>(1));
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC:
+ return value.int32Values.size();
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC:
+ return value.floatValues.size();
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC:
+ return value.int64Values.size();
+ case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES:
+ return value.byteValues.size();
+ default:
+ ALOGE("getVehicleRawValueVectorSize: unknown type: %d", toInt(type));
+ return 0;
+ }
+}
+
+inline void copyVehicleRawValue(
+ ::aidl::android::hardware::automotive::vehicle::RawPropValues* dest,
+ const ::aidl::android::hardware::automotive::vehicle::RawPropValues& src) {
+ dest->int32Values = src.int32Values;
+ dest->floatValues = src.floatValues;
+ dest->int64Values = src.int64Values;
+ dest->byteValues = src.byteValues;
+ dest->stringValue = src.stringValue;
+}
+
+// getVehiclePropValueSize returns approximately how much memory 'value' would take. This should
+// only be used in a limited-size memory pool to set an upper bound for memory consumption.
+inline size_t getVehiclePropValueSize(
+ const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& prop) {
+ size_t size = 0;
+ size += sizeof(prop.timestamp);
+ size += sizeof(prop.areaId);
+ size += sizeof(prop.prop);
+ size += sizeof(prop.status);
+ size += prop.value.int32Values.size() * sizeof(int32_t);
+ size += prop.value.int64Values.size() * sizeof(int64_t);
+ size += prop.value.floatValues.size() * sizeof(float);
+ size += prop.value.byteValues.size() * sizeof(uint8_t);
+ size += prop.value.stringValue.size();
+ return size;
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp
new file mode 100644
index 0000000..0ff58f7
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "VehicleObjectPool"
+
+#include <VehicleObjectPool.h>
+
+#include <VehicleUtils.h>
+
+#include <assert.h>
+#include <utils/Log.h>
+
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+
+using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
+using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtain(VehiclePropertyType type) {
+ if (isComplexType(type)) {
+ return obtain(type, 0);
+ }
+ return obtain(type, 1);
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtain(VehiclePropertyType type,
+ size_t vectorSize) {
+ if (isSingleValueType(type)) {
+ vectorSize = 1;
+ } else if (isComplexType(type)) {
+ vectorSize = 0;
+ }
+ return isDisposable(type, vectorSize) ? obtainDisposable(type, vectorSize)
+ : obtainRecyclable(type, vectorSize);
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtain(const VehiclePropValue& src) {
+ VehiclePropertyType type = getPropType(src.prop);
+ size_t vectorSize = getVehicleRawValueVectorSize(src.value, type);
+ if (vectorSize == 0 && !isComplexType(type)) {
+ ALOGW("empty vehicle prop value, contains no content");
+ // Return any empty VehiclePropValue.
+ return RecyclableType{new VehiclePropValue, mDisposableDeleter};
+ }
+
+ auto dest = obtain(type, vectorSize);
+
+ dest->prop = src.prop;
+ dest->areaId = src.areaId;
+ dest->status = src.status;
+ dest->timestamp = src.timestamp;
+ copyVehicleRawValue(&dest->value, src.value);
+
+ return dest;
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainInt32(int32_t value) {
+ auto val = obtain(VehiclePropertyType::INT32);
+ val->value.int32Values[0] = value;
+ return val;
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainInt64(int64_t value) {
+ auto val = obtain(VehiclePropertyType::INT64);
+ val->value.int64Values[0] = value;
+ return val;
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainFloat(float value) {
+ auto val = obtain(VehiclePropertyType::FLOAT);
+ val->value.floatValues[0] = value;
+ return val;
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainString(const char* cstr) {
+ auto val = obtain(VehiclePropertyType::STRING);
+ val->value.stringValue = cstr;
+ return val;
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainComplex() {
+ return obtain(VehiclePropertyType::MIXED);
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainRecyclable(
+ VehiclePropertyType type, size_t vectorSize) {
+ std::lock_guard<std::mutex> lock(mLock);
+ assert(vectorSize > 0);
+
+ // VehiclePropertyType is not overlapping with vectorSize.
+ int32_t key = static_cast<int32_t>(type) | static_cast<int32_t>(vectorSize);
+ auto it = mValueTypePools.find(key);
+
+ if (it == mValueTypePools.end()) {
+ auto newPool(std::make_unique<InternalPool>(type, vectorSize, mMaxPoolObjectsSize,
+ getVehiclePropValueSize));
+ it = mValueTypePools.emplace(key, std::move(newPool)).first;
+ }
+ return it->second->obtain();
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainBoolean(bool value) {
+ return obtainInt32(value);
+}
+
+VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainDisposable(
+ VehiclePropertyType valueType, size_t vectorSize) const {
+ return RecyclableType{createVehiclePropValueVec(valueType, vectorSize).release(),
+ mDisposableDeleter};
+}
+
+void VehiclePropValuePool::InternalPool::recycle(VehiclePropValue* o) {
+ if (o == nullptr) {
+ ALOGE("Attempt to recycle nullptr");
+ return;
+ }
+
+ if (!check(&o->value)) {
+ ALOGE("Discarding value for prop 0x%x because it contains "
+ "data that is not consistent with this pool. "
+ "Expected type: %d, vector size: %zu",
+ o->prop, toInt(mPropType), mVectorSize);
+ delete o;
+ } else {
+ ObjectPool<VehiclePropValue>::recycle(o);
+ }
+}
+
+bool VehiclePropValuePool::InternalPool::check(RawPropValues* v) {
+ return check(&v->int32Values, (VehiclePropertyType::INT32 == mPropType ||
+ VehiclePropertyType::INT32_VEC == mPropType ||
+ VehiclePropertyType::BOOLEAN == mPropType)) &&
+ check(&v->floatValues, (VehiclePropertyType::FLOAT == mPropType ||
+ VehiclePropertyType::FLOAT_VEC == mPropType)) &&
+ check(&v->int64Values, (VehiclePropertyType::INT64 == mPropType ||
+ VehiclePropertyType::INT64_VEC == mPropType)) &&
+ check(&v->byteValues, VehiclePropertyType::BYTES == mPropType) &&
+ v->stringValue.size() == 0;
+}
+
+VehiclePropValue* VehiclePropValuePool::InternalPool::createObject() {
+ return createVehiclePropValueVec(mPropType, mVectorSize).release();
+}
+
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp
new file mode 100644
index 0000000..a62532c
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp
@@ -0,0 +1,381 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <thread>
+
+#include <gtest/gtest.h>
+
+#include <utils/SystemClock.h>
+
+#include <VehicleHalTypes.h>
+#include <VehicleObjectPool.h>
+#include <VehicleUtils.h>
+
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+
+namespace {
+
+using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
+
+struct TestPropertyTypeInfo {
+ VehiclePropertyType type;
+ bool recyclable;
+ size_t vecSize;
+};
+
+std::vector<TestPropertyTypeInfo> getAllPropertyTypes() {
+ return {
+ {
+ .type = VehiclePropertyType::INT32,
+ .recyclable = true,
+ .vecSize = 1,
+ },
+ {
+ .type = VehiclePropertyType::INT64,
+ .recyclable = true,
+ .vecSize = 1,
+ },
+ {
+ .type = VehiclePropertyType::FLOAT,
+ .recyclable = true,
+ .vecSize = 1,
+ },
+ {
+ .type = VehiclePropertyType::INT32_VEC,
+ .recyclable = true,
+ .vecSize = 4,
+ },
+ {
+ .type = VehiclePropertyType::INT64_VEC,
+ .recyclable = true,
+ .vecSize = 4,
+ },
+ {
+ .type = VehiclePropertyType::FLOAT_VEC,
+ .recyclable = true,
+ .vecSize = 4,
+ },
+ {
+ .type = VehiclePropertyType::BYTES,
+ .recyclable = true,
+ .vecSize = 4,
+ },
+ {
+ .type = VehiclePropertyType::INT32_VEC,
+ .recyclable = false,
+ .vecSize = 5,
+ },
+ {
+ .type = VehiclePropertyType::INT64_VEC,
+ .recyclable = false,
+ .vecSize = 5,
+ },
+ {
+ .type = VehiclePropertyType::FLOAT_VEC,
+ .recyclable = false,
+ .vecSize = 5,
+ },
+ {
+ .type = VehiclePropertyType::BYTES,
+ .recyclable = false,
+ .vecSize = 5,
+ },
+ {
+ .type = VehiclePropertyType::STRING,
+ .recyclable = false,
+ .vecSize = 0,
+ },
+ {
+ .type = VehiclePropertyType::MIXED,
+ .recyclable = false,
+ .vecSize = 0,
+ },
+ };
+}
+
+} // namespace
+
+class VehicleObjectPoolTest : public ::testing::Test {
+ protected:
+ void SetUp() override {
+ mStats = PoolStats::instance();
+ resetStats();
+ mValuePool.reset(new VehiclePropValuePool);
+ }
+
+ void TearDown() override {
+ // At the end, all created objects should be either recycled or deleted.
+ ASSERT_EQ(mStats->Obtained, mStats->Recycled + mStats->Deleted);
+ // Some objects could be recycled multiple times.
+ ASSERT_LE(mStats->Created, mStats->Recycled + mStats->Deleted);
+ }
+
+ PoolStats* mStats;
+ std::unique_ptr<VehiclePropValuePool> mValuePool;
+
+ private:
+ void resetStats() {
+ mStats->Obtained = 0;
+ mStats->Created = 0;
+ mStats->Recycled = 0;
+ mStats->Deleted = 0;
+ }
+};
+
+class VehiclePropertyTypesTest : public VehicleObjectPoolTest,
+ public testing::WithParamInterface<TestPropertyTypeInfo> {};
+
+TEST_P(VehiclePropertyTypesTest, testRecycle) {
+ auto info = GetParam();
+ if (!info.recyclable) {
+ GTEST_SKIP();
+ }
+
+ auto value = mValuePool->obtain(info.type, info.vecSize);
+ void* raw = value.get();
+ value.reset();
+ // At this point, value should be recycled and the only object in the pool.
+ ASSERT_EQ(mValuePool->obtain(info.type, info.vecSize).get(), raw);
+
+ ASSERT_EQ(mStats->Obtained, 2u);
+ ASSERT_EQ(mStats->Created, 1u);
+}
+
+TEST_P(VehiclePropertyTypesTest, testNotRecyclable) {
+ auto info = GetParam();
+ if (info.recyclable) {
+ GTEST_SKIP();
+ }
+
+ auto value = mValuePool->obtain(info.type, info.vecSize);
+
+ ASSERT_EQ(mStats->Obtained, 0u) << "Non recyclable object should not be obtained from the pool";
+ ASSERT_EQ(mStats->Created, 0u) << "Non recyclable object should not be created from the pool";
+}
+
+INSTANTIATE_TEST_SUITE_P(AllPropertyTypes, VehiclePropertyTypesTest,
+ ::testing::ValuesIn(getAllPropertyTypes()));
+
+TEST_F(VehicleObjectPoolTest, testObtainNewObject) {
+ auto value = mValuePool->obtain(VehiclePropertyType::INT32);
+ void* raw = value.get();
+ value.reset();
+ // At this point, value should be recycled and the only object in the pool.
+ ASSERT_EQ(mValuePool->obtain(VehiclePropertyType::INT32).get(), raw);
+ // Obtaining value of another type - should return a new object
+ ASSERT_NE(mValuePool->obtain(VehiclePropertyType::FLOAT).get(), raw);
+
+ ASSERT_EQ(mStats->Obtained, 3u);
+ ASSERT_EQ(mStats->Created, 2u);
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainStrings) {
+ mValuePool->obtain(VehiclePropertyType::STRING);
+ auto stringProp = mValuePool->obtain(VehiclePropertyType::STRING);
+ stringProp->value.stringValue = "Hello";
+ void* raw = stringProp.get();
+ stringProp.reset(); // delete the pointer
+
+ auto newStringProp = mValuePool->obtain(VehiclePropertyType::STRING);
+
+ ASSERT_EQ(newStringProp->value.stringValue.size(), 0u);
+ ASSERT_NE(mValuePool->obtain(VehiclePropertyType::STRING).get(), raw);
+ ASSERT_EQ(mStats->Obtained, 0u);
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainBoolean) {
+ auto prop = mValuePool->obtainBoolean(true);
+
+ ASSERT_NE(prop, nullptr);
+ ASSERT_EQ(*prop, (VehiclePropValue{
+ .value = {.int32Values = {1}},
+ }));
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainInt32) {
+ auto prop = mValuePool->obtainInt32(1234);
+
+ ASSERT_NE(prop, nullptr);
+ ASSERT_EQ(*prop, (VehiclePropValue{
+ .value = {.int32Values = {1234}},
+ }));
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainInt64) {
+ auto prop = mValuePool->obtainInt64(1234);
+
+ ASSERT_NE(prop, nullptr);
+ ASSERT_EQ(*prop, (VehiclePropValue{
+ .value = {.int64Values = {1234}},
+ }));
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainFloat) {
+ auto prop = mValuePool->obtainFloat(1.234);
+
+ ASSERT_NE(prop, nullptr);
+ ASSERT_EQ(*prop, (VehiclePropValue{
+ .value = {.floatValues = {1.234}},
+ }));
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainString) {
+ auto prop = mValuePool->obtainString("test");
+
+ ASSERT_NE(prop, nullptr);
+ ASSERT_EQ(*prop, (VehiclePropValue{
+ .value = {.stringValue = "test"},
+ }));
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainComplex) {
+ auto prop = mValuePool->obtainComplex();
+
+ ASSERT_NE(prop, nullptr);
+ ASSERT_EQ(*prop, VehiclePropValue{});
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainCopyInt32Values) {
+ VehiclePropValue prop{
+ // INT32_VEC property.
+ .prop = toInt(VehicleProperty::INFO_FUEL_TYPE),
+ .areaId = 2,
+ .timestamp = 3,
+ .value = {.int32Values = {1, 2, 3, 4}},
+ };
+ auto gotValue = mValuePool->obtain(prop);
+
+ ASSERT_NE(gotValue, nullptr);
+ ASSERT_EQ(*gotValue, prop);
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainCopyInt64Values) {
+ VehiclePropValue prop{
+ // INT64_VEC property.
+ .prop = toInt(VehicleProperty::WHEEL_TICK),
+ .areaId = 2,
+ .timestamp = 3,
+ .value = {.int64Values = {1, 2, 3, 4}},
+ };
+ auto gotValue = mValuePool->obtain(prop);
+
+ ASSERT_NE(gotValue, nullptr);
+ ASSERT_EQ(*gotValue, prop);
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainCopyFloatValues) {
+ VehiclePropValue prop{
+ // FLOAT_VEC property.
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .areaId = 2,
+ .timestamp = 3,
+ .value = {.floatValues = {1, 2, 3, 4}},
+ };
+ auto gotValue = mValuePool->obtain(prop);
+
+ ASSERT_NE(gotValue, nullptr);
+ ASSERT_EQ(*gotValue, prop);
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainCopyString) {
+ VehiclePropValue prop{
+ // STRING property.
+ .prop = toInt(VehicleProperty::INFO_VIN),
+ .areaId = 2,
+ .timestamp = 3,
+ .value = {.stringValue = "test"},
+ };
+ auto gotValue = mValuePool->obtain(prop);
+
+ ASSERT_NE(gotValue, nullptr);
+ ASSERT_EQ(*gotValue, prop);
+}
+
+TEST_F(VehicleObjectPoolTest, testObtainCopyMixed) {
+ VehiclePropValue prop{
+ // MIxed property.
+ .prop = toInt(VehicleProperty::VEHICLE_MAP_SERVICE),
+ .areaId = 2,
+ .timestamp = 3,
+ .value =
+ {
+ .int32Values = {1, 2, 3},
+ .floatValues = {4.0, 5.0},
+ .stringValue = "test",
+ },
+ };
+ auto gotValue = mValuePool->obtain(prop);
+
+ ASSERT_NE(gotValue, nullptr);
+ ASSERT_EQ(*gotValue, prop);
+}
+
+TEST_F(VehicleObjectPoolTest, testMultithreaded) {
+ // In this test we have T threads that concurrently in C cycles
+ // obtain and release O VehiclePropValue objects of FLOAT / INT32 types.
+
+ const int T = 2;
+ const int C = 500;
+ const int O = 100;
+
+ auto poolPtr = mValuePool.get();
+
+ std::vector<std::thread> threads;
+ for (int i = 0; i < T; i++) {
+ threads.push_back(std::thread([&poolPtr]() {
+ for (int j = 0; j < C; j++) {
+ std::vector<recyclable_ptr<VehiclePropValue>> vec;
+ for (int k = 0; k < O; k++) {
+ vec.push_back(poolPtr->obtain(k % 2 == 0 ? VehiclePropertyType::FLOAT
+ : VehiclePropertyType::INT32));
+ }
+ }
+ }));
+ }
+
+ for (auto& t : threads) {
+ t.join();
+ }
+
+ ASSERT_EQ(mStats->Obtained, static_cast<uint32_t>(T * C * O));
+ ASSERT_EQ(mStats->Recycled + mStats->Deleted, static_cast<uint32_t>(T * C * O));
+ // Created less than obtained in one cycle.
+ ASSERT_LE(mStats->Created, static_cast<uint32_t>(T * O));
+}
+
+TEST_F(VehicleObjectPoolTest, testMemoryLimitation) {
+ std::vector<recyclable_ptr<VehiclePropValue>> vec;
+ for (size_t i = 0; i < 10000; i++) {
+ vec.push_back(mValuePool->obtain(VehiclePropertyType::INT32));
+ }
+ // We have too many values, not all of them would be recycled, some of them will be deleted.
+ vec.clear();
+
+ ASSERT_EQ(mStats->Obtained, 10000u);
+ ASSERT_EQ(mStats->Created, 10000u);
+ ASSERT_GT(mStats->Deleted, 0u) << "expect some values to be deleted, not recycled if too many "
+ "values are in the pool";
+}
+
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
index c09b06d..7ad3d31 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
@@ -16,7 +16,9 @@
#include <PropertyUtils.h>
#include <VehicleUtils.h>
+
#include <gtest/gtest.h>
+#include <vector>
namespace android {
namespace hardware {
@@ -122,6 +124,129 @@
ASSERT_EQ(gotConfig, nullptr);
}
+TEST(VehicleUtilsTest, testCreateVehiclePropValueInt32) {
+ std::unique_ptr<VehiclePropValue> value = createVehiclePropValue(VehiclePropertyType::INT32);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.int32Values.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueInt32Vec) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValue(VehiclePropertyType::INT32_VEC);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.int32Values.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueInt64) {
+ std::unique_ptr<VehiclePropValue> value = createVehiclePropValue(VehiclePropertyType::INT64);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.int64Values.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueInt64Vec) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValue(VehiclePropertyType::INT64_VEC);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.int64Values.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueFloat) {
+ std::unique_ptr<VehiclePropValue> value = createVehiclePropValue(VehiclePropertyType::FLOAT);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.floatValues.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueFloatVec) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValue(VehiclePropertyType::FLOAT_VEC);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.floatValues.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueBytes) {
+ std::unique_ptr<VehiclePropValue> value = createVehiclePropValue(VehiclePropertyType::BYTES);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.byteValues.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueString) {
+ std::unique_ptr<VehiclePropValue> value = createVehiclePropValue(VehiclePropertyType::STRING);
+
+ ASSERT_NE(value, nullptr);
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueMixed) {
+ std::unique_ptr<VehiclePropValue> value = createVehiclePropValue(VehiclePropertyType::MIXED);
+
+ ASSERT_NE(value, nullptr);
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueVecInt32) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValueVec(VehiclePropertyType::INT32, /*vecSize=*/2);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.int32Values.size())
+ << "vector size should always be 1 for single value type";
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueIntVec32Vec) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValueVec(VehiclePropertyType::INT32_VEC, /*vecSize=*/2);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(2u, value->value.int32Values.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueVecInt64) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValueVec(VehiclePropertyType::INT64, /*vecSize=*/2);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.int64Values.size())
+ << "vector size should always be 1 for single value type";
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueIntVec64Vec) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValueVec(VehiclePropertyType::INT64_VEC, /*vecSize=*/2);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(2u, value->value.int64Values.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueVecFloat) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValueVec(VehiclePropertyType::FLOAT, /*vecSize=*/2);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(1u, value->value.floatValues.size())
+ << "vector size should always be 1 for single value type";
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueFloVecatVec) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValueVec(VehiclePropertyType::FLOAT_VEC, /*vecSize=*/2);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(2u, value->value.floatValues.size());
+}
+
+TEST(VehicleUtilsTest, testCreateVehiclePropValueVecBytes) {
+ std::unique_ptr<VehiclePropValue> value =
+ createVehiclePropValueVec(VehiclePropertyType::BYTES, /*vecSize=*/2);
+
+ ASSERT_NE(value, nullptr);
+ ASSERT_EQ(2u, value->value.byteValues.size());
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/biometrics/fingerprint/2.1/vts/functional/OWNERS b/biometrics/fingerprint/2.1/vts/functional/OWNERS
new file mode 100644
index 0000000..0014ce9
--- /dev/null
+++ b/biometrics/fingerprint/2.1/vts/functional/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 114777
+ilyamaty@google.com
diff --git a/bluetooth/a2dp/1.0/vts/OWNERS b/bluetooth/a2dp/1.0/vts/OWNERS
index 58d3a66..4e982a1 100644
--- a/bluetooth/a2dp/1.0/vts/OWNERS
+++ b/bluetooth/a2dp/1.0/vts/OWNERS
@@ -1,8 +1,4 @@
-zachoverflow@google.com
-siyuanh@google.com
-mylesgw@google.com
-jpawlowski@google.com
-apanicke@google.com
-stng@google.com
-hsz@google.com
+# Bug component: 27441
+include platform/system/bt:/OWNERS
+cheneyni@google.com
diff --git a/broadcastradio/1.0/vts/functional/OWNERS b/broadcastradio/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..778c4a2
--- /dev/null
+++ b/broadcastradio/1.0/vts/functional/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 533946
+oscarazu@google.com
diff --git a/broadcastradio/1.1/vts/OWNERS b/broadcastradio/1.1/vts/OWNERS
index 7736681..2c21c25 100644
--- a/broadcastradio/1.1/vts/OWNERS
+++ b/broadcastradio/1.1/vts/OWNERS
@@ -1,8 +1,3 @@
-# Automotive team
-egranata@google.com
+# Bug component: 533946
+oscarazu@google.com
keunyoung@google.com
-twasilczyk@google.com
-
-# VTS team
-yuexima@google.com
-yim@google.com
diff --git a/camera/metadata/3.7/types.hal b/camera/metadata/3.7/types.hal
new file mode 100644
index 0000000..a09bdf9
--- /dev/null
+++ b/camera/metadata/3.7/types.hal
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata@3.7;
+
+import android.hardware.camera.metadata@3.2;
+import android.hardware.camera.metadata@3.3;
+import android.hardware.camera.metadata@3.4;
+import android.hardware.camera.metadata@3.5;
+import android.hardware.camera.metadata@3.6;
+
+// No new metadata sections added in this revision
+
+/**
+ * Main enumeration for defining camera metadata tags added in this revision
+ *
+ * <p>Partial documentation is included for each tag; for complete documentation, reference
+ * '/system/media/camera/docs/docs.html' in the corresponding Android source tree.</p>
+ */
+enum CameraMetadataTag : @3.6::CameraMetadataTag {
+ /** android.info.deviceStateOrientations [static, int64[], ndk_public]
+ */
+ ANDROID_INFO_DEVICE_STATE_ORIENTATIONS = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_INFO_END_3_4,
+
+ ANDROID_INFO_END_3_7,
+
+};
+
+/*
+ * Enumeration definitions for the various entries that need them
+ */
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 7727547..ad3da48 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -8161,6 +8161,20 @@
poseReference >= ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA);
}
+ retcode = find_camera_metadata_ro_entry(metadata,
+ ANDROID_INFO_DEVICE_STATE_ORIENTATIONS, &entry);
+ if (0 == retcode && entry.count > 0) {
+ ASSERT_TRUE((entry.count % 2) == 0);
+ uint64_t maxPublicState = ((uint64_t) provider::V2_5::DeviceState::FOLDED) << 1;
+ uint64_t vendorStateStart = 1UL << 31; // Reserved for vendor specific states
+ uint64_t stateMask = (1 << vendorStateStart) - 1;
+ stateMask &= ~((1 << maxPublicState) - 1);
+ for (int i = 0; i < entry.count; i += 2){
+ ASSERT_TRUE((entry.data.i64[i] & stateMask) == 0);
+ ASSERT_TRUE((entry.data.i64[i+1] % 90) == 0);
+ }
+ }
+
verifyExtendedSceneModeCharacteristics(metadata);
verifyZoomCharacteristics(metadata);
}
diff --git a/current.txt b/current.txt
index c5d5762..cb91843 100644
--- a/current.txt
+++ b/current.txt
@@ -899,9 +899,14 @@
2123482b69f3b531c88023aa2a007110e130efbf4ed68ac9ce0bc55d5e82bc8b android.hardware.wifi.supplicant@1.4::ISupplicantStaNetworkCallback
0821f516e4d428bc15251969f7e19411c94d8f2ccbd99e1fc8168d8e49e38b0f android.hardware.wifi.supplicant@1.4::types
4a087a308608d146b022ebc15633de989f5f4dfe1491a83fa41763290a82e40d android.hardware.automotive.vehicle@2.0::types
+70eb14415391f835fb218b43a1e25f5d6495f098f96fa2acaea70985e98e1ce8 android.hardware.automotive.vehicle@2.0::types
+
+# HALs released in Android SCv2
+77f6fcf3fd0dd3e424d8a0292094ebd17e4c35454bb9abbd3a6cbed1aba70765 android.hardware.camera.metadata@3.7::types
# ABI preserving changes to HALs during Android T
62ace52d9c3ff1f60f94118557a2aaf0b953513e59dcd34d5f94ae28d4c7e780 android.hardware.fastboot@1.0::IFastboot
+b4a59462aa7d1346ee3eaa06a8e13682462746cf1be62ed2a2bd46bf404d01b7 android.hardware.graphics.composer@2.4::IComposerClient
ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardware.neuralnetworks@1.2::types
fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardware.neuralnetworks@1.3::types
diff --git a/graphics/composer/2.4/IComposerClient.hal b/graphics/composer/2.4/IComposerClient.hal
index 1a59bbd..e27fd6e 100644
--- a/graphics/composer/2.4/IComposerClient.hal
+++ b/graphics/composer/2.4/IComposerClient.hal
@@ -307,9 +307,8 @@
* If the display is internally connected (not through HDMI), and such modes are available,
* this method should trigger them.
*
- * This function should only be called if the display reports support for the corresponding
- * content type (ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}) from getSupportedContentTypes.
- * ContentType::NONE is supported by default and can always be set.
+ * This function can be called for a content type even if no support for it is
+ * reported from getSupportedContentTypes.
*
* @return error is NONE upon success. Otherwise,
* BAD_DISPLAY when an invalid display handle was passed in.
diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp
index 0065692..5006185 100644
--- a/graphics/composer/aidl/Android.bp
+++ b/graphics/composer/aidl/Android.bp
@@ -14,6 +14,15 @@
* limitations under the License.
*/
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
aidl_interface {
name: "android.hardware.graphics.composer3",
host_supported: true,
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index 9bde220..87a3a50 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -690,9 +690,8 @@
* If the display is internally connected (not through HDMI), and such modes are available,
* this method should trigger them.
*
- * This function should only be called if the display reports support for the corresponding
- * content type (ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}) from getSupportedContentTypes.
- * ContentType::NONE is supported by default and can always be set.
+ * This function can be called for a content type even if no support for it is
+ * reported from getSupportedContentTypes.
*
* @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
* @exception EX_UNSUPPORTED when the given content type is not supported by the composer
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp
new file mode 100644
index 0000000..8a36b1d
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalGraphicsComposer3_TargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["VtsHalGraphicsComposer3_TargetTest.cpp"],
+
+ // TODO(b/64437680): Assume these libs are always available on the device.
+ shared_libs: [
+ "libbinder_ndk",
+ "libbinder",
+ ],
+ static_libs: [
+ "android.hardware.graphics.composer3-V1-ndk",
+ "android.hardware.graphics.common-V3-ndk",
+ "android.hardware.graphics.common@1.2",
+ "android.hardware.common-V2-ndk",
+ "android.hardware.common.fmq-V1-ndk",
+ ],
+
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml
new file mode 100644
index 0000000..3f9971b
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<configuration description="Runs VtsHalGraphicsComposer3_TargetTest.">
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-suite-tag" value="apct-native" />
+
+ <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup">
+ </target_preparer>
+
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="VtsHalGraphicsComposer3_TargetTest->/data/local/tmp/VtsHalGraphicsComposer3_TargetTest" />
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="VtsHalGraphicsComposer3_TargetTest" />
+ <option name="native-test-timeout" value="900000"/>
+ </test>
+</configuration>
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS
new file mode 100644
index 0000000..d95d98d
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 199413815
+
+# Graphics team
+adyabr@google.com
+alecmouri@google.com
+ramindani@google.com
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
new file mode 100644
index 0000000..d892681
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -0,0 +1,106 @@
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/graphics/composer3/IComposer.h>
+#include <android-base/properties.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <binder/ProcessState.h>
+#include <gtest/gtest.h>
+#include <string>
+
+#pragma push_macro("LOG_TAG")
+#undef LOG_TAG
+#define LOG_TAG "VtsHalGraphicsComposer3_TargetTest"
+
+typedef uint64_t DisplayId;
+
+namespace aidl::android::hardware::graphics::composer3::vts {
+namespace {
+
+class VtsDisplay {
+ public:
+ VtsDisplay(DisplayId displayId, int32_t displayWidth, int32_t displayHeight)
+ : mDisplayId(displayId), mDisplayWidth(displayWidth), mDisplayHeight(displayHeight) {}
+
+ DisplayId get() const { return mDisplayId; }
+
+ void setDimensions(int32_t displayWidth, int32_t displayHeight) {
+ mDisplayWidth = displayWidth;
+ mDisplayHeight = displayHeight;
+ }
+
+ private:
+ const DisplayId mDisplayId;
+ int32_t mDisplayWidth;
+ int32_t mDisplayHeight;
+};
+
+class GraphicsComposerAidlTest : public ::testing::TestWithParam<std::string> {
+ protected:
+ void SetUp() override {
+ std::string name = GetParam();
+ ndk::SpAIBinder binder(AServiceManager_waitForService(name.c_str()));
+ ASSERT_NE(binder, nullptr);
+ ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder));
+ ASSERT_NE(mComposer, nullptr);
+ ASSERT_NO_FATAL_FAILURE(mComposer->createClient(&mComposerClient));
+ mInvalidDisplayId = GetInvalidDisplayId();
+ }
+
+ // returns an invalid display id (one that has not been registered to a
+ // display. Currently assuming that a device will never have close to
+ // std::numeric_limit<uint64_t>::max() displays registered while running tests
+ DisplayId GetInvalidDisplayId() {
+ uint64_t id = std::numeric_limits<uint64_t>::max();
+ while (id > 0) {
+ if (std::none_of(mDisplays.begin(), mDisplays.end(),
+ [&](const VtsDisplay& display) { return id == display.get(); })) {
+ return id;
+ }
+ id--;
+ }
+
+ return 0;
+ }
+
+ std::shared_ptr<IComposer> mComposer;
+ std::shared_ptr<IComposerClient> mComposerClient{};
+ DisplayId mInvalidDisplayId;
+ std::vector<VtsDisplay>
+ mDisplays; // TODO(b/202401906) populate all the displays available for test.
+};
+
+TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBadDisplay) {
+ std::vector<DisplayCapability> capabilities;
+ const auto error = mComposerClient->getDisplayCapabilities(mInvalidDisplayId, &capabilities);
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+}
+
+TEST_P(GraphicsComposerAidlTest, getDisplayCapabilities) {
+ for (const auto& display : mDisplays) {
+ std::vector<DisplayCapability> capabilities;
+ const auto error = mComposerClient->getDisplayCapabilities(display.get(), &capabilities);
+
+ EXPECT_NE(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ }
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, GraphicsComposerAidlTest,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
+ ::android::PrintInstanceNameToString);
+} // namespace
+} // namespace aidl::android::hardware::graphics::composer3::vts
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+
+ using namespace std::chrono_literals;
+ if (!android::base::WaitForProperty("init.svc.surfaceflinger", "stopped", 10s)) {
+ ALOGE("Failed to stop init.svc.surfaceflinger");
+ return -1;
+ }
+ return RUN_ALL_TESTS();
+}
diff --git a/health/1.0/Android.bp b/health/1.0/Android.bp
index 003b106..e793db6 100644
--- a/health/1.0/Android.bp
+++ b/health/1.0/Android.bp
@@ -20,4 +20,8 @@
],
gen_java: true,
gen_java_constants: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
}
diff --git a/health/2.0/Android.bp b/health/2.0/Android.bp
index ddd983d..fae25b6 100644
--- a/health/2.0/Android.bp
+++ b/health/2.0/Android.bp
@@ -22,4 +22,8 @@
"android.hidl.base@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
}
diff --git a/health/2.1/vts/functional/OWNERS b/health/2.1/vts/functional/OWNERS
new file mode 100644
index 0000000..cd06415
--- /dev/null
+++ b/health/2.1/vts/functional/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 30545
+elsk@google.com
diff --git a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
index 93fb19d..2c15823 100644
--- a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
+++ b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
@@ -3153,6 +3153,49 @@
}
/*
+ * EncryptionOperationsTest.AesCbcZeroInputSuccessb
+ *
+ * Verifies that keymaster generates correct output on zero-input with
+ * NonePadding mode
+ */
+TEST_P(EncryptionOperationsTest, AesCbcZeroInputSuccess) {
+ ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .AesEncryptionKey(128)
+ .BlockMode(BlockMode::CBC)
+ .Padding(PaddingMode::NONE, PaddingMode::PKCS7)));
+
+ // Zero input message
+ string message = "";
+ for (auto padding : {PaddingMode::NONE, PaddingMode::PKCS7}) {
+ auto params = AuthorizationSetBuilder().BlockMode(BlockMode::CBC).Padding(padding);
+ AuthorizationSet out_params;
+ string ciphertext1 = EncryptMessage(message, params, &out_params);
+ HidlBuf iv1 = CopyIv(out_params);
+ if (padding == PaddingMode::NONE)
+ EXPECT_EQ(message.size(), ciphertext1.size()) << "PaddingMode: " << padding;
+ else
+ EXPECT_EQ(message.size(), ciphertext1.size() - 16) << "PaddingMode: " << padding;
+
+ out_params.Clear();
+
+ string ciphertext2 = EncryptMessage(message, params, &out_params);
+ HidlBuf iv2 = CopyIv(out_params);
+ if (padding == PaddingMode::NONE)
+ EXPECT_EQ(message.size(), ciphertext2.size()) << "PaddingMode: " << padding;
+ else
+ EXPECT_EQ(message.size(), ciphertext2.size() - 16) << "PaddingMode: " << padding;
+
+ // IVs should be random
+ EXPECT_NE(iv1, iv2) << "PaddingMode: " << padding;
+
+ params.push_back(TAG_NONCE, iv1);
+ string plaintext = DecryptMessage(ciphertext1, params);
+ EXPECT_EQ(message, plaintext) << "PaddingMode: " << padding;
+ }
+}
+
+/*
* EncryptionOperationsTest.AesCallerNonce
*
* Verifies that AES caller-provided nonces work correctly.
diff --git a/nfc/1.0/vts/functional/OWNERS b/nfc/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..bf0e58b
--- /dev/null
+++ b/nfc/1.0/vts/functional/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 48448
+georgekgchang@google.com
+jackcwyu@google.com
diff --git a/nfc/1.1/vts/functional/OWNERS b/nfc/1.1/vts/functional/OWNERS
new file mode 100644
index 0000000..bf0e58b
--- /dev/null
+++ b/nfc/1.1/vts/functional/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 48448
+georgekgchang@google.com
+jackcwyu@google.com
diff --git a/radio/1.0/vts/OWNERS b/radio/1.0/vts/OWNERS
index 9310f8e..117692a 100644
--- a/radio/1.0/vts/OWNERS
+++ b/radio/1.0/vts/OWNERS
@@ -1,7 +1,5 @@
-# Telephony team
-amitmahajan@google.com
+# Bug component: 20868
+jminjie@google.com
+sarahchin@google.com
shuoq@google.com
jackyu@google.com
-
-# VTS team
-dshi@google.com
diff --git a/radio/1.1/vts/OWNERS b/radio/1.1/vts/OWNERS
index a07c917..4d199ca 100644
--- a/radio/1.1/vts/OWNERS
+++ b/radio/1.1/vts/OWNERS
@@ -1 +1,2 @@
+# Bug component: 20868
include ../../1.0/vts/OWNERS
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
index 020168e..509883d 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
@@ -16,11 +16,40 @@
#include <radio_hidl_hal_utils_v1_1.h>
+bool isServiceValidForDeviceConfiguration(hidl_string& serviceName) {
+ if (isSsSsEnabled()) {
+ // Device is configured as SSSS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME) {
+ ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isDsDsEnabled()) {
+ // Device is configured as DSDS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) {
+ ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isTsTsEnabled()) {
+ // Device is configured as TSTS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME &&
+ serviceName != RADIO_SERVICE_SLOT3_NAME) {
+ ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str());
+ return false;
+ }
+ }
+ return true;
+}
+
void RadioHidlTest_v1_1::SetUp() {
- radio_v1_1 = ::android::hardware::radio::V1_1::IRadio::getService(GetParam());
+ hidl_string serviceName = GetParam();
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+ radio_v1_1 = ::android::hardware::radio::V1_1::IRadio::getService(serviceName);
if (radio_v1_1 == NULL) {
sleep(60);
- radio_v1_1 = ::android::hardware::radio::V1_1::IRadio::getService(GetParam());
+ radio_v1_1 = ::android::hardware::radio::V1_1::IRadio::getService(serviceName);
}
ASSERT_NE(nullptr, radio_v1_1.get());
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
index bafde77..e79a4ed 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
+++ b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
@@ -43,6 +43,15 @@
#define SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL_VERSION_AT_LEAST(__ver__) \
SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL(__ver__, radio_v1_1, radioRsp_v1_1)
+// HAL instance name for SIM slot 1 or single SIM device
+#define RADIO_SERVICE_SLOT1_NAME "slot1"
+
+// HAL instance name for SIM slot 2 on dual SIM device
+#define RADIO_SERVICE_SLOT2_NAME "slot2"
+
+// HAL instance name for SIM slot 3 on triple SIM device
+#define RADIO_SERVICE_SLOT3_NAME "slot3"
+
class RadioHidlTest_v1_1;
extern CardStatus cardStatus;
diff --git a/radio/1.2/vts/OWNERS b/radio/1.2/vts/OWNERS
index a07c917..4d199ca 100644
--- a/radio/1.2/vts/OWNERS
+++ b/radio/1.2/vts/OWNERS
@@ -1 +1,2 @@
+# Bug component: 20868
include ../../1.0/vts/OWNERS
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_test.cpp b/radio/1.2/vts/functional/radio_hidl_hal_test.cpp
index 4845c7f..feadafc 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.2/vts/functional/radio_hidl_hal_test.cpp
@@ -16,11 +16,40 @@
#include <radio_hidl_hal_utils_v1_2.h>
+bool isServiceValidForDeviceConfiguration(hidl_string& serviceName) {
+ if (isSsSsEnabled()) {
+ // Device is configured as SSSS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME) {
+ ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isDsDsEnabled()) {
+ // Device is configured as DSDS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) {
+ ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isTsTsEnabled()) {
+ // Device is configured as TSTS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME &&
+ serviceName != RADIO_SERVICE_SLOT3_NAME) {
+ ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str());
+ return false;
+ }
+ }
+ return true;
+}
+
void RadioHidlTest_v1_2::SetUp() {
- radio_v1_2 = ::android::hardware::radio::V1_2::IRadio::getService(GetParam());
+ hidl_string serviceName = GetParam();
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+ radio_v1_2 = ::android::hardware::radio::V1_2::IRadio::getService(serviceName);
if (radio_v1_2 == NULL) {
sleep(60);
- radio_v1_2 = ::android::hardware::radio::V1_2::IRadio::getService(GetParam());
+ radio_v1_2 = ::android::hardware::radio::V1_2::IRadio::getService(serviceName);
}
ASSERT_NE(nullptr, radio_v1_2.get());
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h b/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h
index 81286d2..65ef7e9 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h
+++ b/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h
@@ -49,10 +49,18 @@
using ::android::hardware::radio::V1_0::RadioResponseType;
#define TIMEOUT_PERIOD 75
-#define RADIO_SERVICE_NAME "slot1"
#define SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL_VERSION_AT_LEAST(__ver__) \
SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL(__ver__, radio_v1_2, radioRsp_v1_2)
+// HAL instance name for SIM slot 1 or single SIM device
+#define RADIO_SERVICE_SLOT1_NAME "slot1"
+
+// HAL instance name for SIM slot 2 on dual SIM device
+#define RADIO_SERVICE_SLOT2_NAME "slot2"
+
+// HAL instance name for SIM slot 3 on triple SIM device
+#define RADIO_SERVICE_SLOT3_NAME "slot3"
+
class RadioHidlTest_v1_2;
extern ::android::hardware::radio::V1_2::CardStatus cardStatus;
diff --git a/radio/1.3/vts/OWNERS b/radio/1.3/vts/OWNERS
index a07c917..4d199ca 100644
--- a/radio/1.3/vts/OWNERS
+++ b/radio/1.3/vts/OWNERS
@@ -1 +1,2 @@
+# Bug component: 20868
include ../../1.0/vts/OWNERS
diff --git a/radio/1.3/vts/functional/radio_hidl_hal_test.cpp b/radio/1.3/vts/functional/radio_hidl_hal_test.cpp
index c6e5550..93a6c42 100644
--- a/radio/1.3/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.3/vts/functional/radio_hidl_hal_test.cpp
@@ -16,11 +16,40 @@
#include <radio_hidl_hal_utils_v1_3.h>
+bool isServiceValidForDeviceConfiguration(hidl_string& serviceName) {
+ if (isSsSsEnabled()) {
+ // Device is configured as SSSS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME) {
+ ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isDsDsEnabled()) {
+ // Device is configured as DSDS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) {
+ ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isTsTsEnabled()) {
+ // Device is configured as TSTS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME &&
+ serviceName != RADIO_SERVICE_SLOT3_NAME) {
+ ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str());
+ return false;
+ }
+ }
+ return true;
+}
+
void RadioHidlTest_v1_3::SetUp() {
- radio_v1_3 = ::android::hardware::radio::V1_3::IRadio::getService(GetParam());
+ hidl_string serviceName = GetParam();
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+ radio_v1_3 = ::android::hardware::radio::V1_3::IRadio::getService(serviceName);
if (radio_v1_3 == NULL) {
sleep(60);
- radio_v1_3 = ::android::hardware::radio::V1_3::IRadio::getService(GetParam());
+ radio_v1_3 = ::android::hardware::radio::V1_3::IRadio::getService(serviceName);
}
ASSERT_NE(nullptr, radio_v1_3.get());
diff --git a/radio/1.3/vts/functional/radio_hidl_hal_utils_v1_3.h b/radio/1.3/vts/functional/radio_hidl_hal_utils_v1_3.h
index 893eac5..ffda063 100644
--- a/radio/1.3/vts/functional/radio_hidl_hal_utils_v1_3.h
+++ b/radio/1.3/vts/functional/radio_hidl_hal_utils_v1_3.h
@@ -41,7 +41,15 @@
using ::android::hardware::Void;
#define TIMEOUT_PERIOD 75
-#define RADIO_SERVICE_NAME "slot1"
+
+// HAL instance name for SIM slot 1 or single SIM device
+#define RADIO_SERVICE_SLOT1_NAME "slot1"
+
+// HAL instance name for SIM slot 2 on dual SIM device
+#define RADIO_SERVICE_SLOT2_NAME "slot2"
+
+// HAL instance name for SIM slot 3 on triple SIM device
+#define RADIO_SERVICE_SLOT3_NAME "slot3"
class RadioHidlTest_v1_3;
extern ::android::hardware::radio::V1_2::CardStatus cardStatus;
diff --git a/radio/1.4/vts/OWNERS b/radio/1.4/vts/OWNERS
index a07c917..4d199ca 100644
--- a/radio/1.4/vts/OWNERS
+++ b/radio/1.4/vts/OWNERS
@@ -1 +1,2 @@
+# Bug component: 20868
include ../../1.0/vts/OWNERS
diff --git a/radio/1.4/vts/functional/radio_hidl_hal_test.cpp b/radio/1.4/vts/functional/radio_hidl_hal_test.cpp
index 4ac6cc9..af859ef 100644
--- a/radio/1.4/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.4/vts/functional/radio_hidl_hal_test.cpp
@@ -16,12 +16,41 @@
#include <radio_hidl_hal_utils_v1_4.h>
+bool isServiceValidForDeviceConfiguration(hidl_string& serviceName) {
+ if (isSsSsEnabled()) {
+ // Device is configured as SSSS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME) {
+ ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isDsDsEnabled()) {
+ // Device is configured as DSDS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) {
+ ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isTsTsEnabled()) {
+ // Device is configured as TSTS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME &&
+ serviceName != RADIO_SERVICE_SLOT3_NAME) {
+ ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str());
+ return false;
+ }
+ }
+ return true;
+}
+
void RadioHidlTest_v1_4::SetUp() {
- radio_v1_4 = ::android::hardware::radio::V1_4::IRadio::getService(GetParam());
+ hidl_string serviceName = GetParam();
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+ radio_v1_4 = ::android::hardware::radio::V1_4::IRadio::getService(serviceName);
if (radio_v1_4 == NULL) {
sleep(60);
- radio_v1_4 = ::android::hardware::radio::V1_4::IRadio::getService(GetParam());
+ radio_v1_4 = ::android::hardware::radio::V1_4::IRadio::getService(serviceName);
}
ASSERT_NE(nullptr, radio_v1_4.get());
diff --git a/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h b/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h
index 8eee811..8cad9b1 100644
--- a/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h
+++ b/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h
@@ -47,7 +47,14 @@
#define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3
#define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3
-#define RADIO_SERVICE_NAME "slot1"
+// HAL instance name for SIM slot 1 or single SIM device
+#define RADIO_SERVICE_SLOT1_NAME "slot1"
+
+// HAL instance name for SIM slot 2 on dual SIM device
+#define RADIO_SERVICE_SLOT2_NAME "slot2"
+
+// HAL instance name for SIM slot 3 on triple SIM device
+#define RADIO_SERVICE_SLOT3_NAME "slot3"
class RadioHidlTest_v1_4;
extern ::android::hardware::radio::V1_4::CardStatus cardStatus;
diff --git a/radio/1.5/vts/OWNERS b/radio/1.5/vts/OWNERS
index a07c917..4d199ca 100644
--- a/radio/1.5/vts/OWNERS
+++ b/radio/1.5/vts/OWNERS
@@ -1 +1,2 @@
+# Bug component: 20868
include ../../1.0/vts/OWNERS
diff --git a/radio/1.5/vts/functional/radio_hidl_hal_test.cpp b/radio/1.5/vts/functional/radio_hidl_hal_test.cpp
index 4155550..67dcd7c 100644
--- a/radio/1.5/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.5/vts/functional/radio_hidl_hal_test.cpp
@@ -16,8 +16,38 @@
#include <radio_hidl_hal_utils_v1_5.h>
+bool isServiceValidForDeviceConfiguration(hidl_string& serviceName) {
+ if (isSsSsEnabled()) {
+ // Device is configured as SSSS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME) {
+ ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isDsDsEnabled()) {
+ // Device is configured as DSDS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) {
+ ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isTsTsEnabled()) {
+ // Device is configured as TSTS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME &&
+ serviceName != RADIO_SERVICE_SLOT3_NAME) {
+ ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str());
+ return false;
+ }
+ }
+ return true;
+}
+
void RadioHidlTest_v1_5::SetUp() {
- radio_v1_5 = android::hardware::radio::V1_5::IRadio::getService(GetParam());
+ hidl_string serviceName = GetParam();
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+
+ radio_v1_5 = android::hardware::radio::V1_5::IRadio::getService(serviceName);
ASSERT_NE(nullptr, radio_v1_5.get());
radioRsp_v1_5 = new (std::nothrow) RadioResponse_v1_5(*this);
diff --git a/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h b/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
index 65442ca..41eb3b5 100644
--- a/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
+++ b/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h
@@ -54,7 +54,14 @@
#define VOICE_SERVICE_MAX_WAIT_TIME_SECONDS 10
#define BARRING_INFO_MAX_WAIT_TIME_SECONDS 3
-#define RADIO_SERVICE_NAME "slot1"
+// HAL instance name for SIM slot 1 or single SIM device
+#define RADIO_SERVICE_SLOT1_NAME "slot1"
+
+// HAL instance name for SIM slot 2 on dual SIM device
+#define RADIO_SERVICE_SLOT2_NAME "slot2"
+
+// HAL instance name for SIM slot 3 on triple SIM device
+#define RADIO_SERVICE_SLOT3_NAME "slot3"
class RadioHidlTest_v1_5;
extern ::android::hardware::radio::V1_5::CardStatus cardStatus;
diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
index 63db370..e07d2ba 100644
--- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
@@ -515,7 +515,8 @@
if (getRadioHalCapabilities()) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
- {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED}));
+ {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED,
+ ::android::hardware::radio::V1_6::RadioError::NONE}));
} else {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
@@ -537,7 +538,8 @@
if (getRadioHalCapabilities()) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
- {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED}));
+ {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED,
+ ::android::hardware::radio::V1_6::RadioError::NONE}));
} else {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
@@ -559,7 +561,8 @@
if (getRadioHalCapabilities()) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
- {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED}));
+ {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED,
+ ::android::hardware::radio::V1_6::RadioError::NONE}));
} else {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
@@ -580,7 +583,8 @@
if (getRadioHalCapabilities()) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
- {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED}));
+ {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED,
+ ::android::hardware::radio::V1_6::RadioError::NONE}));
} else {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp
index 88bdc2e..c5a3a8b 100644
--- a/radio/aidl/Android.bp
+++ b/radio/aidl/Android.bp
@@ -137,7 +137,10 @@
vendor_available: true,
srcs: ["android/hardware/radio/sim/*.aidl"],
stability: "vintf",
- imports: ["android.hardware.radio"],
+ imports: [
+ "android.hardware.radio",
+ "android.hardware.radio.config",
+ ],
backend: {
cpp: {
enabled: false,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
index 85106b8..a48a89b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
@@ -49,5 +49,5 @@
oneway void setNumOfLiveModems(in int serial, in byte numOfLiveModems);
oneway void setPreferredDataModem(in int serial, in byte modemId);
oneway void setResponseFunctions(in android.hardware.radio.config.IRadioConfigResponse radioConfigResponse, in android.hardware.radio.config.IRadioConfigIndication radioConfigIndication);
- oneway void setSimSlotsMapping(in int serial, in int[] slotMap);
+ oneway void setSimSlotsMapping(in int serial, in android.hardware.radio.config.SlotPortMapping[] slotMap);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl
new file mode 100644
index 0000000..2cfb8d0
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.config;
+@VintfStability
+parcelable SimPortInfo {
+ String iccId;
+ int logicalSlotId;
+ int portState;
+ const int PORT_STATE_INACTIVE = 0;
+ const int PORT_STATE_ACTIVE = 1;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl
index 3a716cf..60eabc7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl
@@ -36,9 +36,7 @@
parcelable SimSlotStatus {
boolean cardActive;
int cardState;
- int slotState;
String atr;
- int logicalSlotId;
- String iccid;
String eid;
+ android.hardware.radio.config.SimPortInfo[] portInfo;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl
new file mode 100644
index 0000000..f38c421
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.config;
+@VintfStability
+parcelable SlotPortMapping {
+ int physicalSlotId;
+ int portId;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl
index 2d95b97..cf37a0d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl
@@ -40,10 +40,10 @@
int cdmaSubscriptionAppIndex;
int imsSubscriptionAppIndex;
android.hardware.radio.sim.AppStatus[] applications;
- int physicalSlotId;
String atr;
String iccid;
String eid;
+ android.hardware.radio.config.SlotPortMapping slotMap;
const int STATE_ABSENT = 0;
const int STATE_PRESENT = 1;
const int STATE_ERROR = 2;
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
index bfff16a..85c2cee 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
@@ -26,6 +26,7 @@
import android.hardware.radio.config.IRadioConfigIndication;
import android.hardware.radio.config.IRadioConfigResponse;
+import android.hardware.radio.config.SlotPortMapping;
@VintfStability
oneway interface IRadioConfig {
@@ -120,30 +121,57 @@
/**
* Set SIM Slot mapping.
*
- * Maps the logical slots to the physical slots. Logical slot is the slot that is seen by modem.
- * Physical slot is the actual physical slot. Request maps the physical slot to logical slot.
- * Logical slots that are already mapped to the requested physical slot are not impacted.
+ * Maps the logical slots to the SlotPortMapping which consist of both physical slot id and port
+ * id. Logical slot is the slot that is seen by modem. Physical slot is the actual physical
+ * slot. PortId is the id (enumerated value) for the associated port available on the SIM. Each
+ * physical slot can have multiple ports which enables multi-enabled profile(MEP). If eUICC
+ * physical slot supports 2 ports, then the portId is numbered 0,1 and if eUICC2 supports 4
+ * ports then the portID is numbered 0,1,2,3. Each portId is unique within a UICC physical slot
+ * but not necessarily unique across UICC’s. SEP(Single enabled profile) eUICC and non-eUICC
+ * will only have portId 0.
*
- * Example no. of logical slots 1 and physical slots 2:
- * The only logical slot (index 0) can be mapped to first physical slot (value 0) or second
- * physical slot(value 1), while the other physical slot remains unmapped and inactive.
- * slotMap[0] = 1 or slotMap[0] = 0
+ * Logical slots that are already mapped to the requested SlotPortMapping are not impacted.
*
- * Example no. of logical slots 2 and physical slots 2:
- * First logical slot (index 0) can be mapped to physical slot 1 or 2 and other logical slot
- * can be mapped to other physical slot. Each logical slot must be mapped to a physical slot.
- * slotMap[0] = 0 and slotMap[1] = 1 or slotMap[0] = 1 and slotMap[1] = 0
+ * Example no. of logical slots 1 and physical slots 2 do not support MEP, each physical slot
+ * has one port:
+ * The only logical slot (index 0) can be mapped to first physical slot (value 0), port(index
+ * 0). or second
+ * physical slot(value 1), port (index 0), while the other physical slot remains unmapped and
+ * inactive.
+ * slotMap[0] = SlotPortMapping{0 //physical slot//, 0 //port//}
+ * slotMap[0] = SlotPortMapping{1 //physical slot//, 0 //port//}
+ *
+ * Example no. of logical slots 2 and physical slots 2 supports MEP with 2 ports available:
+ * Each logical slot must be mapped to a port (physical slot and port combination).
+ * First logical slot (index 0) can be mapped to physical slot 1 and the second logical slot
+ * can be mapped to either port from physical slot 2.
+ *
+ * slotMap[0] = SlotPortMapping{0, 0} and slotMap[1] = SlotPortMapping{1, 0} or
+ * slotMap[0] = SlotPortMapping{0, 0} and slotMap[1] = SlotPortMapping{1, 1}
+ *
+ * or the other way around, the second logical slot(index 1) can be mapped to physical slot 1
+ * and the first logical slot can be mapped to either port from physical slot 2.
+ *
+ * slotMap[1] = SlotPortMapping{0, 0} and slotMap[0] = SlotPortMapping{1, 0} or
+ * slotMap[1] = SlotPortMapping{0, 0} and slotMap[0] = SlotPortMapping{1, 1}
+ *
+ * another possible mapping is each logical slot maps to each port of physical slot 2 and there
+ * is no active logical modem mapped to physical slot 1.
+ *
+ * slotMap[0] = SlotPortMapping{1, 0} and slotMap[1] = SlotPortMapping{1, 1} or
+ * slotMap[0] = SlotPortMapping{1, 1} and slotMap[1] = SlotPortMapping{1, 0}
*
* @param serial Serial number of request
- * @param slotMap Logical to physical slot mapping, size == no. of radio instances. Index is
- * mapping to logical slot and value to physical slot, need to provide all the slots
- * mapping when sending request in case of multi slot device.
- * EX: uint32_t slotMap[logical slot] = physical slot
+ * @param slotMap Logical to physical slot and port mapping.
+ * Index is mapping to logical slot and value to physical slot and port id, need to
+ * provide all the slots mapping when sending request in case of multi slot device.
+ *
+ * EX: SlotPortMapping(physical slot, port id)
* index 0 is the first logical_slot number of logical slots is equal to number of Radio
* instances and number of physical slots is equal to size of slotStatus in
* getSimSlotsStatusResponse
*
* Response callback is IRadioConfigResponse.setSimSlotsMappingResponse()
*/
- void setSimSlotsMapping(in int serial, in int[] slotMap);
+ void setSimSlotsMapping(in int serial, in SlotPortMapping[] slotMap);
}
diff --git a/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl
new file mode 100644
index 0000000..78f1309
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.config;
+
+@VintfStability
+parcelable SimPortInfo {
+ /**
+ * Integrated Circuit Card IDentifier (ICCID) is unique identifier of the SIM card. File is
+ * located in the SIM card at EFiccid (0x2FE2) as per ETSI 102.221. The ICCID is defined by
+ * the ITU-T recommendation E.118 ISO/IEC 7816.
+ *
+ * This data is applicable only when cardState is CardStatus.STATE_PRESENT.
+ *
+ * This is the ICCID of the currently enabled profile. If no profile is enabled,
+ * then it will contain the default boot profile’s ICCID.
+ * If the EFiccid does not exist in the default boot profile, it will be null.
+ */
+ String iccId;
+ /**
+ * Logical slot id is identifier of the active slot
+ */
+ int logicalSlotId;
+ /*
+ * Port is Inactive
+ * Inactive means logical modem is no longer associated to the port
+ */
+ const int PORT_STATE_INACTIVE = 0;
+ /*
+ * Port is Active
+ * Active means logical modem is associated to the port
+ */
+ const int PORT_STATE_ACTIVE = 1;
+ /**
+ * Port state in the slot. Values are portState.[PORT_STATE_INACTIVE, PORT_STATE_ACTIVE].
+ */
+ int portState;
+}
diff --git a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl
index f5ea8f9..4ab955a 100644
--- a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl
+++ b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl
@@ -16,6 +16,8 @@
package android.hardware.radio.config;
+import android.hardware.radio.config.SimPortInfo;
+
@VintfStability
parcelable SimSlotStatus {
boolean cardActive;
@@ -25,10 +27,6 @@
*/
int cardState;
/**
- * Slot state Active/Inactive
- */
- int slotState;
- /**
* An Answer To Reset (ATR) is a message output by a Smart Card conforming to ISO/IEC 7816
* standards, following electrical reset of the card's chip. The ATR conveys information about
* the communication parameters proposed by the card, and the card's nature and state.
@@ -36,15 +34,6 @@
* This data is applicable only when cardState is CardStatus.STATE_PRESENT.
*/
String atr;
- int logicalSlotId;
- /**
- * Integrated Circuit Card IDentifier (ICCID) is Unique Identifier of the SIM CARD. File is
- * located in the SIM card at EFiccid (0x2FE2) as per ETSI 102.221. The ICCID is defined by
- * the ITU-T recommendation E.118 ISO/IEC 7816.
- *
- * This data is applicable only when cardState is CardStatus.STATE_PRESENT.
- */
- String iccid;
/**
* The EID is the eUICC identifier. The EID shall be stored within the ECASD and can be
* retrieved by the Device at any time using the standard GlobalPlatform GET DATA command.
@@ -53,4 +42,8 @@
* card supports eUICC.
*/
String eid;
+ /**
+ * PortInfo contains the ICCID, logical slot ID, and port state
+ */
+ SimPortInfo[] portInfo;
}
diff --git a/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl
new file mode 100644
index 0000000..3046d4f
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.radio.config;
+
+@VintfStability
+parcelable SlotPortMapping {
+ /**
+ * Physical slot id is the index of the slots
+ **/
+ int physicalSlotId;
+ /**
+ * PortId is the id (enumerated value) for the associated port available on the SIM.
+ * Example:
+ * if eUICC1 supports 2 ports, then the portId is numbered 0,1.
+ * if eUICC2 supports 4 ports, then the portId is numbered: 0,1,2,3.
+ * Each portId is unique within a UICC, but not necessarily unique across UICC’s.
+ * SEP(Single enabled profile) eUICC and non-eUICC will only have portId 0.
+ **/
+ int portId;
+}
diff --git a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
index 629f403..3098c4d 100644
--- a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+import android.hardware.radio.config.SlotPortMapping;
import android.hardware.radio.sim.AppStatus;
import android.hardware.radio.sim.PinState;
@@ -61,7 +62,6 @@
* size <= RadioConst::CARD_MAX_APPS
*/
AppStatus[] applications;
- int physicalSlotId;
/**
* An Answer To Reset (ATR) is a message output by a Smart Card conforming to ISO/IEC 7816
* standards, following electrical reset of the card's chip. The ATR conveys information about
@@ -86,4 +86,10 @@
* supports eUICC.
*/
String eid;
+ /* SlotPortMapping:
+ * SlotPortMapping consists of physical slot id and port id.
+ * Physical slot is the actual physical slot.
+ * PortId is the id (enumerated value) for the associated port available on the SIM.
+ */
+ SlotPortMapping slotMap;
}
diff --git a/radio/config/1.1/vts/OWNERS b/radio/config/1.1/vts/OWNERS
new file mode 100644
index 0000000..4109967
--- /dev/null
+++ b/radio/config/1.1/vts/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 20868
+include /radio/1.0/vts/OWNERS
diff --git a/radio/config/1.2/vts/OWNERS b/radio/config/1.2/vts/OWNERS
new file mode 100644
index 0000000..4109967
--- /dev/null
+++ b/radio/config/1.2/vts/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 20868
+include /radio/1.0/vts/OWNERS
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index fb720e8..37acfa9 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -1365,11 +1365,16 @@
att_hw_enforced[i].tag == TAG_VENDOR_PATCHLEVEL) {
std::string date =
std::to_string(att_hw_enforced[i].value.get<KeyParameterValue::integer>());
+
// strptime seems to require delimiters, but the tag value will
// be YYYYMMDD
+ if (date.size() != 8) {
+ ADD_FAILURE() << "Tag " << att_hw_enforced[i].tag
+ << " with invalid format (not YYYYMMDD): " << date;
+ return false;
+ }
date.insert(6, "-");
date.insert(4, "-");
- EXPECT_EQ(date.size(), 10);
struct tm time;
strptime(date.c_str(), "%Y-%m-%d", &time);
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index a90ee65..fe8b48f 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -69,8 +69,6 @@
namespace {
-bool check_patchLevels = false;
-
// The maximum number of times we'll attempt to verify that corruption
// of an ecrypted blob results in an error. Retries are necessary as there
// is a small (roughly 1/256) chance that corrupting ciphertext still results
@@ -529,14 +527,12 @@
EXPECT_TRUE(os_pl);
EXPECT_EQ(*os_pl, os_patch_level());
- if (check_patchLevels) {
- // Should include vendor and boot patchlevels.
- auto vendor_pl = auths.GetTagValue(TAG_VENDOR_PATCHLEVEL);
- EXPECT_TRUE(vendor_pl);
- EXPECT_EQ(*vendor_pl, vendor_patch_level());
- auto boot_pl = auths.GetTagValue(TAG_BOOT_PATCHLEVEL);
- EXPECT_TRUE(boot_pl);
- }
+ // Should include vendor and boot patchlevels.
+ auto vendor_pl = auths.GetTagValue(TAG_VENDOR_PATCHLEVEL);
+ EXPECT_TRUE(vendor_pl);
+ EXPECT_EQ(*vendor_pl, vendor_patch_level());
+ auto boot_pl = auths.GetTagValue(TAG_BOOT_PATCHLEVEL);
+ EXPECT_TRUE(boot_pl);
return auths;
}
@@ -4682,6 +4678,49 @@
}
/*
+ * EncryptionOperationsTest.AesCbcZeroInputSuccessb
+ *
+ * Verifies that keymaster generates correct output on zero-input with
+ * NonePadding mode
+ */
+TEST_P(EncryptionOperationsTest, AesCbcZeroInputSuccess) {
+ ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .AesEncryptionKey(128)
+ .BlockMode(BlockMode::CBC)
+ .Padding(PaddingMode::NONE, PaddingMode::PKCS7)));
+
+ // Zero input message
+ string message = "";
+ for (auto padding : {PaddingMode::NONE, PaddingMode::PKCS7}) {
+ auto params = AuthorizationSetBuilder().BlockMode(BlockMode::CBC).Padding(padding);
+ AuthorizationSet out_params;
+ string ciphertext1 = EncryptMessage(message, params, &out_params);
+ vector<uint8_t> iv1 = CopyIv(out_params);
+ if (padding == PaddingMode::NONE)
+ EXPECT_EQ(message.size(), ciphertext1.size()) << "PaddingMode: " << padding;
+ else
+ EXPECT_EQ(message.size(), ciphertext1.size() - 16) << "PaddingMode: " << padding;
+
+ out_params.Clear();
+
+ string ciphertext2 = EncryptMessage(message, params, &out_params);
+ vector<uint8_t> iv2 = CopyIv(out_params);
+ if (padding == PaddingMode::NONE)
+ EXPECT_EQ(message.size(), ciphertext2.size()) << "PaddingMode: " << padding;
+ else
+ EXPECT_EQ(message.size(), ciphertext2.size() - 16) << "PaddingMode: " << padding;
+
+ // IVs should be random
+ EXPECT_NE(iv1, iv2) << "PaddingMode: " << padding;
+
+ params.push_back(TAG_NONCE, iv1);
+ string plaintext = DecryptMessage(ciphertext1, params);
+ EXPECT_EQ(message, plaintext) << "PaddingMode: " << padding;
+ }
+}
+
+/*
* EncryptionOperationsTest.AesCallerNonce
*
* Verifies that AES caller-provided nonces work correctly.
@@ -6677,10 +6716,6 @@
} else {
std::cout << "NOT dumping attestations" << std::endl;
}
- // TODO(drysdale): Remove this flag when available KeyMint devices comply with spec
- if (std::string(argv[i]) == "--check_patchLevels") {
- aidl::android::hardware::security::keymint::test::check_patchLevels = true;
- }
}
}
return RUN_ALL_TESTS();
diff --git a/soundtrigger/2.0/vts/functional/OWNERS b/soundtrigger/2.0/vts/functional/OWNERS
new file mode 100644
index 0000000..3c24468
--- /dev/null
+++ b/soundtrigger/2.0/vts/functional/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 48436
+elaurent@google.com
+mdooley@google.com
+ytai@google.com
diff --git a/soundtrigger/2.1/vts/functional/OWNERS b/soundtrigger/2.1/vts/functional/OWNERS
new file mode 100644
index 0000000..3c24468
--- /dev/null
+++ b/soundtrigger/2.1/vts/functional/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 48436
+elaurent@google.com
+mdooley@google.com
+ytai@google.com
diff --git a/soundtrigger/2.3/vts/functional/OWNERS b/soundtrigger/2.3/vts/functional/OWNERS
new file mode 100644
index 0000000..3c24468
--- /dev/null
+++ b/soundtrigger/2.3/vts/functional/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 48436
+elaurent@google.com
+mdooley@google.com
+ytai@google.com
diff --git a/thermal/1.0/vts/functional/OWNERS b/thermal/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..0c282a0
--- /dev/null
+++ b/thermal/1.0/vts/functional/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 623506
+wvw@google.com
diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp
index 8e83d06..4385461 100644
--- a/tv/tuner/aidl/default/Demux.cpp
+++ b/tv/tuner/aidl/default/Demux.cpp
@@ -343,6 +343,10 @@
}
void Demux::startFrontendInputLoop() {
+ ALOGD("[Demux] start frontend on demux");
+ // Stop current Frontend thread loop first, in case the user starts a new
+ // tuning before stopping current tuning.
+ stopFrontendInput();
mFrontendInputThreadRunning = true;
mFrontendInputThread = std::thread(&Demux::frontendInputThreadLoop, this);
}
diff --git a/vibrator/aidl/OWNERS b/vibrator/aidl/OWNERS
index 4bd5614..e3d7e6b 100644
--- a/vibrator/aidl/OWNERS
+++ b/vibrator/aidl/OWNERS
@@ -1,4 +1,3 @@
+include platform/frameworks/base:/services/core/java/com/android/server/vibrator/OWNERS
chasewu@google.com
leungv@google.com
-lsandrade@google.com
-michaelwr@google.com
diff --git a/weaver/1.0/vts/functional/OWNERS b/weaver/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..ec8c304
--- /dev/null
+++ b/weaver/1.0/vts/functional/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 186411
+chengyouho@google.com
+frankwoo@google.com
diff --git a/wifi/1.5/default/wifi.cpp b/wifi/1.5/default/wifi.cpp
index b9f20a4..a85b242 100644
--- a/wifi/1.5/default/wifi.cpp
+++ b/wifi/1.5/default/wifi.cpp
@@ -131,8 +131,14 @@
WifiStatus wifi_status =
createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, error);
for (const auto& callback : event_cb_handler_.getCallbacks()) {
+ LOG(INFO) << "Attempting to invoke onSubsystemRestart "
+ "callback";
if (!callback->onSubsystemRestart(wifi_status).isOk()) {
- LOG(ERROR) << "Failed to invoke onFailure callback";
+ LOG(ERROR)
+ << "Failed to invoke onSubsystemRestart callback";
+ } else {
+ LOG(INFO) << "Succeeded to invoke onSubsystemRestart "
+ "callback";
}
}
};
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
index 8cb7e22..114fe4f 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -317,7 +317,7 @@
}
bool waitForFrameworkReady() {
- int waitCount = 10;
+ int waitCount = 15;
do {
// Check whether package service is ready or not.
if (!testing::checkSubstringInCommandOutput(
diff --git a/wifi/supplicant/1.4/vts/functional/Android.bp b/wifi/supplicant/1.4/vts/functional/Android.bp
index 8cbe04f..57ee830 100644
--- a/wifi/supplicant/1.4/vts/functional/Android.bp
+++ b/wifi/supplicant/1.4/vts/functional/Android.bp
@@ -77,7 +77,6 @@
"general-tests",
"vts",
],
- disable_framework: true,
}
cc_test {
@@ -108,5 +107,4 @@
"general-tests",
"vts",
],
- disable_framework: true,
}
diff --git a/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp
index 4427c390..d68520a 100644
--- a/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -49,6 +49,9 @@
public:
virtual void SetUp() override {
SupplicantHidlTestBaseV1_4::SetUp();
+ if (!isP2pOn_) {
+ GTEST_SKIP() << "Wi-Fi Direct is not supported, skip this test.";
+ }
p2p_iface_ = getSupplicantP2pIface_1_4(supplicant_);
ASSERT_NE(p2p_iface_.get(), nullptr);
}