Merge changes from topic "vhal_doc_update" into main
* changes:
Update doc for GLOVE_BOX_DOOR_POS.
Update doc for STEERING_WHEEL_HEIGHT.
Update doc for STEERING_WHEEL_DEPTH.
Update doc for WINDSHIELD_WIPERS_PERIOD.
Update doc for WINDOW_MOVE.
Update doc for WINDOW_POS.
Update doc for SEAT_WALK_IN_POS.
Update doc for SEAT_LUMBAR_VERTICAL.
Update doc for SEAT_CUSHION_SIDE_SUPPORT.
diff --git a/audio/aidl/vts/VtsHalAECTargetTest.cpp b/audio/aidl/vts/VtsHalAECTargetTest.cpp
index 53b6757..c007f18 100644
--- a/audio/aidl/vts/VtsHalAECTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAECTargetTest.cpp
@@ -139,12 +139,12 @@
};
TEST_P(AECParamTest, SetAndGetEchoDelay) {
- EXPECT_NO_FATAL_FAILURE(addEchoDelayParam(mEchoDelay));
+ addEchoDelayParam(mEchoDelay);
SetAndGetParameters();
}
TEST_P(AECParamTest, SetAndGetMobileMode) {
- EXPECT_NO_FATAL_FAILURE(addMobileModeParam(mMobileMode));
+ addMobileModeParam(mMobileMode);
SetAndGetParameters();
}
diff --git a/audio/aidl/vts/VtsHalAGC1TargetTest.cpp b/audio/aidl/vts/VtsHalAGC1TargetTest.cpp
index f14afbc..72a2d5e 100644
--- a/audio/aidl/vts/VtsHalAGC1TargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAGC1TargetTest.cpp
@@ -139,17 +139,17 @@
};
TEST_P(AGC1ParamTest, SetAndGetTargetPeakLevelParam) {
- EXPECT_NO_FATAL_FAILURE(addTargetPeakLevelParam(mTargetPeakLevel));
+ addTargetPeakLevelParam(mTargetPeakLevel);
SetAndGetParameters();
}
TEST_P(AGC1ParamTest, SetAndGetMaxCompressionGain) {
- EXPECT_NO_FATAL_FAILURE(addMaxCompressionGainParam(mMaxCompressionGain));
+ addMaxCompressionGainParam(mMaxCompressionGain);
SetAndGetParameters();
}
TEST_P(AGC1ParamTest, SetAndGetEnableLimiter) {
- EXPECT_NO_FATAL_FAILURE(addEnableLimiterParam(mEnableLimiter));
+ addEnableLimiterParam(mEnableLimiter);
SetAndGetParameters();
}
diff --git a/audio/aidl/vts/VtsHalAGC2TargetTest.cpp b/audio/aidl/vts/VtsHalAGC2TargetTest.cpp
index 048d540..ccac8c5 100644
--- a/audio/aidl/vts/VtsHalAGC2TargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAGC2TargetTest.cpp
@@ -145,17 +145,17 @@
};
TEST_P(AGC2ParamTest, SetAndGetDigitalGainParam) {
- EXPECT_NO_FATAL_FAILURE(addDigitalGainParam(mGain));
+ addDigitalGainParam(mGain);
SetAndGetParameters();
}
TEST_P(AGC2ParamTest, SetAndGetSaturationMargin) {
- EXPECT_NO_FATAL_FAILURE(addSaturationMarginParam(mMargin));
+ addSaturationMarginParam(mMargin);
SetAndGetParameters();
}
TEST_P(AGC2ParamTest, SetAndGetLevelEstimator) {
- EXPECT_NO_FATAL_FAILURE(addLevelEstimatorParam(mLevelEstimator));
+ addLevelEstimatorParam(mLevelEstimator);
SetAndGetParameters();
}
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 3b1f3d9..37441f0 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -542,7 +542,7 @@
};
TEST_P(DynamicsProcessingTestEngineArchitecture, SetAndGetEngineArch) {
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mCfg));
+ addEngineConfig(mCfg);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
@@ -594,7 +594,7 @@
};
TEST_P(DynamicsProcessingTestInputGain, SetAndGetInputGain) {
- EXPECT_NO_FATAL_FAILURE(addInputGain(mInputGain));
+ addInputGain(mInputGain);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
@@ -652,7 +652,7 @@
mInputGain.push_back(DynamicsProcessing::InputGain(i, gainDb));
}
std::vector<float> output(mInput.size());
- EXPECT_NO_FATAL_FAILURE(addInputGain(mInputGain));
+ addInputGain(mInputGain);
EXPECT_NO_FATAL_FAILURE(setParamsAndProcess(mInput, output));
if (!isAllParamsValid()) {
continue;
@@ -719,8 +719,8 @@
};
TEST_P(DynamicsProcessingTestLimiterConfig, SetAndGetLimiterConfig) {
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addLimiterConfig(mLimiterConfigList));
+ addEngineConfig(mEngineConfigPreset);
+ addLimiterConfig(mLimiterConfigList);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
@@ -782,8 +782,8 @@
}
void setLimiterParamsAndProcess(std::vector<float>& input, std::vector<float>& output) {
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addLimiterConfig(mLimiterConfigList));
+ addEngineConfig(mEngineConfigPreset);
+ addLimiterConfig(mLimiterConfigList);
EXPECT_NO_FATAL_FAILURE(setParamsAndProcess(input, output));
}
@@ -937,20 +937,20 @@
};
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPreEqChannelConfig) {
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(mCfg));
+ addEngineConfig(mEngineConfigPreset);
+ addPreEqChannelConfig(mCfg);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPostEqChannelConfig) {
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(mCfg));
+ addEngineConfig(mEngineConfigPreset);
+ addPostEqChannelConfig(mCfg);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetMbcChannelConfig) {
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(mCfg));
+ addEngineConfig(mEngineConfigPreset);
+ addMbcChannelConfig(mCfg);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
@@ -1018,27 +1018,27 @@
TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPreEqBandConfig) {
mEngineConfigPreset.preEqStage.bandCount = mCfgs.size();
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
+ addEngineConfig(mEngineConfigPreset);
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
for (int i = 0; i < mChannelCount; i++) {
cfgs[i].channel = i;
cfgs[i].enable = true;
}
- EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(cfgs));
- EXPECT_NO_FATAL_FAILURE(addPreEqBandConfigs(mCfgs));
+ addPreEqChannelConfig(cfgs);
+ addPreEqBandConfigs(mCfgs);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPostEqBandConfig) {
mEngineConfigPreset.postEqStage.bandCount = mCfgs.size();
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
+ addEngineConfig(mEngineConfigPreset);
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
for (int i = 0; i < mChannelCount; i++) {
cfgs[i].channel = i;
cfgs[i].enable = true;
}
- EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(cfgs));
- EXPECT_NO_FATAL_FAILURE(addPostEqBandConfigs(mCfgs));
+ addPostEqChannelConfig(cfgs);
+ addPostEqBandConfigs(mCfgs);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
@@ -1185,14 +1185,14 @@
TEST_P(DynamicsProcessingTestMbcBandConfig, SetAndGetMbcBandConfig) {
mEngineConfigPreset.mbcStage.bandCount = mCfgs.size();
- EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
+ addEngineConfig(mEngineConfigPreset);
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
for (int i = 0; i < mChannelCount; i++) {
cfgs[i].channel = i;
cfgs[i].enable = true;
}
- EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(cfgs));
- EXPECT_NO_FATAL_FAILURE(addMbcBandConfigs(mCfgs));
+ addMbcChannelConfig(cfgs);
+ addMbcBandConfigs(mCfgs);
ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
diff --git a/audio/aidl/vts/VtsHalNSTargetTest.cpp b/audio/aidl/vts/VtsHalNSTargetTest.cpp
index a50e1b4..c5a9bad 100644
--- a/audio/aidl/vts/VtsHalNSTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalNSTargetTest.cpp
@@ -140,12 +140,12 @@
};
TEST_P(NSParamTest, SetAndGetLevel) {
- EXPECT_NO_FATAL_FAILURE(addLevelParam(mLevel));
+ addLevelParam(mLevel);
SetAndGetParameters();
}
TEST_P(NSParamTest, SetAndGetType) {
- EXPECT_NO_FATAL_FAILURE(addLevelParam(mLevel));
+ addLevelParam(mLevel);
SetAndGetParameters();
}
diff --git a/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
index a942521..3b07809 100644
--- a/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
@@ -189,22 +189,22 @@
};
TEST_P(VisualizerParamTest, SetAndGetCaptureSize) {
- ASSERT_NO_FATAL_FAILURE(addCaptureSizeParam(mCaptureSize));
+ addCaptureSizeParam(mCaptureSize);
ASSERT_NO_FATAL_FAILURE(SetAndGetParameters());
}
TEST_P(VisualizerParamTest, SetAndGetScalingMode) {
- ASSERT_NO_FATAL_FAILURE(addScalingModeParam(mScalingMode));
+ addScalingModeParam(mScalingMode);
ASSERT_NO_FATAL_FAILURE(SetAndGetParameters());
}
TEST_P(VisualizerParamTest, SetAndGetMeasurementMode) {
- ASSERT_NO_FATAL_FAILURE(addMeasurementModeParam(mMeasurementMode));
+ addMeasurementModeParam(mMeasurementMode);
ASSERT_NO_FATAL_FAILURE(SetAndGetParameters());
}
TEST_P(VisualizerParamTest, SetAndGetLatency) {
- ASSERT_NO_FATAL_FAILURE(addLatencyParam(mLatency));
+ addLatencyParam(mLatency);
ASSERT_NO_FATAL_FAILURE(SetAndGetParameters());
}
@@ -212,10 +212,10 @@
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
bool allParamsValid = true;
- ASSERT_NO_FATAL_FAILURE(addCaptureSizeParam(mCaptureSize));
- ASSERT_NO_FATAL_FAILURE(addScalingModeParam(mScalingMode));
- ASSERT_NO_FATAL_FAILURE(addMeasurementModeParam(mMeasurementMode));
- ASSERT_NO_FATAL_FAILURE(addLatencyParam(mLatency));
+ addCaptureSizeParam(mCaptureSize);
+ addScalingModeParam(mScalingMode);
+ addMeasurementModeParam(mMeasurementMode);
+ addLatencyParam(mLatency);
ASSERT_NO_FATAL_FAILURE(SetAndGetParameters(&allParamsValid));
Parameter getParam;
@@ -276,9 +276,9 @@
for (float maxAudioSampleValue : testMaxAudioSampleValueList) {
bool allParamsValid = true;
- ASSERT_NO_FATAL_FAILURE(addCaptureSizeParam(mCaptureSize));
- ASSERT_NO_FATAL_FAILURE(addScalingModeParam(mScalingMode));
- ASSERT_NO_FATAL_FAILURE(addLatencyParam(mLatency));
+ addCaptureSizeParam(mCaptureSize);
+ addScalingModeParam(mScalingMode);
+ addLatencyParam(mLatency);
ASSERT_NO_FATAL_FAILURE(SetAndGetParameters(&allParamsValid));
generateSineWave(std::vector<int>{1000}, mInputBuffer, maxAudioSampleValue,
diff --git a/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
index 7a1f0e0..f910beb 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
+++ b/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
@@ -58,6 +58,7 @@
using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType;
using ::aidl::android::hardware::automotive::vehicle::HandsOnDetectionDriverState;
using ::aidl::android::hardware::automotive::vehicle::HandsOnDetectionWarning;
+using ::aidl::android::hardware::automotive::vehicle::HasSupportedValueInfo;
using ::aidl::android::hardware::automotive::vehicle::ImpactSensorLocation;
using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistCommand;
using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState;
@@ -600,6 +601,22 @@
if (!supportedEnumValues.empty()) {
areaConfig.supportedEnumValues = std::move(supportedEnumValues);
}
+
+ if (jsonAreaConfig.isMember("hasSupportedValueInfo")) {
+ HasSupportedValueInfo hasSupportedValueInfo = HasSupportedValueInfo{};
+ const Json::Value& jsonHasSupportedValueInfo = jsonAreaConfig["hasSupportedValueInfo"];
+ tryParseJsonValueToVariable(jsonHasSupportedValueInfo, "hasMinSupportedValue",
+ /*optional=*/true,
+ &hasSupportedValueInfo.hasMinSupportedValue, errors);
+ tryParseJsonValueToVariable(jsonHasSupportedValueInfo, "hasMaxSupportedValue",
+ /*optional=*/true,
+ &hasSupportedValueInfo.hasMaxSupportedValue, errors);
+ tryParseJsonValueToVariable(jsonHasSupportedValueInfo, "hasSupportedValuesList",
+ /*optional=*/true,
+ &hasSupportedValueInfo.hasSupportedValuesList, errors);
+ areaConfig.hasSupportedValueInfo = std::move(hasSupportedValueInfo);
+ }
+
config->config.areaConfigs.push_back(std::move(areaConfig));
RawPropValues areaValue = {};
diff --git a/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp b/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp
index 54afbd4..595c2ed 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp
@@ -26,6 +26,7 @@
namespace automotive {
namespace vehicle {
+using ::aidl::android::hardware::automotive::vehicle::HasSupportedValueInfo;
using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig;
@@ -803,6 +804,108 @@
ASSERT_EQ(areaConfig2.areaId, 1);
}
+TEST_F(JsonConfigLoaderUnitTest, testHasSupportedValueInfo_allTrue) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::CABIN_LIGHTS_SWITCH",
+ "areas": [{
+ "access": "VehiclePropertyAccess::WRITE",
+ "areaId": 0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true,
+ "hasSupportedValuesList": true
+ }
+ }],
+ "access": "VehiclePropertyAccess::READ",
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+ ASSERT_TRUE(result.ok());
+
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(config.areaConfigs.size(), 1u);
+
+ const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig.hasSupportedValueInfo, HasSupportedValueInfo({
+ .hasMinSupportedValue = true,
+ .hasMaxSupportedValue = true,
+ .hasSupportedValuesList = true,
+ }));
+}
+
+TEST_F(JsonConfigLoaderUnitTest, testHasSupportedValueInfo_allFalse) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::CABIN_LIGHTS_SWITCH",
+ "areas": [{
+ "access": "VehiclePropertyAccess::WRITE",
+ "areaId": 0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": false,
+ "hasMaxSupportedValue": false,
+ "hasSupportedValuesList": false
+ }
+ }],
+ "access": "VehiclePropertyAccess::READ",
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+ ASSERT_TRUE(result.ok());
+
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(config.areaConfigs.size(), 1u);
+
+ const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig.hasSupportedValueInfo, HasSupportedValueInfo({
+ .hasMinSupportedValue = false,
+ .hasMaxSupportedValue = false,
+ .hasSupportedValuesList = false,
+ }));
+}
+
+TEST_F(JsonConfigLoaderUnitTest, testHasSupportedValueInfo_unspecified) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::CABIN_LIGHTS_SWITCH",
+ "areas": [{
+ "access": "VehiclePropertyAccess::WRITE",
+ "areaId": 0
+ }],
+ "access": "VehiclePropertyAccess::READ",
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+ ASSERT_TRUE(result.ok());
+
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(config.areaConfigs.size(), 1u);
+
+ const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig.hasSupportedValueInfo, std::nullopt);
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json b/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json
index 73e4d44..83debf7 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json
+++ b/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json
@@ -99,12 +99,15 @@
{
"defaultValue": {
"int32Values": [
- 1
+ 2
]
},
"areaId": "VehicleAreaWindow::FRONT_WINDSHIELD",
- "minInt32Value": -100,
- "maxInt32Value": 100
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true,
+ "hasSupportedValuesList": true
+ }
},
{
"defaultValue": {
diff --git a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/include/FakeVehicleHardware.h
index 5916307..b7ada62 100644
--- a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/include/FakeVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/include/FakeVehicleHardware.h
@@ -108,6 +108,12 @@
aidl::android::hardware::automotive::vehicle::StatusCode unsubscribe(int32_t propId,
int32_t areaId) override;
+ std::vector<aidlvhal::MinMaxSupportedValueResult> getMinMaxSupportedValues(
+ const std::vector<PropIdAreaId>& propIdAreaIds) override;
+
+ std::vector<aidlvhal::SupportedValuesListResult> getSupportedValuesLists(
+ const std::vector<PropIdAreaId>& propIdAreaIds) override;
+
protected:
// mValuePool is also used in mServerSidePropStore.
const std::shared_ptr<VehiclePropValuePool> mValuePool;
diff --git a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/src/FakeVehicleHardware.cpp
index 52daf68..f1aaefc 100644
--- a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -62,11 +62,13 @@
using ::aidl::android::hardware::automotive::vehicle::ErrorState;
using ::aidl::android::hardware::automotive::vehicle::GetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::GetValueResult;
+using ::aidl::android::hardware::automotive::vehicle::MinMaxSupportedValueResult;
using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
using ::aidl::android::hardware::automotive::vehicle::SetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::SetValueResult;
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
+using ::aidl::android::hardware::automotive::vehicle::SupportedValuesListResult;
using ::aidl::android::hardware::automotive::vehicle::toString;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq;
@@ -2299,6 +2301,62 @@
return StatusCode::OK;
}
+std::vector<MinMaxSupportedValueResult> FakeVehicleHardware::getMinMaxSupportedValues(
+ const std::vector<PropIdAreaId>& propIdAreaIds) {
+ std::vector<MinMaxSupportedValueResult> results;
+ // We only support VENDOR_EXTENSION_INT_PROPERTY
+ for (const auto& propIdAreaId : propIdAreaIds) {
+ int propId = propIdAreaId.propId;
+ int areaId = propIdAreaId.areaId;
+ if (propId != toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY)) {
+ results.push_back(MinMaxSupportedValueResult{
+ .status = StatusCode::INVALID_ARG,
+ });
+ continue;
+ }
+ results.push_back(MinMaxSupportedValueResult{
+ .status = StatusCode::OK,
+ .minSupportedValue =
+ RawPropValues{
+ .int32Values = {0},
+ },
+ .maxSupportedValue =
+ RawPropValues{
+ .int32Values = {10},
+ },
+ });
+ }
+ return results;
+}
+
+std::vector<SupportedValuesListResult> FakeVehicleHardware::getSupportedValuesLists(
+ const std::vector<PropIdAreaId>& propIdAreaIds) {
+ std::vector<SupportedValuesListResult> results;
+ // We only support VENDOR_EXTENSION_INT_PROPERTY
+ for (const auto& propIdAreaId : propIdAreaIds) {
+ int propId = propIdAreaId.propId;
+ int areaId = propIdAreaId.areaId;
+ if (propId != toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY)) {
+ results.push_back(SupportedValuesListResult{
+ .status = StatusCode::INVALID_ARG,
+ });
+ continue;
+ }
+ results.push_back(SupportedValuesListResult{
+ .status = StatusCode::OK,
+ .supportedValuesList = std::vector<std::optional<RawPropValues>>({
+ RawPropValues{.int32Values = {0}},
+ RawPropValues{.int32Values = {2}},
+ RawPropValues{.int32Values = {4}},
+ RawPropValues{.int32Values = {6}},
+ RawPropValues{.int32Values = {8}},
+ RawPropValues{.int32Values = {10}},
+ }),
+ });
+ }
+ return results;
+}
+
bool FakeVehicleHardware::isVariableUpdateRateSupported(const VehiclePropConfig& vehiclePropConfig,
int32_t areaId) {
for (size_t i = 0; i < vehiclePropConfig.areaConfigs.size(); i++) {
diff --git a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
index f6098ca..29a690b 100644
--- a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
@@ -3884,6 +3884,44 @@
}
}
+TEST_F(FakeVehicleHardwareTest, testGetMinMaxSupportedValues) {
+ auto results = getHardware()->getMinMaxSupportedValues({
+ PropIdAreaId{.propId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY),
+ .areaId = 0},
+ PropIdAreaId{.propId = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), .areaId = 0},
+ });
+
+ ASSERT_EQ(results.size(), 2u);
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ EXPECT_NE(results[0].minSupportedValue, std::nullopt);
+ EXPECT_EQ(results[0].minSupportedValue.value(), RawPropValues{.int32Values = {0}});
+ EXPECT_NE(results[0].maxSupportedValue, std::nullopt);
+ EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {10}});
+ EXPECT_EQ(results[1].status, StatusCode::INVALID_ARG);
+}
+
+TEST_F(FakeVehicleHardwareTest, testGetSupportedValuesLists) {
+ auto results = getHardware()->getSupportedValuesLists({
+ PropIdAreaId{.propId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY),
+ .areaId = 0},
+ PropIdAreaId{.propId = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), .areaId = 0},
+ });
+
+ ASSERT_EQ(results.size(), 2u);
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ EXPECT_NE(results[0].supportedValuesList, std::nullopt);
+ EXPECT_NE((results[0].supportedValuesList)->size(), 0u);
+ EXPECT_EQ(results[0].supportedValuesList.value(), std::vector<std::optional<RawPropValues>>({
+ RawPropValues{.int32Values = {0}},
+ RawPropValues{.int32Values = {2}},
+ RawPropValues{.int32Values = {4}},
+ RawPropValues{.int32Values = {6}},
+ RawPropValues{.int32Values = {8}},
+ RawPropValues{.int32Values = {10}},
+ }));
+ EXPECT_EQ(results[1].status, StatusCode::INVALID_ARG);
+}
+
} // namespace fake
} // namespace vehicle
} // namespace automotive
diff --git a/automotive/vehicle/aidl/impl/current/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/current/vhal/include/DefaultVehicleHal.h
index 42902fe..d360be0 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/include/DefaultVehicleHal.h
+++ b/automotive/vehicle/aidl/impl/current/vhal/include/DefaultVehicleHal.h
@@ -219,7 +219,7 @@
// mBinderEvents.
void onBinderDiedUnlinkedHandler();
- size_t countSubscribeClients();
+ size_t countClients();
// Handles the property change events in batch.
void handleBatchedPropertyEvents(std::vector<aidlvhal::VehiclePropValue>&& batchedEvents);
diff --git a/automotive/vehicle/aidl/impl/current/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/current/vhal/include/SubscriptionManager.h
index fa438ec..f4e6ced 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/include/SubscriptionManager.h
+++ b/automotive/vehicle/aidl/impl/current/vhal/include/SubscriptionManager.h
@@ -146,6 +146,7 @@
private:
// Friend class for testing.
friend class DefaultVehicleHalTest;
+ friend class SubscriptionManagerTest;
IVehicleHardware* mVehicleHardware;
diff --git a/automotive/vehicle/aidl/impl/current/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/current/vhal/src/DefaultVehicleHal.cpp
index 050f88d..ea0c215 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/src/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/aidl/impl/current/vhal/src/DefaultVehicleHal.cpp
@@ -1336,15 +1336,19 @@
dprintf(fd, "Containing %zu property configs\n", configsByPropIdCopy.size());
dprintf(fd, "Currently have %zu getValues clients\n", mGetValuesClients.size());
dprintf(fd, "Currently have %zu setValues clients\n", mSetValuesClients.size());
- dprintf(fd, "Currently have %zu subscribe clients\n", countSubscribeClients());
+ dprintf(fd, "Currently have %zu subscribe clients\n",
+ mSubscriptionManager->countPropertyChangeClients());
dprintf(fd, "Currently have %zu supported values change subscribe clients\n",
mSubscriptionManager->countSupportedValueChangeClients());
}
return STATUS_OK;
}
-size_t DefaultVehicleHal::countSubscribeClients() {
- return mSubscriptionManager->countPropertyChangeClients();
+size_t DefaultVehicleHal::countClients() {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ return mGetValuesClients.size() + mSetValuesClients.size() +
+ mSubscriptionManager->countPropertyChangeClients() +
+ mSubscriptionManager->countSupportedValueChangeClients();
}
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/current/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/current/vhal/src/SubscriptionManager.cpp
index 946c217..64c46c9 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/src/SubscriptionManager.cpp
+++ b/automotive/vehicle/aidl/impl/current/vhal/src/SubscriptionManager.cpp
@@ -414,7 +414,6 @@
std::scoped_lock<std::mutex> lockGuard(mLock);
ClientIdType clientId = callback->asBinder().get();
- ALOGE("ClientId: %p", clientId);
// It is possible that some of the [propId, areaId]s are already subscribed, IVehicleHardware
// will ignore them.
@@ -479,7 +478,7 @@
mSupportedValueChangeClientsByPropIdAreaId.end()) {
mSupportedValueChangeClientsByPropIdAreaId[propIdAreaId].erase(clientId);
}
- if (mSupportedValueChangeClientsByPropIdAreaId.empty()) {
+ if (mSupportedValueChangeClientsByPropIdAreaId[propIdAreaId].empty()) {
mSupportedValueChangeClientsByPropIdAreaId.erase(propIdAreaId);
}
mSupportedValueChangePropIdAreaIdsByClient[clientId].erase(propIdAreaId);
diff --git a/automotive/vehicle/aidl/impl/current/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/current/vhal/test/DefaultVehicleHalTest.cpp
index 90b34c4..ab5f667 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/test/DefaultVehicleHalTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/vhal/test/DefaultVehicleHalTest.cpp
@@ -445,11 +445,7 @@
size_t countPendingRequests() { return mVhal->mPendingRequestPool->countPendingRequests(); }
- size_t countClients() {
- std::scoped_lock<std::mutex> lockGuard(mVhal->mLock);
- return mVhal->mGetValuesClients.size() + mVhal->mSetValuesClients.size() +
- mVhal->countSubscribeClients();
- }
+ size_t countClients() { return mVhal->countClients(); }
std::shared_ptr<PendingRequestPool> getPool() { return mVhal->mPendingRequestPool; }
@@ -2575,8 +2571,10 @@
ASSERT_TRUE(status.isOk()) << "Get non-okay status from unregisterSupportedValueChangeCallback"
<< status.getMessage();
- ASSERT_TRUE(getHardware()->getSubscribedSupportedValueChangePropIdAreaIds().empty())
+ EXPECT_TRUE(getHardware()->getSubscribedSupportedValueChangePropIdAreaIds().empty())
<< "All registered [propId, areaId]s must be unregistered";
+ EXPECT_EQ(countClients(), static_cast<size_t>(0)) << "subscribe clients must be cleared";
+ EXPECT_TRUE(hasNoSubscriptions()) << "subscribe clients must be cleared";
}
TEST_F(DefaultVehicleHalTest, testUnregisterSupportedValueChangeCallback_errorFromHardware) {
diff --git a/automotive/vehicle/aidl/impl/current/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/current/vhal/test/SubscriptionManagerTest.cpp
index 6d0844a..d624cce 100644
--- a/automotive/vehicle/aidl/impl/current/vhal/test/SubscriptionManagerTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/vhal/test/SubscriptionManagerTest.cpp
@@ -124,6 +124,8 @@
std::shared_ptr<MockVehicleHardware> getHardware() { return mHardware; }
+ bool isEmpty() { return mManager->isEmpty(); }
+
private:
std::unique_ptr<SubscriptionManager> mManager;
std::shared_ptr<PropertyCallback> mCallback;
@@ -946,6 +948,19 @@
<< "Incorrect supported value change events for client1";
ASSERT_THAT(clients[client2], UnorderedElementsAre(propIdAreaId2))
<< "Incorrect supported value change events for client2";
+
+ result = getManager()->unsubscribeSupportedValueChange(binder2.get(), {propIdAreaId2});
+
+ ASSERT_TRUE(result.ok()) << "failed to call unsubscribeSupportedValueChange"
+ << result.error().message();
+
+ result = getManager()->unsubscribeSupportedValueChange(binder1.get(), {propIdAreaId1});
+
+ ASSERT_TRUE(result.ok()) << "failed to call unsubscribeSupportedValueChange"
+ << result.error().message();
+
+ EXPECT_EQ(getManager()->countSupportedValueChangeClients(), 0u) << "All clients cleared";
+ EXPECT_TRUE(isEmpty()) << "All clients cleared";
}
} // namespace vehicle
diff --git a/security/keymint/aidl/default/hal/lib.rs b/security/keymint/aidl/default/hal/lib.rs
index fad807f..359890d 100644
--- a/security/keymint/aidl/default/hal/lib.rs
+++ b/security/keymint/aidl/default/hal/lib.rs
@@ -20,22 +20,39 @@
use kmr_hal::env::get_property;
use log::error;
+/// Retrieve the most significant attestation property for `name`.
+fn attestation_property(name: &str) -> Vec<u8> {
+ let prop_val =
+ get_property(&format!("ro.product.{}_for_attestation", name)).unwrap_or_default();
+ if !prop_val.is_empty() {
+ prop_val
+ } else {
+ let prop_val = get_property(&format!("ro.product.vendor.{}", name)).unwrap_or_default();
+ if !prop_val.is_empty() {
+ prop_val
+ } else {
+ get_property(&format!("ro.product.{}", name))
+ .unwrap_or_else(|prop_name| format!("{} unavailable", prop_name))
+ }
+ }
+ .as_bytes()
+ .to_vec()
+}
+
/// Populate attestation ID information based on properties (where available).
/// Retrieving the serial number requires SELinux permission.
pub fn attestation_id_info() -> kmr_wire::AttestationIdInfo {
- let prop = |name| {
- get_property(name)
- .unwrap_or_else(|_| format!("{} unavailable", name))
- .as_bytes()
- .to_vec()
- };
+
kmr_wire::AttestationIdInfo {
- brand: prop("ro.product.brand"),
- device: prop("ro.product.device"),
- product: prop("ro.product.name"),
- serial: prop("ro.serialno"),
- manufacturer: prop("ro.product.manufacturer"),
- model: prop("ro.product.model"),
+ brand: attestation_property("brand"),
+ device: attestation_property("device"),
+ product: attestation_property("name"),
+ serial: get_property("ro.serialno")
+ .unwrap_or_else(|_| format!("ro.serialno unavailable"))
+ .as_bytes()
+ .to_vec(),
+ manufacturer: attestation_property("manufacturer"),
+ model: attestation_property("model"),
// Currently modem_simulator always returns one fixed value. See `handleGetIMEI` in
// device/google/cuttlefish/host/commands/modem_simulator/misc_service.cpp for more details.
// TODO(b/263188546): Use device-specific IMEI values when available.
diff --git a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
index 5e8e21f..f997c43 100644
--- a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
@@ -36,6 +36,7 @@
using aidl::android::hardware::wifi::Ssid;
using aidl::android::hardware::wifi::StaApfPacketFilterCapabilities;
using aidl::android::hardware::wifi::StaBackgroundScanCapabilities;
+using aidl::android::hardware::wifi::StaBackgroundScanParameters;
using aidl::android::hardware::wifi::StaLinkLayerStats;
using aidl::android::hardware::wifi::StaRoamingCapabilities;
using aidl::android::hardware::wifi::StaRoamingConfig;
@@ -47,6 +48,12 @@
using aidl::android::hardware::wifi::WifiDebugTxPacketFateReport;
using aidl::android::hardware::wifi::WifiStatusCode;
+namespace {
+const int kTestCmdId = 123;
+const std::array<uint8_t, 6> kTestMacAddr1 = {0x1a, 0x2b, 0x3c, 0x4d, 0x5e, 0x6f};
+const std::array<uint8_t, 6> kTestMacAddr2 = {0x4a, 0x5b, 0x6c, 0x7d, 0x8e, 0x9f};
+} // namespace
+
class WifiStaIfaceAidlTest : public testing::TestWithParam<std::string> {
public:
void SetUp() override {
@@ -523,6 +530,52 @@
EXPECT_TRUE(wifi_sta_iface_->twtSessionResume(1, 10).isOk());
}
+/*
+ * GetName
+ */
+TEST_P(WifiStaIfaceAidlTest, GetName) {
+ std::string ifaceName;
+ EXPECT_TRUE(wifi_sta_iface_->getName(&ifaceName).isOk());
+}
+
+/*
+ * SetDtimMultiplier
+ */
+TEST_P(WifiStaIfaceAidlTest, SetDtimMultiplier) {
+ // Multiplied value
+ EXPECT_TRUE(wifi_sta_iface_->setDtimMultiplier(2).isOk());
+ // Driver default value
+ EXPECT_TRUE(wifi_sta_iface_->setDtimMultiplier(0).isOk());
+}
+
+/*
+ * Start/Stop Background Scan
+ */
+TEST_P(WifiStaIfaceAidlTest, StartAndStopBackgroundScan) {
+ if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::BACKGROUND_SCAN)) {
+ GTEST_SKIP() << "Background scan is not supported";
+ }
+ StaBackgroundScanParameters scanParams;
+ EXPECT_TRUE(wifi_sta_iface_->startBackgroundScan(kTestCmdId, scanParams).isOk());
+ EXPECT_TRUE(wifi_sta_iface_->stopBackgroundScan(kTestCmdId).isOk());
+}
+
+/*
+ * Start/Stop Sending Keep-Alive Packets
+ */
+TEST_P(WifiStaIfaceAidlTest, StartAndStopSendingKeepAlivePackets) {
+ std::vector<uint8_t> ipPacketData(20);
+ uint16_t etherType = 0x0800; // IPv4
+ uint32_t periodInMs = 1000; // 1 sec
+
+ // Expected to fail with test values
+ EXPECT_FALSE(wifi_sta_iface_
+ ->startSendingKeepAlivePackets(kTestCmdId, ipPacketData, etherType,
+ kTestMacAddr1, kTestMacAddr2, periodInMs)
+ .isOk());
+ EXPECT_FALSE(wifi_sta_iface_->stopSendingKeepAlivePackets(kTestCmdId).isOk());
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiStaIfaceAidlTest);
INSTANTIATE_TEST_SUITE_P(WifiTest, WifiStaIfaceAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)),