Merge "BufferQueues: clean up BufferItemConsumer constructors" into main
diff --git a/audio/aidl/default/include/core-impl/DriverStubImpl.h b/audio/aidl/default/include/core-impl/DriverStubImpl.h
index a1a6c82..84f869a 100644
--- a/audio/aidl/default/include/core-impl/DriverStubImpl.h
+++ b/audio/aidl/default/include/core-impl/DriverStubImpl.h
@@ -22,7 +22,9 @@
class DriverStubImpl : virtual public DriverInterface {
public:
- explicit DriverStubImpl(const StreamContext& context);
+ explicit DriverStubImpl(const StreamContext& context)
+ : DriverStubImpl(context, 500 /*asyncSleepTimeUs*/) {}
+ DriverStubImpl(const StreamContext& context, int asyncSleepTimeUs);
::android::status_t init(DriverCallbackInterface* callback) override;
::android::status_t drain(StreamDescriptor::DrainMode) override;
@@ -40,6 +42,8 @@
const int mSampleRate;
const bool mIsAsynchronous;
const bool mIsInput;
+ const int32_t mMixPortHandle;
+ const int mAsyncSleepTimeUs;
bool mIsInitialized = false; // Used for validating the state machine logic.
bool mIsStandby = true; // Used for validating the state machine logic.
int64_t mStartTimeNs = 0;
diff --git a/audio/aidl/default/include/core-impl/StreamOffloadStub.h b/audio/aidl/default/include/core-impl/StreamOffloadStub.h
index 3b452f9..67abe95 100644
--- a/audio/aidl/default/include/core-impl/StreamOffloadStub.h
+++ b/audio/aidl/default/include/core-impl/StreamOffloadStub.h
@@ -60,11 +60,14 @@
::android::status_t drain(StreamDescriptor::DrainMode drainMode) override;
::android::status_t flush() override;
::android::status_t pause() override;
+ ::android::status_t start() override;
::android::status_t transfer(void* buffer, size_t frameCount, size_t* actualFrameCount,
int32_t* latencyMs) override;
void shutdown() override;
private:
+ ::android::status_t startWorkerIfNeeded();
+
DspSimulatorState mState;
DspSimulatorWorker mDspWorker;
bool mDspWorkerStarted = false;
diff --git a/audio/aidl/default/stub/DriverStubImpl.cpp b/audio/aidl/default/stub/DriverStubImpl.cpp
index 107affb..0d129e6 100644
--- a/audio/aidl/default/stub/DriverStubImpl.cpp
+++ b/audio/aidl/default/stub/DriverStubImpl.cpp
@@ -24,19 +24,27 @@
namespace aidl::android::hardware::audio::core {
-DriverStubImpl::DriverStubImpl(const StreamContext& context)
+DriverStubImpl::DriverStubImpl(const StreamContext& context, int asyncSleepTimeUs)
: mBufferSizeFrames(context.getBufferSizeInFrames()),
mFrameSizeBytes(context.getFrameSize()),
mSampleRate(context.getSampleRate()),
mIsAsynchronous(!!context.getAsyncCallback()),
- mIsInput(context.isInput()) {}
+ mIsInput(context.isInput()),
+ mMixPortHandle(context.getMixPortHandle()),
+ mAsyncSleepTimeUs(asyncSleepTimeUs) {}
+
+#define LOG_ENTRY() \
+ LOG(DEBUG) << "[" << (mIsInput ? "in" : "out") << "|ioHandle:" << mMixPortHandle << "] " \
+ << __func__;
::android::status_t DriverStubImpl::init(DriverCallbackInterface* /*callback*/) {
+ LOG_ENTRY();
mIsInitialized = true;
return ::android::OK;
}
::android::status_t DriverStubImpl::drain(StreamDescriptor::DrainMode) {
+ LOG_ENTRY();
if (!mIsInitialized) {
LOG(FATAL) << __func__ << ": must not happen for an uninitialized driver";
}
@@ -46,14 +54,15 @@
const size_t delayUs = static_cast<size_t>(
std::roundf(mBufferSizeFrames * kMicrosPerSecond / mSampleRate));
usleep(delayUs);
- } else {
- usleep(500);
+ } else if (mAsyncSleepTimeUs) {
+ usleep(mAsyncSleepTimeUs);
}
}
return ::android::OK;
}
::android::status_t DriverStubImpl::flush() {
+ LOG_ENTRY();
if (!mIsInitialized) {
LOG(FATAL) << __func__ << ": must not happen for an uninitialized driver";
}
@@ -61,6 +70,7 @@
}
::android::status_t DriverStubImpl::pause() {
+ LOG_ENTRY();
if (!mIsInitialized) {
LOG(FATAL) << __func__ << ": must not happen for an uninitialized driver";
}
@@ -68,6 +78,7 @@
}
::android::status_t DriverStubImpl::standby() {
+ LOG_ENTRY();
if (!mIsInitialized) {
LOG(FATAL) << __func__ << ": must not happen for an uninitialized driver";
}
@@ -76,6 +87,7 @@
}
::android::status_t DriverStubImpl::start() {
+ LOG_ENTRY();
if (!mIsInitialized) {
LOG(FATAL) << __func__ << ": must not happen for an uninitialized driver";
}
@@ -87,6 +99,7 @@
::android::status_t DriverStubImpl::transfer(void* buffer, size_t frameCount,
size_t* actualFrameCount, int32_t*) {
+ // No LOG_ENTRY as this is called very often.
if (!mIsInitialized) {
LOG(FATAL) << __func__ << ": must not happen for an uninitialized driver";
}
@@ -95,7 +108,7 @@
}
*actualFrameCount = frameCount;
if (mIsAsynchronous) {
- usleep(500);
+ if (mAsyncSleepTimeUs) usleep(mAsyncSleepTimeUs);
} else {
mFramesSinceStart += *actualFrameCount;
const long bufferDurationUs = (*actualFrameCount) * MICROS_PER_SECOND / mSampleRate;
@@ -120,6 +133,7 @@
}
void DriverStubImpl::shutdown() {
+ LOG_ENTRY();
mIsInitialized = false;
}
diff --git a/audio/aidl/default/stub/StreamOffloadStub.cpp b/audio/aidl/default/stub/StreamOffloadStub.cpp
index fb12697..95cef35 100644
--- a/audio/aidl/default/stub/StreamOffloadStub.cpp
+++ b/audio/aidl/default/stub/StreamOffloadStub.cpp
@@ -81,11 +81,13 @@
}
DriverOffloadStubImpl::DriverOffloadStubImpl(const StreamContext& context)
- : DriverStubImpl(context),
+ : DriverStubImpl(context, 0 /*asyncSleepTimeUs*/),
mState{context.getFormat().encoding, context.getSampleRate(),
250 /*earlyNotifyMs*/ * context.getSampleRate() / MILLIS_PER_SECOND,
static_cast<int64_t>(context.getBufferSizeInFrames()) / 2},
- mDspWorker(mState) {}
+ mDspWorker(mState) {
+ LOG_IF(FATAL, !mIsAsynchronous) << "The steam must be used in asynchronous mode";
+}
::android::status_t DriverOffloadStubImpl::init(DriverCallbackInterface* callback) {
RETURN_STATUS_IF_ERROR(DriverStubImpl::init(callback));
@@ -99,10 +101,7 @@
}
::android::status_t DriverOffloadStubImpl::drain(StreamDescriptor::DrainMode drainMode) {
- // Does not call into the DriverStubImpl::drain.
- if (!mIsInitialized) {
- LOG(FATAL) << __func__ << ": must not happen for an uninitialized driver";
- }
+ RETURN_STATUS_IF_ERROR(DriverStubImpl::drain(drainMode));
std::lock_guard l(mState.lock);
if (!mState.clipFramesLeft.empty()) {
// Cut playback of the current clip.
@@ -132,23 +131,27 @@
return ::android::OK;
}
+::android::status_t DriverOffloadStubImpl::start() {
+ RETURN_STATUS_IF_ERROR(DriverStubImpl::start());
+ RETURN_STATUS_IF_ERROR(startWorkerIfNeeded());
+ bool hasClips; // Can be start after paused draining.
+ {
+ std::lock_guard l(mState.lock);
+ hasClips = !mState.clipFramesLeft.empty();
+ LOG(DEBUG) << __func__
+ << ": clipFramesLeft: " << ::android::internal::ToString(mState.clipFramesLeft);
+ }
+ if (hasClips) {
+ mDspWorker.resume();
+ }
+ return ::android::OK;
+}
+
::android::status_t DriverOffloadStubImpl::transfer(void* buffer, size_t frameCount,
- size_t* actualFrameCount,
- int32_t* /*latencyMs*/) {
- // Does not call into the DriverStubImpl::transfer.
- if (!mIsInitialized) {
- LOG(FATAL) << __func__ << ": must not happen for an uninitialized driver";
- }
- if (mIsStandby) {
- LOG(FATAL) << __func__ << ": must not happen while in standby";
- }
- if (!mDspWorkerStarted) {
- // This is an "audio service thread," must have elevated priority.
- if (!mDspWorker.start("dsp_sim", ANDROID_PRIORITY_URGENT_AUDIO)) {
- return ::android::NO_INIT;
- }
- mDspWorkerStarted = true;
- }
+ size_t* actualFrameCount, int32_t* latencyMs) {
+ RETURN_STATUS_IF_ERROR(
+ DriverStubImpl::transfer(buffer, frameCount, actualFrameCount, latencyMs));
+ RETURN_STATUS_IF_ERROR(startWorkerIfNeeded());
// Scan the buffer for clip headers.
*actualFrameCount = frameCount;
while (buffer != nullptr && frameCount > 0) {
@@ -189,6 +192,18 @@
void DriverOffloadStubImpl::shutdown() {
LOG(DEBUG) << __func__ << ": stopping the DSP simulator worker";
mDspWorker.stop();
+ DriverStubImpl::shutdown();
+}
+
+::android::status_t DriverOffloadStubImpl::startWorkerIfNeeded() {
+ if (!mDspWorkerStarted) {
+ // This is an "audio service thread," must have elevated priority.
+ if (!mDspWorker.start("dsp_sim", ANDROID_PRIORITY_URGENT_AUDIO)) {
+ return ::android::NO_INIT;
+ }
+ mDspWorkerStarted = true;
+ }
+ return ::android::OK;
}
// static
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index 8bbb60b..21b7aff 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -5012,7 +5012,7 @@
std::make_tuple(std::string("Pause"), kAidlVersion1, 0, StreamTypeFilter::SYNC,
makePauseCommands(false, true), false /*validatePositionIncrease*/);
static const NamedCommandSequence kPauseOutAsyncSeq =
- std::make_tuple(std::string("Pause"), kAidlVersion1, kStreamTransientStateTransitionDelayMs,
+ std::make_tuple(std::string("Pause"), kAidlVersion3, kStreamTransientStateTransitionDelayMs,
StreamTypeFilter::ASYNC, makePauseCommands(false, false),
false /*validatePositionIncrease*/);
@@ -5117,9 +5117,8 @@
kDrainOutSyncSeq, kDrainOutAsyncSeq,
kDrainEarlyOutAsyncSeq, kDrainPauseOutSyncSeq,
kDrainPauseOutAsyncSeq, kDrainEarlyPauseOutAsyncSeq,
- kStandbyOutSyncSeq, kStandbyOutAsyncSeq,
- kPauseOutSyncSeq, // kPauseOutAsyncSeq,
- kFlushOutSyncSeq, kFlushOutAsyncSeq,
+ kStandbyOutSyncSeq, kStandbyOutAsyncSeq, kPauseOutSyncSeq,
+ kPauseOutAsyncSeq, kFlushOutSyncSeq, kFlushOutAsyncSeq,
kDrainPauseFlushOutSyncSeq, kDrainPauseFlushOutAsyncSeq),
testing::Values(false, true)),
GetStreamIoTestName);
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 95bcaf0..2bb0a72 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -120,6 +120,14 @@
float calculateDb(const std::vector<float>& input, size_t startSamplePos);
+ void getMagnitudeValue(const std::vector<float>& output, std::vector<float>& bufferMag);
+
+ void checkInputAndOutputEquality(const std::vector<float>& outputMag);
+
+ void setUpDataTest(const std::vector<int>& testFrequencies, float fullScaleSineDb);
+
+ void createChannelConfig();
+
// enqueue test parameters
void addEngineConfig(const DynamicsProcessing::EngineArchitecture& cfg);
void addPreEqChannelConfig(const std::vector<DynamicsProcessing::ChannelConfig>& cfg);
@@ -137,7 +145,24 @@
static constexpr int kFrameCount = 2048;
static constexpr int kInputFrequency = 1000;
static constexpr size_t kStartIndex = 15 * kSamplingFrequency / 1000; // skip 15ms
- static constexpr float kToleranceDb = 0.05;
+ static constexpr float kToleranceDb = 0.5;
+ static constexpr int kNPointFFT = 1024;
+ static constexpr float kBinWidth = (float)kSamplingFrequency / kNPointFFT;
+ // Full scale sine wave with 1000 Hz frequency is -3 dB
+ static constexpr float kSineFullScaleDb = -3;
+ // Full scale sine wave with 100 Hz and 1000 Hz frequency is -6 dB
+ static constexpr float kSineMultitoneFullScaleDb = -6;
+ const std::vector<int> kCutoffFreqHz = {200 /*0th band cutoff*/, 2000 /*1st band cutoff*/};
+ std::vector<int> mMultitoneTestFrequencies = {100, 1000};
+ // Calculating normalizing factor by dividing the number of FFT points by half and the number of
+ // test frequencies. The normalization accounts for the FFT splitting the signal into positive
+ // and negative frequencies. Additionally, during multi-tone input generation, sample values are
+ // normalized to the range [-1, 1] by dividing them by the number of test frequencies.
+ float mNormalizingFactor = (kNPointFFT / (2 * mMultitoneTestFrequencies.size()));
+ std::vector<int> mBinOffsets;
+ std::vector<DynamicsProcessing::ChannelConfig> mChannelConfig;
+ std::vector<float> mInput;
+ float mInputDb;
std::shared_ptr<IFactory> mFactory;
std::shared_ptr<IEffect> mEffect;
Descriptor mDescriptor;
@@ -416,6 +441,38 @@
}
}
+void DynamicsProcessingTestHelper::getMagnitudeValue(const std::vector<float>& output,
+ std::vector<float>& bufferMag) {
+ std::vector<float> subOutput(output.begin() + kStartIndex, output.end());
+ EXPECT_NO_FATAL_FAILURE(calculateMagnitudeMono(bufferMag, subOutput, mBinOffsets, kNPointFFT));
+}
+
+void DynamicsProcessingTestHelper::checkInputAndOutputEquality(
+ const std::vector<float>& outputMag) {
+ std::vector<float> inputMag(mBinOffsets.size());
+ EXPECT_NO_FATAL_FAILURE(getMagnitudeValue(mInput, inputMag));
+ for (size_t i = 0; i < inputMag.size(); i++) {
+ EXPECT_NEAR(calculateDb({inputMag[i] / mNormalizingFactor}),
+ calculateDb({outputMag[i] / mNormalizingFactor}), kToleranceDb);
+ }
+}
+
+void DynamicsProcessingTestHelper::setUpDataTest(const std::vector<int>& testFrequencies,
+ float fullScaleSineDb) {
+ ASSERT_NO_FATAL_FAILURE(SetUpDynamicsProcessingEffect());
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(
+ generateSineWave(testFrequencies, mInput, 1.0, kSamplingFrequency, mChannelLayout));
+ mInputDb = calculateDb(mInput);
+ ASSERT_NEAR(mInputDb, fullScaleSineDb, kToleranceDb);
+}
+
+void DynamicsProcessingTestHelper::createChannelConfig() {
+ for (int i = 0; i < mChannelCount; i++) {
+ mChannelConfig.push_back(DynamicsProcessing::ChannelConfig(i, true));
+ }
+}
+
void DynamicsProcessingTestHelper::addEngineConfig(
const DynamicsProcessing::EngineArchitecture& cfg) {
DynamicsProcessing dp;
@@ -527,6 +584,15 @@
.postGainDb = postGainDb};
}
+DynamicsProcessing::EqBandConfig creatEqBandConfig(int channel, int band, float cutOffFreqHz,
+ float gainDb) {
+ return DynamicsProcessing::EqBandConfig{.channel = channel,
+ .band = band,
+ .enable = true,
+ .cutoffFrequencyHz = cutOffFreqHz,
+ .gainDb = gainDb};
+}
+
/**
* Test DynamicsProcessing Engine Configuration
*/
@@ -649,13 +715,7 @@
mInput.resize(kFrameCount * mChannelCount);
}
- void SetUp() override {
- SetUpDynamicsProcessingEffect();
- SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
- ASSERT_NO_FATAL_FAILURE(generateSineWave(kInputFrequency /*Input Frequency*/, mInput, 1.0,
- kSamplingFrequency, mChannelLayout));
- mInputDb = calculateDb(mInput);
- }
+ void SetUp() override { setUpDataTest({static_cast<int>(kInputFrequency)}, kSineFullScaleDb); }
void TearDown() override { TearDownDynamicsProcessingEffect(); }
@@ -665,8 +725,6 @@
}
std::vector<DynamicsProcessing::InputGain> mInputGain;
- std::vector<float> mInput;
- float mInputDb;
};
TEST_P(DynamicsProcessingInputGainDataTest, SetAndGetInputGain) {
@@ -785,14 +843,7 @@
mInput.resize(mBufferSize);
}
- void SetUp() override {
- SetUpDynamicsProcessingEffect();
- SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
- ASSERT_NO_FATAL_FAILURE(
- generateSineWave(kInputFrequency, mInput, 1.0, kSamplingFrequency, mChannelLayout));
- mInputDb = calculateDb(mInput);
- ASSERT_NEAR(mInputDb, kSineFullScaleDb, kToleranceDb);
- }
+ void SetUp() override { setUpDataTest({static_cast<int>(kInputFrequency)}, kSineFullScaleDb); }
void TearDown() override { TearDownDynamicsProcessingEffect(); }
@@ -825,11 +876,8 @@
static constexpr float kDefaultThreshold = -10;
static constexpr float kDefaultPostGain = 0;
static constexpr float kInputFrequency = 1000;
- // Full scale sine wave with 1000 Hz frequency is -3 dB
- static constexpr float kSineFullScaleDb = -3;
+ static constexpr float kLimiterTestToleranceDb = 0.05;
std::vector<DynamicsProcessing::LimiterConfig> mLimiterConfigList;
- std::vector<float> mInput;
- float mInputDb;
int mBufferSize;
};
@@ -849,7 +897,7 @@
}
float outputDb = calculateDb(output, kStartIndex);
if (threshold >= mInputDb || kDefaultRatio == 1) {
- EXPECT_NEAR(mInputDb, outputDb, kToleranceDb);
+ EXPECT_NEAR(mInputDb, outputDb, kLimiterTestToleranceDb);
} else {
float calculatedThreshold = 0;
ASSERT_NO_FATAL_FAILURE(computeThreshold(kDefaultRatio, outputDb, calculatedThreshold));
@@ -876,7 +924,7 @@
float outputDb = calculateDb(output, kStartIndex);
if (kDefaultThreshold >= mInputDb) {
- EXPECT_NEAR(mInputDb, outputDb, kToleranceDb);
+ EXPECT_NEAR(mInputDb, outputDb, kLimiterTestToleranceDb);
} else {
float calculatedRatio = 0;
ASSERT_NO_FATAL_FAILURE(computeRatio(kDefaultThreshold, outputDb, calculatedRatio));
@@ -894,7 +942,7 @@
ASSERT_NO_FATAL_FAILURE(generateSineWave(kInputFrequency, mInput, dBToAmplitude(postGainDb),
kSamplingFrequency, mChannelLayout));
mInputDb = calculateDb(mInput);
- EXPECT_NEAR(mInputDb, kSineFullScaleDb - postGainDb, kToleranceDb);
+ EXPECT_NEAR(mInputDb, kSineFullScaleDb - postGainDb, kLimiterTestToleranceDb);
for (int i = 0; i < mChannelCount; i++) {
fillLimiterConfig(mLimiterConfigList, i, true, kDefaultLinkerGroup, kDefaultAttackTime,
kDefaultReleaseTime, 1, kDefaultThreshold, postGainDb);
@@ -904,7 +952,7 @@
continue;
}
float outputDb = calculateDb(output, kStartIndex);
- EXPECT_NEAR(outputDb, mInputDb + postGainDb, kToleranceDb)
+ EXPECT_NEAR(outputDb, mInputDb + postGainDb, kLimiterTestToleranceDb)
<< "PostGain: " << postGainDb << ", OutputDb: " << outputDb;
}
}
@@ -927,7 +975,7 @@
if (isEnabled) {
EXPECT_NE(mInputDb, calculateDb(output, kStartIndex));
} else {
- EXPECT_NEAR(mInputDb, calculateDb(output, kStartIndex), kToleranceDb);
+ EXPECT_NEAR(mInputDb, calculateDb(output, kStartIndex), kLimiterTestToleranceDb);
}
}
}
@@ -1025,13 +1073,9 @@
const EqBandConfigTestParams& params) {
const std::vector<std::pair<int, float>> cutOffFreqs = std::get<EQ_BAND_CUT_OFF_FREQ>(params);
int bandCount = cutOffFreqs.size();
- cfgs.resize(bandCount);
for (int i = 0; i < bandCount; i++) {
- cfgs[i].channel = std::get<EQ_BAND_CHANNEL>(params);
- cfgs[i].band = cutOffFreqs[i].first;
- cfgs[i].enable = true /*Eqband Enable*/;
- cfgs[i].cutoffFrequencyHz = cutOffFreqs[i].second;
- cfgs[i].gainDb = std::get<EQ_BAND_GAIN>(params);
+ cfgs.push_back(creatEqBandConfig(std::get<EQ_BAND_CHANNEL>(params), cutOffFreqs[i].first,
+ cutOffFreqs[i].second, std::get<EQ_BAND_GAIN>(params)));
}
}
@@ -1147,6 +1191,119 @@
});
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DynamicsProcessingTestEqBandConfig);
+class DynamicsProcessingEqBandConfigDataTest
+ : public ::testing::TestWithParam<std::pair<std::shared_ptr<IFactory>, Descriptor>>,
+ public DynamicsProcessingTestHelper {
+ public:
+ DynamicsProcessingEqBandConfigDataTest()
+ : DynamicsProcessingTestHelper(GetParam(), AudioChannelLayout::LAYOUT_MONO) {
+ mInput.resize(kFrameCount * mChannelCount);
+ mBinOffsets.resize(mMultitoneTestFrequencies.size());
+ }
+
+ void SetUp() override {
+ ASSERT_NO_FATAL_FAILURE(
+ setUpDataTest(mMultitoneTestFrequencies, kSineMultitoneFullScaleDb));
+ }
+
+ void TearDown() override { TearDownDynamicsProcessingEffect(); }
+
+ void addEqParam(bool isPreEq) {
+ createChannelConfig();
+ auto stage = isPreEq ? mEngineConfigPreset.preEqStage : mEngineConfigPreset.postEqStage;
+ stage.bandCount = mCfgs.size();
+ addEngineConfig(mEngineConfigPreset);
+ isPreEq ? addPreEqChannelConfig(mChannelConfig) : addPostEqChannelConfig(mChannelConfig);
+ isPreEq ? addPreEqBandConfigs(mCfgs) : addPostEqBandConfigs(mCfgs);
+ }
+
+ void setEqParamAndProcess(std::vector<float>& output, bool isPreEq) {
+ addEqParam(isPreEq);
+ ASSERT_NO_FATAL_FAILURE(setParamsAndProcess(mInput, output));
+ }
+
+ void fillEqBandConfig(std::vector<DynamicsProcessing::EqBandConfig>& cfgs, int channelIndex,
+ int bandIndex, int cutOffFreqHz, float gainDb) {
+ cfgs.push_back(creatEqBandConfig(channelIndex, bandIndex, static_cast<float>(cutOffFreqHz),
+ gainDb));
+ }
+
+ void validateOutput(const std::vector<float>& output, float gainDb, size_t bandIndex) {
+ std::vector<float> outputMag(mBinOffsets.size());
+ EXPECT_NO_FATAL_FAILURE(getMagnitudeValue(output, outputMag));
+ if (gainDb == 0) {
+ EXPECT_NO_FATAL_FAILURE(checkInputAndOutputEquality(outputMag));
+ } else if (gainDb > 0) {
+ // For positive gain, current band's magnitude is greater than the other band's
+ // magnitude
+ EXPECT_GT(outputMag[bandIndex], outputMag[bandIndex ^ 1]);
+ } else {
+ // For negative gain, current band's magnitude is less than the other band's magnitude
+ EXPECT_LT(outputMag[bandIndex], outputMag[bandIndex ^ 1]);
+ }
+ }
+
+ void analyseMultiBandOutput(float gainDb, bool isPreEq) {
+ std::vector<float> output(mInput.size());
+ roundToFreqCenteredToFftBin(mMultitoneTestFrequencies, mBinOffsets, kBinWidth);
+ // Set Equalizer values for two bands
+ for (size_t i = 0; i < kCutoffFreqHz.size(); i++) {
+ for (int channelIndex = 0; channelIndex < mChannelCount; channelIndex++) {
+ fillEqBandConfig(mCfgs, channelIndex, i, kCutoffFreqHz[i], gainDb);
+ fillEqBandConfig(mCfgs, channelIndex, i ^ 1, kCutoffFreqHz[i ^ 1], 0);
+ }
+ ASSERT_NO_FATAL_FAILURE(setEqParamAndProcess(output, isPreEq));
+
+ if (isAllParamsValid()) {
+ ASSERT_NO_FATAL_FAILURE(validateOutput(output, gainDb, i));
+ }
+ cleanUpEqConfig();
+ }
+ }
+
+ void cleanUpEqConfig() {
+ CleanUp();
+ mCfgs.clear();
+ mChannelConfig.clear();
+ }
+
+ const std::vector<float> kTestGainDbValues = {-200, -100, 0, 100, 200};
+ std::vector<DynamicsProcessing::EqBandConfig> mCfgs;
+};
+
+TEST_P(DynamicsProcessingEqBandConfigDataTest, IncreasingPreEqGain) {
+ for (float gainDb : kTestGainDbValues) {
+ ASSERT_NO_FATAL_FAILURE(generateSineWave(mMultitoneTestFrequencies, mInput,
+ dBToAmplitude(gainDb), kSamplingFrequency,
+ mChannelLayout));
+ cleanUpEqConfig();
+ ASSERT_NO_FATAL_FAILURE(analyseMultiBandOutput(gainDb, true /*pre-equalizer*/));
+ }
+}
+
+TEST_P(DynamicsProcessingEqBandConfigDataTest, IncreasingPostEqGain) {
+ for (float gainDb : kTestGainDbValues) {
+ ASSERT_NO_FATAL_FAILURE(generateSineWave(mMultitoneTestFrequencies, mInput,
+ dBToAmplitude(gainDb), kSamplingFrequency,
+ mChannelLayout));
+ cleanUpEqConfig();
+ ASSERT_NO_FATAL_FAILURE(analyseMultiBandOutput(gainDb, false /*post-equalizer*/));
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(DynamicsProcessingTest, DynamicsProcessingEqBandConfigDataTest,
+ testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
+ [](const auto& info) {
+ auto descriptor = info.param;
+ std::string name = getPrefix(descriptor.second);
+ std::replace_if(
+ name.begin(), name.end(),
+ [](const char c) { return !std::isalnum(c); }, '_');
+ return name;
+ });
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DynamicsProcessingEqBandConfigDataTest);
+
/**
* Test DynamicsProcessing MbcBandConfig
*/
@@ -1259,24 +1416,18 @@
DynamicsProcessingMbcBandConfigDataTest()
: DynamicsProcessingTestHelper(GetParam(), AudioChannelLayout::LAYOUT_MONO) {
mInput.resize(kFrameCount * mChannelCount);
- mBinOffsets.resize(mTestFrequencies.size());
+ mBinOffsets.resize(mMultitoneTestFrequencies.size());
}
void SetUp() override {
- SetUpDynamicsProcessingEffect();
- SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
- ASSERT_NO_FATAL_FAILURE(generateSineWave(mTestFrequencies, mInput, 1.0, kSamplingFrequency,
- mChannelLayout));
- mInputDb = calculateDb(mInput);
- ASSERT_NEAR(mInputDb, kFullScaleDb, kToleranceDb);
+ ASSERT_NO_FATAL_FAILURE(
+ setUpDataTest(mMultitoneTestFrequencies, kSineMultitoneFullScaleDb));
}
void TearDown() override { TearDownDynamicsProcessingEffect(); }
void setMbcParamsAndProcess(std::vector<float>& output) {
- for (int i = 0; i < mChannelCount; i++) {
- mChannelConfig.push_back(DynamicsProcessing::ChannelConfig(i, true));
- }
+ createChannelConfig();
mEngineConfigPreset.mbcStage.bandCount = mCfgs.size();
addEngineConfig(mEngineConfigPreset);
addMbcChannelConfig(mChannelConfig);
@@ -1293,23 +1444,12 @@
noiseGate, expanderRatio, preGain, postGain));
}
- void getMagnitudeValue(const std::vector<float>& output, std::vector<float>& bufferMag) {
- std::vector<float> subOutput(output.begin() + kStartIndex, output.end());
- EXPECT_NO_FATAL_FAILURE(
- calculateMagnitudeMono(bufferMag, subOutput, mBinOffsets, kNPointFFT));
- }
-
void validateOutput(const std::vector<float>& output, float threshold, float ratio,
size_t bandIndex) {
std::vector<float> outputMag(mBinOffsets.size());
EXPECT_NO_FATAL_FAILURE(getMagnitudeValue(output, outputMag));
if (threshold >= mInputDb || ratio == 1) {
- std::vector<float> inputMag(mBinOffsets.size());
- EXPECT_NO_FATAL_FAILURE(getMagnitudeValue(mInput, inputMag));
- for (size_t i = 0; i < inputMag.size(); i++) {
- EXPECT_NEAR(calculateDb({inputMag[i] / mNormalizingFactor}),
- calculateDb({outputMag[i] / mNormalizingFactor}), kToleranceDb);
- }
+ EXPECT_NO_FATAL_FAILURE(checkInputAndOutputEquality(outputMag));
} else {
// Current band's magnitude is less than the other band's magnitude
EXPECT_LT(outputMag[bandIndex], outputMag[bandIndex ^ 1]);
@@ -1318,17 +1458,16 @@
void analyseMultiBandOutput(float threshold, float ratio) {
std::vector<float> output(mInput.size());
- roundToFreqCenteredToFftBin(mTestFrequencies, mBinOffsets, kBinWidth);
- std::vector<int> cutoffFreqHz = {200 /*0th band cutoff*/, 2000 /*1st band cutoff*/};
+ roundToFreqCenteredToFftBin(mMultitoneTestFrequencies, mBinOffsets, kBinWidth);
// Set MBC values for two bands
- for (size_t i = 0; i < cutoffFreqHz.size(); i++) {
+ for (size_t i = 0; i < kCutoffFreqHz.size(); i++) {
for (int channelIndex = 0; channelIndex < mChannelCount; channelIndex++) {
fillMbcBandConfig(mCfgs, channelIndex, threshold, ratio, kDefaultNoiseGateDb,
- kDefaultExpanderRatio, i, cutoffFreqHz[i], kDefaultPreGainDb,
+ kDefaultExpanderRatio, i, kCutoffFreqHz[i], kDefaultPreGainDb,
kDefaultPostGainDb);
fillMbcBandConfig(mCfgs, channelIndex, kDefaultThresholdDb, kDefaultRatio,
kDefaultNoiseGateDb, kDefaultExpanderRatio, i ^ 1,
- cutoffFreqHz[i ^ 1], kDefaultPreGainDb, kDefaultPostGainDb);
+ kCutoffFreqHz[i ^ 1], kDefaultPreGainDb, kDefaultPostGainDb);
}
ASSERT_NO_FATAL_FAILURE(setMbcParamsAndProcess(output));
@@ -1345,8 +1484,6 @@
mChannelConfig.clear();
}
- static constexpr int kNPointFFT = 1024;
- static constexpr float kToleranceDb = 0.5;
static constexpr float kDefaultPostGainDb = 0;
static constexpr float kDefaultPreGainDb = 0;
static constexpr float kDefaultAttackTime = 0;
@@ -1356,20 +1493,7 @@
static constexpr float kDefaultNoiseGateDb = -10;
static constexpr float kDefaultExpanderRatio = 1;
static constexpr float kDefaultRatio = 1;
- static constexpr float kBinWidth = (float)kSamplingFrequency / kNPointFFT;
- // Full scale sine wave with 100 Hz and 1000 Hz frequency is -6 dB
- static constexpr float kFullScaleDb = -6;
- std::vector<int> mTestFrequencies = {100, 1000};
- // Calculating normalizing factor by dividing the number of FFT points by half and the number of
- // test frequencies. The normalization accounts for the FFT splitting the signal into positive
- // and negative frequencies. Additionally, during multi-tone input generation, sample values are
- // normalized to the range [-1, 1] by dividing them by the number of test frequencies.
- float mNormalizingFactor = (kNPointFFT / (2 * mTestFrequencies.size()));
std::vector<DynamicsProcessing::MbcBandConfig> mCfgs;
- std::vector<DynamicsProcessing::ChannelConfig> mChannelConfig;
- std::vector<int> mBinOffsets;
- std::vector<float> mInput;
- float mInputDb;
};
TEST_P(DynamicsProcessingMbcBandConfigDataTest, IncreasingThreshold) {
@@ -1396,11 +1520,11 @@
std::vector<float> postGainDbValues = {-55, -30, 0, 30, 55};
std::vector<float> output(mInput.size());
for (float postGainDb : postGainDbValues) {
- ASSERT_NO_FATAL_FAILURE(generateSineWave(mTestFrequencies, mInput,
+ ASSERT_NO_FATAL_FAILURE(generateSineWave(mMultitoneTestFrequencies, mInput,
dBToAmplitude(postGainDb), kSamplingFrequency,
mChannelLayout));
mInputDb = calculateDb(mInput);
- EXPECT_NEAR(mInputDb, kFullScaleDb - postGainDb, kToleranceDb);
+ EXPECT_NEAR(mInputDb, kSineMultitoneFullScaleDb - postGainDb, kToleranceDb);
cleanUpMbcConfig();
for (int i = 0; i < mChannelCount; i++) {
fillMbcBandConfig(mCfgs, i, kDefaultThresholdDb, kDefaultRatio, kDefaultNoiseGateDb,
diff --git a/automotive/can/OWNERS b/automotive/can/OWNERS
index ffa4828..b738dac 100644
--- a/automotive/can/OWNERS
+++ b/automotive/can/OWNERS
@@ -1,3 +1,2 @@
-kevinme@google.com
chrisweir@google.com
twasilczyk@google.com
diff --git a/automotive/vehicle/OWNERS b/automotive/vehicle/OWNERS
index 22049de..066af9a 100644
--- a/automotive/vehicle/OWNERS
+++ b/automotive/vehicle/OWNERS
@@ -1,8 +1,6 @@
ericjeong@google.com
shanyu@google.com
-# GRPC VHAL
-
# Property definition
per-file aidl_property/** = tylertrephan@google.com
per-file aidl/generated_lib/** = tylertrephan@google.com
diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING
index de59fdc..cdc6e56 100644
--- a/automotive/vehicle/TEST_MAPPING
+++ b/automotive/vehicle/TEST_MAPPING
@@ -48,6 +48,9 @@
"name": "GRPCVehicleHardwareUnitTest"
},
{
+ "name": "GRPCVehicleProxyServerUnitTest"
+ },
+ {
"name": "CarServiceHalUnitTest"
},
{
diff --git a/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/include/ConfigDeclaration.h b/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/include/ConfigDeclaration.h
index 40ac129..c4b794a 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/include/ConfigDeclaration.h
+++ b/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/include/ConfigDeclaration.h
@@ -39,6 +39,9 @@
std::unordered_map<int32_t, aidl::android::hardware::automotive::vehicle::RawPropValues>
initialAreaValues;
+ // The optional supported values for each areaId.
+ std::unordered_map<int32_t, std::vector<float>> supportedValuesForAreaId;
+
inline bool operator==(const ConfigDeclaration& other) const {
return (config == other.config && initialValue == other.initialValue &&
initialAreaValues == other.initialAreaValues);
diff --git a/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/include/JsonConfigLoader.h b/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/include/JsonConfigLoader.h
index 00c497f..9901db2 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/include/JsonConfigLoader.h
+++ b/automotive/vehicle/aidl/impl/current/default_config/JsonConfigLoader/include/JsonConfigLoader.h
@@ -108,11 +108,23 @@
// @param fieldIsOptional Whether the field is optional.
// @param outPtr The pointer to output to if the field exists and parsing succeeded.
// @param errors The error array to append error to if errors are found.
- // @return true if the field is optional and does not exist or parsed successfully.
+ // @param found if not nullptr, this will be set to true if the field is found.
+ // @return true if parsed successfully or the field is optional and is not found.
template <class T>
bool tryParseJsonValueToVariable(const Json::Value& parentJsonNode,
const std::string& fieldName, bool fieldIsOptional, T* outPtr,
+ std::vector<std::string>* errors, bool* found = nullptr);
+
+ // Tries to parse a JSON value to a specific type.
+ //
+ // This is similar to the previous version except that it tries to find the field in multiple
+ // parent nodes and will return early if the field is found in one parent node. This is useful
+ // when we allow the field to either come from vehicleArea fields or vehicleProperty fields.
+ template <class T>
+ bool tryParseJsonValueToVariable(std::vector<const Json::Value*> parentJsonNodePtrs,
+ const std::string& fieldName, bool fieldIsOptional, T* outPtr,
std::vector<std::string>* errors);
+
// Tries to parse a JSON value to an array of specific type.
//
// If fieldIsOptional is True, then if the field specified by "fieldName" does not exist,
@@ -127,7 +139,19 @@
template <class T>
bool tryParseJsonArrayToVariable(const Json::Value& parentJsonNode,
const std::string& fieldName, bool fieldIsOptional,
+ std::vector<T>* outPtr, std::vector<std::string>* errors,
+ bool* found = nullptr);
+
+ // Tries to parse a JSON value to an array of specific type.
+ //
+ // This is similar to the previous version except that it tries to find the field in multiple
+ // parent nodes and will return early if the field is found in one parent node. This is useful
+ // when we allow the field to either come from vehicleArea fields or vehicleProperty fields.
+ template <class T>
+ bool tryParseJsonArrayToVariable(std::vector<const Json::Value*> parentJsonNodePtrs,
+ const std::string& fieldName, bool fieldIsOptional,
std::vector<T>* outPtr, std::vector<std::string>* errors);
+
// Parses a JSON field to VehiclePropertyAccess or VehiclePropertyChangeMode.
template <class T>
void parseAccessChangeMode(const Json::Value& parentJsonNode, const std::string& fieldName,
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 5b945b2..fdccaec 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
@@ -95,6 +95,12 @@
using ::android::base::Error;
using ::android::base::Result;
+int32_t COMPATIBLE_API_VERSIONS[] = {
+ // The base version.
+ 1,
+ // V2 supports inherit areaId fields from parent property fields.
+ 2};
+
// Defines a map from constant names to constant values, the values defined here corresponds to
// the "Constants::XXXX" used in JSON config file.
const std::unordered_map<std::string, int> CONSTANTS_BY_NAME = {
@@ -148,6 +154,17 @@
toInt(VehicleAreaMirror::DRIVER_LEFT) | toInt(VehicleAreaMirror::DRIVER_RIGHT)},
};
+std::string nodesToStr(const std::vector<const Json::Value*>& nodePtrs) {
+ std::string nodesStr = "";
+ for (const Json::Value* nodePtr : nodePtrs) {
+ if (nodesStr != "") {
+ nodesStr += ", ";
+ }
+ nodesStr += nodePtr->toStyledString();
+ }
+ return nodesStr;
+}
+
// A class to parse constant values for type T where T is defined as an enum in NDK AIDL backend.
template <class T>
class ConstantParser final : public ConstantParserInterface {
@@ -447,10 +464,33 @@
}
template <class T>
+bool JsonConfigParser::tryParseJsonValueToVariable(
+ std::vector<const Json::Value*> parentJsonNodePtrs, const std::string& fieldName,
+ bool fieldIsOptional, T* outPtr, std::vector<std::string>* errors) {
+ bool found = false;
+ for (const Json::Value* parentJsonNodePtr : parentJsonNodePtrs) {
+ bool result = tryParseJsonValueToVariable(*parentJsonNodePtr, fieldName,
+ /*fieldIsOptional=*/true, outPtr, errors, &found);
+ if (!result) {
+ return result;
+ }
+ if (found) {
+ return true;
+ }
+ }
+ if (!fieldIsOptional && !found) {
+ errors->push_back("Missing required field: " + fieldName +
+ " in nodes: " + nodesToStr(parentJsonNodePtrs));
+ return false;
+ }
+ return true;
+}
+
+template <class T>
bool JsonConfigParser::tryParseJsonValueToVariable(const Json::Value& parentJsonNode,
const std::string& fieldName,
bool fieldIsOptional, T* outPtr,
- std::vector<std::string>* errors) {
+ std::vector<std::string>* errors, bool* found) {
if (!parentJsonNode.isObject()) {
errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object");
return false;
@@ -469,6 +509,32 @@
return false;
}
*outPtr = std::move(result.value());
+ if (found != nullptr) {
+ *found = true;
+ }
+ return true;
+}
+
+template <class T>
+bool JsonConfigParser::tryParseJsonArrayToVariable(
+ std::vector<const Json::Value*> parentJsonNodePtrs, const std::string& fieldName,
+ bool fieldIsOptional, std::vector<T>* outPtr, std::vector<std::string>* errors) {
+ bool found = false;
+ for (const Json::Value* parentJsonNodePtr : parentJsonNodePtrs) {
+ bool result = tryParseJsonArrayToVariable(*parentJsonNodePtr, fieldName,
+ /*fieldIsOptional=*/true, outPtr, errors, &found);
+ if (!result) {
+ return result;
+ }
+ if (found) {
+ return true;
+ }
+ }
+ if (!fieldIsOptional && !found) {
+ errors->push_back("Missing required field: " + fieldName +
+ " in nodes: " + nodesToStr(parentJsonNodePtrs));
+ return false;
+ }
return true;
}
@@ -476,7 +542,7 @@
bool JsonConfigParser::tryParseJsonArrayToVariable(const Json::Value& parentJsonNode,
const std::string& fieldName,
bool fieldIsOptional, std::vector<T>* outPtr,
- std::vector<std::string>* errors) {
+ std::vector<std::string>* errors, bool* found) {
if (!parentJsonNode.isObject()) {
errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object");
return false;
@@ -495,6 +561,9 @@
return false;
}
*outPtr = std::move(result.value());
+ if (found != nullptr) {
+ *found = true;
+ }
return true;
}
@@ -574,44 +643,60 @@
}
VehicleAreaConfig areaConfig = {};
areaConfig.areaId = areaId;
+ // We have already parsed the access in parentJsonNode into config, so we do not have to
+ // parse parentNode again here.
parseAccessChangeMode(jsonAreaConfig, "access", propStr, &(config->config.access),
&areaConfig.access, errors);
- tryParseJsonValueToVariable(jsonAreaConfig, "minInt32Value", /*optional=*/true,
- &areaConfig.minInt32Value, errors);
- tryParseJsonValueToVariable(jsonAreaConfig, "maxInt32Value", /*optional=*/true,
- &areaConfig.maxInt32Value, errors);
- tryParseJsonValueToVariable(jsonAreaConfig, "minInt64Value", /*optional=*/true,
- &areaConfig.minInt64Value, errors);
- tryParseJsonValueToVariable(jsonAreaConfig, "maxInt64Value", /*optional=*/true,
- &areaConfig.maxInt64Value, errors);
- tryParseJsonValueToVariable(jsonAreaConfig, "minFloatValue", /*optional=*/true,
- &areaConfig.minFloatValue, errors);
- tryParseJsonValueToVariable(jsonAreaConfig, "maxFloatValue", /*optional=*/true,
- &areaConfig.maxFloatValue, errors);
+ // All the following fields may come from area config or from parent node (property config).
+ tryParseJsonValueToVariable({&jsonAreaConfig, &parentJsonNode}, "minInt32Value",
+ /*optional=*/true, &areaConfig.minInt32Value, errors);
+ tryParseJsonValueToVariable({&jsonAreaConfig, &parentJsonNode}, "maxInt32Value",
+ /*optional=*/true, &areaConfig.maxInt32Value, errors);
+ tryParseJsonValueToVariable({&jsonAreaConfig, &parentJsonNode}, "minInt64Value",
+ /*optional=*/true, &areaConfig.minInt64Value, errors);
+ tryParseJsonValueToVariable({&jsonAreaConfig, &parentJsonNode}, "maxInt64Value",
+ /*optional=*/true, &areaConfig.maxInt64Value, errors);
+ tryParseJsonValueToVariable({&jsonAreaConfig, &parentJsonNode}, "minFloatValue",
+ /*optional=*/true, &areaConfig.minFloatValue, errors);
+ tryParseJsonValueToVariable({&jsonAreaConfig, &parentJsonNode}, "maxFloatValue",
+ /*optional=*/true, &areaConfig.maxFloatValue, errors);
// By default we support variable update rate for all properties except it is explicitly
// disabled.
areaConfig.supportVariableUpdateRate = true;
- tryParseJsonValueToVariable(jsonAreaConfig, "supportVariableUpdateRate", /*optional=*/true,
- &areaConfig.supportVariableUpdateRate, errors);
+ tryParseJsonValueToVariable({&jsonAreaConfig, &parentJsonNode}, "supportVariableUpdateRate",
+ /*optional=*/true, &areaConfig.supportVariableUpdateRate,
+ errors);
std::vector<int64_t> supportedEnumValues;
- tryParseJsonArrayToVariable(jsonAreaConfig, "supportedEnumValues", /*optional=*/true,
- &supportedEnumValues, errors);
+ tryParseJsonArrayToVariable({&jsonAreaConfig, &parentJsonNode}, "supportedEnumValues",
+ /*optional=*/true, &supportedEnumValues, errors);
if (!supportedEnumValues.empty()) {
areaConfig.supportedEnumValues = std::move(supportedEnumValues);
}
+ std::vector<float> supportedValues;
+ tryParseJsonArrayToVariable({&jsonAreaConfig, &parentJsonNode}, "supportedValues",
+ /*optional=*/true, &supportedValues, errors);
+ if (!supportedValues.empty()) {
+ config->supportedValuesForAreaId[areaId] = std::move(supportedValues);
+ }
+
+ const Json::Value* jsonHasSupportedValueInfo = nullptr;
if (jsonAreaConfig.isMember("hasSupportedValueInfo")) {
+ jsonHasSupportedValueInfo = &jsonAreaConfig["hasSupportedValueInfo"];
+ } else if (parentJsonNode.isMember("hasSupportedValueInfo")) {
+ jsonHasSupportedValueInfo = &parentJsonNode["hasSupportedValueInfo"];
+ }
+ if (jsonHasSupportedValueInfo != nullptr) {
HasSupportedValueInfo hasSupportedValueInfo = HasSupportedValueInfo{};
- const Json::Value& jsonHasSupportedValueInfo = jsonAreaConfig["hasSupportedValueInfo"];
- tryParseJsonValueToVariable(jsonHasSupportedValueInfo, "hasMinSupportedValue",
+ tryParseJsonValueToVariable(*jsonHasSupportedValueInfo, "hasMinSupportedValue",
/*optional=*/true,
&hasSupportedValueInfo.hasMinSupportedValue, errors);
- tryParseJsonValueToVariable(jsonHasSupportedValueInfo, "hasMaxSupportedValue",
+ tryParseJsonValueToVariable(*jsonHasSupportedValueInfo, "hasMaxSupportedValue",
/*optional=*/true,
&hasSupportedValueInfo.hasMaxSupportedValue, errors);
- tryParseJsonValueToVariable(jsonHasSupportedValueInfo, "hasSupportedValuesList",
+ tryParseJsonValueToVariable(*jsonHasSupportedValueInfo, "hasSupportedValuesList",
/*optional=*/true,
&hasSupportedValueInfo.hasSupportedValuesList, errors);
areaConfig.hasSupportedValueInfo = std::move(hasSupportedValueInfo);
@@ -622,6 +707,11 @@
RawPropValues areaValue = {};
if (parsePropValues(jsonAreaConfig, "defaultValue", &areaValue, errors)) {
config->initialAreaValues[areaId] = std::move(areaValue);
+ } else {
+ if (config->initialValue != RawPropValues{}) {
+ // Skip empty initial values.
+ config->initialAreaValues[areaId] = config->initialValue;
+ }
}
}
}
@@ -701,6 +791,21 @@
if (!root.isObject()) {
return Error() << "root element must be an object";
}
+ // Default API version is 1.
+ int32_t apiVersion = 1;
+ if (root.isMember("apiVersion")) {
+ apiVersion = static_cast<int32_t>(root["apiVersion"].asInt());
+ }
+ bool compatible = false;
+ for (int32_t compatibleApiVersion : COMPATIBLE_API_VERSIONS) {
+ if (compatibleApiVersion == apiVersion) {
+ compatible = true;
+ break;
+ }
+ }
+ if (!compatible) {
+ return Error() << "The JSON file is not compatible with the JSON loader version";
+ }
if (!root.isMember("properties") || !root["properties"].isArray()) {
return Error() << "Missing 'properties' field in root or the field is not an array";
}
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 595c2ed..3b4720b 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
@@ -314,6 +314,33 @@
ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::STATIC);
}
+TEST_F(JsonConfigLoaderUnitTest, testAccessAreaOverride) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::INFO_FUEL_CAPACITY",
+ "areas": [
+ {
+ "areaId": 0,
+ "access": "VehiclePropertyAccess::WRITE"
+ }
+ ]
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+
+ ASSERT_TRUE(result.ok()) << result.error().message();
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const VehiclePropConfig& propConfig = configs.begin()->second.config;
+ ASSERT_EQ(propConfig.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(propConfig.areaConfigs[0].access, VehiclePropertyAccess::WRITE);
+ ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::STATIC);
+}
+
TEST_F(JsonConfigLoaderUnitTest, testChangeModeOverride) {
std::istringstream iss(R"(
{
@@ -564,6 +591,148 @@
ASSERT_EQ(areaConfig.areaId, HVAC_ALL);
}
+TEST_F(JsonConfigLoaderUnitTest, testAreas_InheritFromProperty) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::INFO_FUEL_CAPACITY",
+ "minInt32Value": 1,
+ "maxInt32Value": 7,
+ "minInt64Value": 2,
+ "maxInt64Value": 6,
+ "minFloatValue": 1.1,
+ "maxFloatValue": 2.2,
+ "supportVariableUpdateRate": true,
+ "supportedEnumValues": [1, 2, 3],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true,
+ "hasSupportedValuesList": true
+ },
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ },
+ "areas": [{
+ "areaId": "Constants::HVAC_ALL"
+ }]
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+
+ ASSERT_RESULT_OK(result);
+
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const auto& configDecl = configs.begin()->second;
+ const VehiclePropConfig& config = configDecl.config;
+ EXPECT_EQ(config.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(config.areaConfigs.size(), 1u);
+ const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ EXPECT_EQ(areaConfig.minInt32Value, 1);
+ EXPECT_EQ(areaConfig.maxInt32Value, 7);
+ EXPECT_EQ(areaConfig.minInt64Value, 2);
+ EXPECT_EQ(areaConfig.maxInt64Value, 6);
+ EXPECT_EQ(areaConfig.minFloatValue, 1.1f);
+ EXPECT_EQ(areaConfig.maxFloatValue, 2.2f);
+ EXPECT_EQ(areaConfig.access, VehiclePropertyAccess::READ);
+ EXPECT_EQ(areaConfig.areaId, HVAC_ALL);
+ EXPECT_EQ(areaConfig.supportVariableUpdateRate, true);
+ ASSERT_TRUE(areaConfig.supportedEnumValues.has_value());
+ EXPECT_EQ(areaConfig.supportedEnumValues.value(), std::vector<int64_t>({1, 2, 3}));
+ ASSERT_TRUE(areaConfig.hasSupportedValueInfo.has_value());
+ EXPECT_TRUE(areaConfig.hasSupportedValueInfo->hasMinSupportedValue);
+ EXPECT_TRUE(areaConfig.hasSupportedValueInfo->hasMaxSupportedValue);
+ EXPECT_TRUE(areaConfig.hasSupportedValueInfo->hasSupportedValuesList);
+ ASSERT_FALSE(configDecl.initialAreaValues.find(HVAC_ALL) == configDecl.initialAreaValues.end());
+ EXPECT_EQ(configDecl.initialAreaValues.find(HVAC_ALL)->second,
+ RawPropValues{.int32Values = {1}});
+}
+
+TEST_F(JsonConfigLoaderUnitTest, testAreas_InheritFromProperty_override) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::INFO_FUEL_CAPACITY",
+ "minInt32Value": 100,
+ "maxInt32Value": 100,
+ "minInt64Value": 100,
+ "maxInt64Value": 100,
+ "minFloatValue": 100.1,
+ "maxFloatValue": 100.2,
+ "supportVariableUpdateRate": false,
+ "supportedEnumValues": [3, 2, 1],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": false,
+ "hasMaxSupportedValue": false,
+ "hasSupportedValuesList": false
+ },
+ "defaultValue": {
+ "int32Values": [
+ 2
+ ]
+ },
+ "areas": [{
+ "areaId": "Constants::HVAC_ALL",
+ "minInt32Value": 1,
+ "maxInt32Value": 7,
+ "minInt64Value": 2,
+ "maxInt64Value": 6,
+ "minFloatValue": 1.1,
+ "maxFloatValue": 2.2,
+ "supportVariableUpdateRate": true,
+ "supportedEnumValues": [1, 2, 3],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true,
+ "hasSupportedValuesList": true
+ },
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ }]
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+
+ ASSERT_RESULT_OK(result);
+
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const auto& configDecl = configs.begin()->second;
+ const VehiclePropConfig& config = configDecl.config;
+ EXPECT_EQ(config.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(config.areaConfigs.size(), 1u);
+ const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ EXPECT_EQ(areaConfig.minInt32Value, 1);
+ EXPECT_EQ(areaConfig.maxInt32Value, 7);
+ EXPECT_EQ(areaConfig.minInt64Value, 2);
+ EXPECT_EQ(areaConfig.maxInt64Value, 6);
+ EXPECT_EQ(areaConfig.minFloatValue, 1.1f);
+ EXPECT_EQ(areaConfig.maxFloatValue, 2.2f);
+ EXPECT_EQ(areaConfig.access, VehiclePropertyAccess::READ);
+ EXPECT_EQ(areaConfig.areaId, HVAC_ALL);
+ EXPECT_EQ(areaConfig.supportVariableUpdateRate, true);
+ ASSERT_TRUE(areaConfig.supportedEnumValues.has_value());
+ EXPECT_EQ(areaConfig.supportedEnumValues.value(), std::vector<int64_t>({1, 2, 3}));
+ ASSERT_TRUE(areaConfig.hasSupportedValueInfo.has_value());
+ EXPECT_TRUE(areaConfig.hasSupportedValueInfo->hasMinSupportedValue);
+ EXPECT_TRUE(areaConfig.hasSupportedValueInfo->hasMaxSupportedValue);
+ EXPECT_TRUE(areaConfig.hasSupportedValueInfo->hasSupportedValuesList);
+ ASSERT_FALSE(configDecl.initialAreaValues.find(HVAC_ALL) == configDecl.initialAreaValues.end());
+ EXPECT_EQ(configDecl.initialAreaValues.find(HVAC_ALL)->second,
+ RawPropValues{.int32Values = {1}});
+}
+
TEST_F(JsonConfigLoaderUnitTest, testAreas_DefaultValueForEachArea) {
std::istringstream iss(R"(
{
diff --git a/automotive/vehicle/aidl/impl/current/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/current/default_config/config/DefaultProperties.json
index 90c53bd..c3e12f6 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/config/DefaultProperties.json
+++ b/automotive/vehicle/aidl/impl/current/default_config/config/DefaultProperties.json
@@ -1,5 +1,5 @@
{
- "apiVersion": 1,
+ "apiVersion": 2,
"properties": [
{
"property": "VehicleProperty::INFO_FUEL_CAPACITY",
@@ -164,51 +164,47 @@
"property": "VehicleProperty::SEAT_MEMORY_SELECT",
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_2_RIGHT"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 3
},
{
"property": "VehicleProperty::SEAT_MEMORY_SET",
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_2_RIGHT"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 3
},
{
"property": "VehicleProperty::SEAT_BELT_BUCKLED",
@@ -244,31 +240,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_BELT_HEIGHT_MOVE",
@@ -279,31 +271,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_FORE_AFT_POS",
@@ -314,31 +302,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_FORE_AFT_MOVE",
@@ -349,31 +333,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_BACKREST_ANGLE_1_POS",
@@ -384,31 +364,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_BACKREST_ANGLE_1_MOVE",
@@ -419,31 +395,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_BACKREST_ANGLE_2_POS",
@@ -454,31 +426,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_BACKREST_ANGLE_2_MOVE",
@@ -489,31 +457,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_HEIGHT_POS",
@@ -524,31 +488,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_HEIGHT_MOVE",
@@ -559,31 +519,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_DEPTH_POS",
@@ -594,31 +550,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_DEPTH_MOVE",
@@ -629,31 +581,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_TILT_POS",
@@ -664,31 +612,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_TILT_MOVE",
@@ -699,31 +643,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_LUMBAR_FORE_AFT_POS",
@@ -734,31 +674,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_LUMBAR_FORE_AFT_MOVE",
@@ -769,31 +705,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_POS",
@@ -804,31 +736,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_MOVE",
@@ -839,31 +767,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_HEADREST_HEIGHT_POS_V2",
@@ -874,31 +798,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_HEADREST_HEIGHT_MOVE",
@@ -909,31 +829,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_HEADREST_ANGLE_POS",
@@ -944,31 +860,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_HEADREST_ANGLE_MOVE",
@@ -979,31 +891,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_HEADREST_FORE_AFT_POS",
@@ -1014,31 +922,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_HEADREST_FORE_AFT_MOVE",
@@ -1049,31 +953,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE",
@@ -1084,26 +984,21 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "supportedEnumValues": [
- "Constants::LIGHT_STATE_OFF",
- "Constants::LIGHT_STATE_ON"
- ]
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "supportedEnumValues": [
- "Constants::LIGHT_STATE_OFF",
- "Constants::LIGHT_STATE_ON"
- ]
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT_2_RIGHT_2_CENTER",
- "supportedEnumValues": [
- "Constants::LIGHT_STATE_OFF",
- "Constants::LIGHT_STATE_ON"
- ]
+ "areaId": "Constants::SEAT_2_LEFT_2_RIGHT_2_CENTER"
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "Constants::LIGHT_STATE_OFF",
+ "Constants::LIGHT_STATE_ON"
]
},
{
@@ -1115,29 +1010,22 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "supportedEnumValues": [
- "Constants::LIGHT_SWITCH_OFF",
- "Constants::LIGHT_SWITCH_ON",
- "Constants::LIGHT_SWITCH_AUTO"
- ]
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "supportedEnumValues": [
- "Constants::LIGHT_SWITCH_OFF",
- "Constants::LIGHT_SWITCH_ON",
- "Constants::LIGHT_SWITCH_AUTO"
- ]
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT_2_RIGHT_2_CENTER",
- "supportedEnumValues": [
- "Constants::LIGHT_SWITCH_OFF",
- "Constants::LIGHT_SWITCH_ON",
- "Constants::LIGHT_SWITCH_AUTO"
- ]
+ "areaId": "Constants::SEAT_2_LEFT_2_RIGHT_2_CENTER"
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "Constants::LIGHT_SWITCH_OFF",
+ "Constants::LIGHT_SWITCH_ON",
+ "Constants::LIGHT_SWITCH_AUTO"
]
},
{
@@ -1181,31 +1069,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE",
@@ -1216,31 +1100,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_LUMBAR_VERTICAL_POS",
@@ -1251,31 +1131,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -10,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -10,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE",
@@ -1286,31 +1162,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::SEAT_WALK_IN_POS",
@@ -1321,16 +1193,18 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 5
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 5
+ "areaId": "Constants::SEAT_1_RIGHT"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 5
},
{
"property": "VehicleProperty::SEAT_AIRBAGS_DEPLOYED",
@@ -1348,7 +1222,10 @@
"VehicleAirbagLocation::LEFT_SIDE",
"VehicleAirbagLocation::RIGHT_SIDE",
"VehicleAirbagLocation::CURTAIN"
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
@@ -1358,21 +1235,30 @@
"VehicleAirbagLocation::LEFT_SIDE",
"VehicleAirbagLocation::RIGHT_SIDE",
"VehicleAirbagLocation::CURTAIN"
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"supportedEnumValues": [
"VehicleAirbagLocation::FRONT",
"VehicleAirbagLocation::CURTAIN"
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"supportedEnumValues": [
"VehicleAirbagLocation::FRONT",
"VehicleAirbagLocation::CURTAIN"
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ }
}
]
},
@@ -1586,6 +1472,21 @@
60,
80,
100
+ ],
+ "areas": [
+ {
+ "areaId": 0
+ }
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedValues": [
+ 20,
+ 40,
+ 60,
+ 80,
+ 100
]
},
{
@@ -1672,29 +1573,27 @@
},
"areas": [
{
- "areaId": "Constants::WHEEL_FRONT_LEFT",
- "minFloatValue": 193.0,
- "maxFloatValue": 300.0
+ "areaId": "Constants::WHEEL_FRONT_LEFT"
},
{
- "areaId": "Constants::WHEEL_FRONT_RIGHT",
- "minFloatValue": 193.0,
- "maxFloatValue": 300.0
+ "areaId": "Constants::WHEEL_FRONT_RIGHT"
},
{
- "areaId": "Constants::WHEEL_REAR_LEFT",
- "minFloatValue": 193.0,
- "maxFloatValue": 300.0
+ "areaId": "Constants::WHEEL_REAR_LEFT"
},
{
- "areaId": "Constants::WHEEL_REAR_RIGHT",
- "minFloatValue": 193.0,
- "maxFloatValue": 300.0
+ "areaId": "Constants::WHEEL_REAR_RIGHT"
}
],
"comment": "Units in kpa",
"maxSampleRate": 2.0,
- "minSampleRate": 1.0
+ "minSampleRate": 1.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minFloatValue": 193.0,
+ "maxFloatValue": 300.0
},
{
"property": "VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE",
@@ -1807,9 +1706,7 @@
0
]
},
- "areaId": "Constants::WHEEL_FRONT_LEFT",
- "minInt32Value": -100,
- "maxInt32Value": 100
+ "areaId": "Constants::WHEEL_FRONT_LEFT"
},
{
"defaultValue": {
@@ -1817,9 +1714,7 @@
0
]
},
- "areaId": "Constants::WHEEL_FRONT_RIGHT",
- "minInt32Value": -100,
- "maxInt32Value": 100
+ "areaId": "Constants::WHEEL_FRONT_RIGHT"
},
{
"defaultValue": {
@@ -1827,9 +1722,7 @@
0
]
},
- "areaId": "Constants::WHEEL_REAR_RIGHT",
- "minInt32Value": -100,
- "maxInt32Value": 100
+ "areaId": "Constants::WHEEL_REAR_RIGHT"
},
{
"defaultValue": {
@@ -1837,13 +1730,17 @@
0
]
},
- "areaId": "Constants::WHEEL_REAR_LEFT",
- "minInt32Value": -100,
- "maxInt32Value": 100
+ "areaId": "Constants::WHEEL_REAR_LEFT"
}
],
"maxSampleRate": 10.0,
- "minSampleRate": 1.0
+ "minSampleRate": 1.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -100,
+ "maxInt32Value": 100
},
{
"property": "VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS",
@@ -1901,11 +1798,15 @@
},
"areas": [
{
- "areaId": 0,
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": 0
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 3
},
{
"property": "VehicleProperty::EV_STOPPING_MODE",
@@ -1916,13 +1817,16 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "Constants::EV_STOPPING_MODE_CREEP",
- "Constants::EV_STOPPING_MODE_ROLL",
- "Constants::EV_STOPPING_MODE_HOLD"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "Constants::EV_STOPPING_MODE_CREEP",
+ "Constants::EV_STOPPING_MODE_ROLL",
+ "Constants::EV_STOPPING_MODE_HOLD"
]
},
{
@@ -2324,31 +2228,27 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": 1,
- "maxInt32Value": 7
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": 1,
- "maxInt32Value": 7
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": 1,
- "maxInt32Value": 7
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": 1,
- "maxInt32Value": 7
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": 1,
- "maxInt32Value": 7
+ "areaId": "Constants::SEAT_2_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 1,
+ "maxInt32Value": 7
},
{
"property": "VehicleProperty::HVAC_FAN_DIRECTION",
@@ -2416,32 +2316,28 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": 0,
- "maxInt32Value": 3
+ "areaId": "Constants::SEAT_2_CENTER"
}
],
- "comment": "0 is off and +ve values indicate ventilation level."
+ "comment": "0 is off and +ve values indicate ventilation level.",
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 3
},
{
"property": "VehicleProperty::HVAC_STEERING_WHEEL_HEAT",
@@ -2452,12 +2348,16 @@
},
"areas": [
{
- "areaId": 0,
- "minInt32Value": -2,
- "maxInt32Value": 2
+ "areaId": 0
}
],
- "comment": "+ve values for heating and -ve for cooling"
+ "comment": "+ve values for heating and -ve for cooling",
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -2,
+ "maxInt32Value": 2
},
{
"property": "VehicleProperty::HVAC_SEAT_TEMPERATURE",
@@ -2468,32 +2368,28 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minInt32Value": -2,
- "maxInt32Value": 2
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": -2,
- "maxInt32Value": 2
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minInt32Value": -2,
- "maxInt32Value": 2
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minInt32Value": -2,
- "maxInt32Value": 2
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minInt32Value": -2,
- "maxInt32Value": 2
+ "areaId": "Constants::SEAT_2_CENTER"
}
],
- "comment": "+ve values for heating and -ve for cooling"
+ "comment": "+ve values for heating and -ve for cooling",
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -2,
+ "maxInt32Value": 2
},
{
"property": "VehicleProperty::HVAC_SIDE_MIRROR_HEAT",
@@ -2504,11 +2400,15 @@
},
"areas": [
{
- "areaId": "Constants::MIRROR_DRIVER_LEFT_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 2
+ "areaId": "Constants::MIRROR_DRIVER_LEFT_RIGHT"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 2
},
{
"property": "VehicleProperty::HVAC_TEMPERATURE_CURRENT",
@@ -2544,29 +2444,19 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_LEFT",
- "minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "areaId": "Constants::SEAT_1_LEFT"
},
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "areaId": "Constants::SEAT_1_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_LEFT",
- "minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "areaId": "Constants::SEAT_2_LEFT"
},
{
- "areaId": "Constants::SEAT_2_RIGHT",
- "minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "areaId": "Constants::SEAT_2_RIGHT"
},
{
- "areaId": "Constants::SEAT_2_CENTER",
- "minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "areaId": "Constants::SEAT_2_CENTER"
}
],
"comment":
@@ -2578,6 +2468,46 @@
600,
900,
10
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true,
+ "hasSupportedValuesList": true
+ },
+ "minFloatValue": 17.5,
+ "maxFloatValue": 32.5,
+ "supportedValues": [
+ 17.5,
+ 18,
+ 18.5,
+ 19,
+ 19.5,
+ 20,
+ 20.5,
+ 21,
+ 21.5,
+ 22,
+ 22.5,
+ 23,
+ 23.5,
+ 24,
+ 24.5,
+ 25,
+ 25.5,
+ 26,
+ 26.5,
+ 27,
+ 27.5,
+ 28,
+ 28.5,
+ 29,
+ 29.5,
+ 30,
+ 30.5,
+ 31,
+ 31.5,
+ 32,
+ 32.5
]
},
{
@@ -2718,16 +2648,19 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ImpactSensorLocation::FRONT",
- "ImpactSensorLocation::FRONT_LEFT_DOOR_SIDE",
- "ImpactSensorLocation::FRONT_RIGHT_DOOR_SIDE",
- "ImpactSensorLocation::REAR_LEFT_DOOR_SIDE",
- "ImpactSensorLocation::REAR_RIGHT_DOOR_SIDE",
- "ImpactSensorLocation::REAR"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ImpactSensorLocation::FRONT",
+ "ImpactSensorLocation::FRONT_LEFT_DOOR_SIDE",
+ "ImpactSensorLocation::FRONT_RIGHT_DOOR_SIDE",
+ "ImpactSensorLocation::REAR_LEFT_DOOR_SIDE",
+ "ImpactSensorLocation::REAR_RIGHT_DOOR_SIDE",
+ "ImpactSensorLocation::REAR"
]
},
{
@@ -2800,31 +2733,27 @@
},
"areas": [
{
- "areaId": "Constants::DOOR_1_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_1_LEFT"
},
{
- "areaId": "Constants::DOOR_1_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_1_RIGHT"
},
{
- "areaId": "Constants::DOOR_2_LEFT",
- "minInt32Value": 0,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_2_LEFT"
},
{
- "areaId": "Constants::DOOR_2_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_2_RIGHT"
},
{
- "areaId": "Constants::DOOR_REAR",
- "minInt32Value": 0,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_REAR"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::DOOR_MOVE",
@@ -2835,26 +2764,24 @@
},
"areas": [
{
- "areaId": "Constants::DOOR_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_1_LEFT"
},
{
- "areaId": "Constants::DOOR_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_1_RIGHT"
},
{
- "areaId": "Constants::DOOR_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_2_LEFT"
},
{
- "areaId": "Constants::DOOR_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::DOOR_2_RIGHT"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::MIRROR_Z_POS",
@@ -2865,21 +2792,21 @@
},
"areas": [
{
- "areaId": "VehicleAreaMirror::DRIVER_LEFT",
- "minInt32Value": -3,
- "maxInt32Value": 3
+ "areaId": "VehicleAreaMirror::DRIVER_LEFT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_RIGHT",
- "minInt32Value": -3,
- "maxInt32Value": 3
+ "areaId": "VehicleAreaMirror::DRIVER_RIGHT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_CENTER",
- "minInt32Value": -3,
- "maxInt32Value": 3
+ "areaId": "VehicleAreaMirror::DRIVER_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -3,
+ "maxInt32Value": 3
},
{
"property": "VehicleProperty::MIRROR_Z_MOVE",
@@ -2890,21 +2817,21 @@
},
"areas": [
{
- "areaId": "VehicleAreaMirror::DRIVER_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "VehicleAreaMirror::DRIVER_LEFT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "VehicleAreaMirror::DRIVER_RIGHT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "VehicleAreaMirror::DRIVER_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::MIRROR_Y_POS",
@@ -2915,21 +2842,21 @@
},
"areas": [
{
- "areaId": "VehicleAreaMirror::DRIVER_LEFT",
- "minInt32Value": -3,
- "maxInt32Value": 3
+ "areaId": "VehicleAreaMirror::DRIVER_LEFT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_RIGHT",
- "minInt32Value": -3,
- "maxInt32Value": 3
+ "areaId": "VehicleAreaMirror::DRIVER_RIGHT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_CENTER",
- "minInt32Value": -3,
- "maxInt32Value": 3
+ "areaId": "VehicleAreaMirror::DRIVER_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -3,
+ "maxInt32Value": 3
},
{
"property": "VehicleProperty::MIRROR_Y_MOVE",
@@ -2940,21 +2867,21 @@
},
"areas": [
{
- "areaId": "VehicleAreaMirror::DRIVER_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "VehicleAreaMirror::DRIVER_LEFT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "VehicleAreaMirror::DRIVER_RIGHT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_CENTER",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "VehicleAreaMirror::DRIVER_CENTER"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::MIRROR_LOCK",
@@ -3022,27 +2949,47 @@
{
"areaId": "Constants::WINDOW_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_2_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_2_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_ROOF_TOP_1",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3055,31 +3002,27 @@
},
"areas": [
{
- "areaId": "Constants::WINDOW_1_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::WINDOW_1_LEFT"
},
{
- "areaId": "Constants::WINDOW_1_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::WINDOW_1_RIGHT"
},
{
- "areaId": "Constants::WINDOW_2_LEFT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::WINDOW_2_LEFT"
},
{
- "areaId": "Constants::WINDOW_2_RIGHT",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::WINDOW_2_RIGHT"
},
{
- "areaId": "Constants::WINDOW_ROOF_TOP_1",
- "minInt32Value": -1,
- "maxInt32Value": 1
+ "areaId": "Constants::WINDOW_ROOF_TOP_1"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -1,
+ "maxInt32Value": 1
},
{
"property": "VehicleProperty::WINDSHIELD_WIPERS_PERIOD",
@@ -3090,16 +3033,18 @@
},
"areas": [
{
- "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD",
- "minInt32Value": 0,
- "maxInt32Value": 3000
+ "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD"
},
{
- "areaId": "VehicleAreaWindow::REAR_WINDSHIELD",
- "minInt32Value": 0,
- "maxInt32Value": 3000
+ "areaId": "VehicleAreaWindow::REAR_WINDSHIELD"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 3000
},
{
"property": "VehicleProperty::WINDSHIELD_WIPERS_STATE",
@@ -3115,14 +3060,20 @@
"WindshieldWipersState::OFF",
"WindshieldWipersState::ON",
"WindshieldWipersState::SERVICE"
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ }
},
{
"areaId": "VehicleAreaWindow::REAR_WINDSHIELD",
"supportedEnumValues": [
"WindshieldWipersState::OFF",
"WindshieldWipersState::ON"
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ }
}
]
},
@@ -3151,7 +3102,10 @@
"WindshieldWipersSwitch::CONTINUOUS_LEVEL_5",
"WindshieldWipersSwitch::AUTO",
"WindshieldWipersSwitch::SERVICE"
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ }
},
{
"areaId": "VehicleAreaWindow::REAR_WINDSHIELD",
@@ -3163,7 +3117,10 @@
"WindshieldWipersSwitch::CONTINUOUS_LEVEL_2",
"WindshieldWipersSwitch::AUTO",
"WindshieldWipersSwitch::SERVICE"
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ }
}
]
},
@@ -3176,11 +3133,15 @@
},
"areas": [
{
- "areaId": 0,
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": 0
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::STEERING_WHEEL_DEPTH_MOVE",
@@ -3191,11 +3152,15 @@
},
"areas": [
{
- "areaId": 0,
- "minInt32Value": -2,
- "maxInt32Value": 2
+ "areaId": 0
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -2,
+ "maxInt32Value": 2
},
{
"property": "VehicleProperty::STEERING_WHEEL_HEIGHT_POS",
@@ -3206,11 +3171,15 @@
},
"areas": [
{
- "areaId": 0,
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": 0
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::STEERING_WHEEL_HEIGHT_MOVE",
@@ -3221,11 +3190,15 @@
},
"areas": [
{
- "areaId": 0,
- "minInt32Value": -2,
- "maxInt32Value": 2
+ "areaId": 0
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": -2,
+ "maxInt32Value": 2
},
{
"property": "VehicleProperty::STEERING_WHEEL_THEFT_LOCK_ENABLED",
@@ -3260,11 +3233,15 @@
},
"areas": [
{
- "areaId": "Constants::SEAT_1_RIGHT",
- "minInt32Value": 0,
- "maxInt32Value": 10
+ "areaId": "Constants::SEAT_1_RIGHT"
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 10
},
{
"property": "VehicleProperty::GLOVE_BOX_LOCKED",
@@ -3483,12 +3460,15 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "Constants::LIGHT_STATE_OFF",
- "Constants::LIGHT_STATE_ON"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "Constants::LIGHT_STATE_OFF",
+ "Constants::LIGHT_STATE_ON"
]
},
{
@@ -3573,13 +3553,16 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "Constants::LIGHT_SWITCH_OFF",
- "Constants::LIGHT_SWITCH_ON",
- "Constants::LIGHT_SWITCH_AUTO"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "Constants::LIGHT_SWITCH_OFF",
+ "Constants::LIGHT_SWITCH_ON",
+ "Constants::LIGHT_SWITCH_AUTO"
]
},
{
@@ -4468,20 +4451,23 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "EmergencyLaneKeepAssistState::ENABLED",
- "EmergencyLaneKeepAssistState::WARNING_LEFT",
- "EmergencyLaneKeepAssistState::WARNING_RIGHT",
- "EmergencyLaneKeepAssistState::ACTIVATED_STEER_LEFT",
- "EmergencyLaneKeepAssistState::ACTIVATED_STEER_RIGHT",
- "EmergencyLaneKeepAssistState::USER_OVERRIDE"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "EmergencyLaneKeepAssistState::ENABLED",
+ "EmergencyLaneKeepAssistState::WARNING_LEFT",
+ "EmergencyLaneKeepAssistState::WARNING_RIGHT",
+ "EmergencyLaneKeepAssistState::ACTIVATED_STEER_LEFT",
+ "EmergencyLaneKeepAssistState::ACTIVATED_STEER_RIGHT",
+ "EmergencyLaneKeepAssistState::USER_OVERRIDE"
]
},
{
@@ -4501,17 +4487,20 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "CruiseControlType::STANDARD",
- "CruiseControlType::ADAPTIVE",
- "CruiseControlType::PREDICTIVE"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "CruiseControlType::STANDARD",
+ "CruiseControlType::ADAPTIVE",
+ "CruiseControlType::PREDICTIVE"
]
},
{
@@ -4523,35 +4512,41 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "CruiseControlState::ENABLED",
- "CruiseControlState::ACTIVATED",
- "CruiseControlState::USER_OVERRIDE",
- "CruiseControlState::SUSPENDED",
- "CruiseControlState::FORCED_DEACTIVATION_WARNING"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "CruiseControlState::ENABLED",
+ "CruiseControlState::ACTIVATED",
+ "CruiseControlState::USER_OVERRIDE",
+ "CruiseControlState::SUSPENDED",
+ "CruiseControlState::FORCED_DEACTIVATION_WARNING"
]
},
{
"property": "VehicleProperty::CRUISE_CONTROL_COMMAND",
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "CruiseControlCommand::ACTIVATE",
- "CruiseControlCommand::SUSPEND",
- "CruiseControlCommand::INCREASE_TARGET_SPEED",
- "CruiseControlCommand::DECREASE_TARGET_SPEED",
- "CruiseControlCommand::INCREASE_TARGET_TIME_GAP",
- "CruiseControlCommand::DECREASE_TARGET_TIME_GAP"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "CruiseControlCommand::ACTIVATE",
+ "CruiseControlCommand::SUSPEND",
+ "CruiseControlCommand::INCREASE_TARGET_SPEED",
+ "CruiseControlCommand::DECREASE_TARGET_SPEED",
+ "CruiseControlCommand::INCREASE_TARGET_TIME_GAP",
+ "CruiseControlCommand::DECREASE_TARGET_TIME_GAP"
]
},
{
@@ -4563,11 +4558,15 @@
},
"areas": [
{
- "areaId": 0,
- "minFloatValue": 20.0,
- "maxFloatValue": 35.0
+ "areaId": 0
}
- ]
+ ],
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minFloatValue": 20.0,
+ "maxFloatValue": 35.0
},
{
"property": "VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP",
@@ -4594,13 +4593,17 @@
},
"areas": [
{
- "areaId": 0,
- "minInt32Value": 0,
- "maxInt32Value": 200000
+ "areaId": 0
}
],
"maxSampleRate": 10.0,
- "minSampleRate": 1.0
+ "minSampleRate": 1.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minInt32Value": 0,
+ "maxInt32Value": 200000
},
{
"property": "VehicleProperty::HANDS_ON_DETECTION_ENABLED",
@@ -4619,13 +4622,16 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "HandsOnDetectionDriverState::HANDS_ON",
- "HandsOnDetectionDriverState::HANDS_OFF"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "HandsOnDetectionDriverState::HANDS_ON",
+ "HandsOnDetectionDriverState::HANDS_OFF"
]
},
{
@@ -4637,13 +4643,16 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "HandsOnDetectionWarning::NO_WARNING",
- "HandsOnDetectionWarning::WARNING"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "HandsOnDetectionWarning::NO_WARNING",
+ "HandsOnDetectionWarning::WARNING"
]
},
{
@@ -4663,20 +4672,23 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "DriverDrowsinessAttentionState::KSS_RATING_1_EXTREMELY_ALERT",
- "DriverDrowsinessAttentionState::KSS_RATING_2_VERY_ALERT",
- "DriverDrowsinessAttentionState::KSS_RATING_3_ALERT",
- "DriverDrowsinessAttentionState::KSS_RATING_4_RATHER_ALERT",
- "DriverDrowsinessAttentionState::KSS_RATING_5_NEITHER_ALERT_NOR_SLEEPY",
- "DriverDrowsinessAttentionState::KSS_RATING_6_SOME_SLEEPINESS",
- "DriverDrowsinessAttentionState::KSS_RATING_7_SLEEPY_NO_EFFORT",
- "DriverDrowsinessAttentionState::KSS_RATING_8_SLEEPY_SOME_EFFORT",
- "DriverDrowsinessAttentionState::KSS_RATING_9_VERY_SLEEPY"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "DriverDrowsinessAttentionState::KSS_RATING_1_EXTREMELY_ALERT",
+ "DriverDrowsinessAttentionState::KSS_RATING_2_VERY_ALERT",
+ "DriverDrowsinessAttentionState::KSS_RATING_3_ALERT",
+ "DriverDrowsinessAttentionState::KSS_RATING_4_RATHER_ALERT",
+ "DriverDrowsinessAttentionState::KSS_RATING_5_NEITHER_ALERT_NOR_SLEEPY",
+ "DriverDrowsinessAttentionState::KSS_RATING_6_SOME_SLEEPINESS",
+ "DriverDrowsinessAttentionState::KSS_RATING_7_SLEEPY_NO_EFFORT",
+ "DriverDrowsinessAttentionState::KSS_RATING_8_SLEEPY_SOME_EFFORT",
+ "DriverDrowsinessAttentionState::KSS_RATING_9_VERY_SLEEPY"
]
},
{
@@ -4696,13 +4708,16 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "DriverDrowsinessAttentionWarning::NO_WARNING",
- "DriverDrowsinessAttentionWarning::WARNING"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "DriverDrowsinessAttentionWarning::NO_WARNING",
+ "DriverDrowsinessAttentionWarning::WARNING"
]
},
{
@@ -4722,13 +4737,16 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "DriverDistractionState::NOT_DISTRACTED",
- "DriverDistractionState::DISTRACTED"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "DriverDistractionState::NOT_DISTRACTED",
+ "DriverDistractionState::DISTRACTED"
]
},
{
@@ -4748,13 +4766,16 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "DriverDistractionWarning::NO_WARNING",
- "DriverDistractionWarning::WARNING"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "DriverDistractionWarning::NO_WARNING",
+ "DriverDistractionWarning::WARNING"
]
},
{
@@ -4794,10 +4815,10 @@
"property": "VehicleProperty::VHAL_HEARTBEAT",
"areas": [
{
- "areaId": 0,
- "supportVariableUpdateRate": false
+ "areaId": 0
}
- ]
+ ],
+ "supportVariableUpdateRate": false
},
{
"property": "VehicleProperty::CLUSTER_SWITCH_UI",
@@ -4861,11 +4882,11 @@
],
"areas": [
{
- "areaId": 0,
- "supportVariableUpdateRate": false
+ "areaId": 0
}
],
- "comment": "configArray specifies it consists of int64[2] and byte[16]."
+ "comment": "configArray specifies it consists of int64[2] and byte[16].",
+ "supportVariableUpdateRate": false
},
{
"property": "VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT",
@@ -4919,18 +4940,21 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "AutomaticEmergencyBrakingState::ENABLED",
- "AutomaticEmergencyBrakingState::ACTIVATED",
- "AutomaticEmergencyBrakingState::USER_OVERRIDE"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "AutomaticEmergencyBrakingState::ENABLED",
+ "AutomaticEmergencyBrakingState::ACTIVATED",
+ "AutomaticEmergencyBrakingState::USER_OVERRIDE"
]
},
{
@@ -4950,17 +4974,20 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "ForwardCollisionWarningState::NO_WARNING",
- "ForwardCollisionWarningState::WARNING"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "ForwardCollisionWarningState::NO_WARNING",
+ "ForwardCollisionWarningState::WARNING"
]
},
{
@@ -4980,29 +5007,23 @@
},
"areas": [
{
- "areaId": "VehicleAreaMirror::DRIVER_LEFT",
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "BlindSpotWarningState::NO_WARNING",
- "BlindSpotWarningState::WARNING"
- ]
+ "areaId": "VehicleAreaMirror::DRIVER_LEFT"
},
{
- "areaId": "VehicleAreaMirror::DRIVER_RIGHT",
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "BlindSpotWarningState::NO_WARNING",
- "BlindSpotWarningState::WARNING"
- ]
+ "areaId": "VehicleAreaMirror::DRIVER_RIGHT"
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "BlindSpotWarningState::NO_WARNING",
+ "BlindSpotWarningState::WARNING"
]
},
{
@@ -5022,17 +5043,20 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "LaneDepartureWarningState::NO_WARNING",
- "LaneDepartureWarningState::WARNING_LEFT",
- "LaneDepartureWarningState::WARNING_RIGHT"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "LaneDepartureWarningState::NO_WARNING",
+ "LaneDepartureWarningState::WARNING_LEFT",
+ "LaneDepartureWarningState::WARNING_RIGHT"
]
},
{
@@ -5052,18 +5076,21 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "LaneKeepAssistState::ENABLED",
- "LaneKeepAssistState::ACTIVATED_STEER_LEFT",
- "LaneKeepAssistState::ACTIVATED_STEER_RIGHT",
- "LaneKeepAssistState::USER_OVERRIDE"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "LaneKeepAssistState::ENABLED",
+ "LaneKeepAssistState::ACTIVATED_STEER_LEFT",
+ "LaneKeepAssistState::ACTIVATED_STEER_RIGHT",
+ "LaneKeepAssistState::USER_OVERRIDE"
]
},
{
@@ -5086,19 +5113,22 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "LaneCenteringAssistState::ENABLED",
- "LaneCenteringAssistState::ACTIVATION_REQUESTED",
- "LaneCenteringAssistState::ACTIVATED",
- "LaneCenteringAssistState::USER_OVERRIDE",
- "LaneCenteringAssistState::FORCED_DEACTIVATION_WARNING"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "LaneCenteringAssistState::ENABLED",
+ "LaneCenteringAssistState::ACTIVATION_REQUESTED",
+ "LaneCenteringAssistState::ACTIVATED",
+ "LaneCenteringAssistState::USER_OVERRIDE",
+ "LaneCenteringAssistState::FORCED_DEACTIVATION_WARNING"
]
},
{
@@ -5118,16 +5148,19 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "LowSpeedCollisionWarningState::NO_WARNING",
- "LowSpeedCollisionWarningState::WARNING"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "LowSpeedCollisionWarningState::NO_WARNING",
+ "LowSpeedCollisionWarningState::WARNING"
]
},
{
@@ -5147,16 +5180,19 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_SPEED_LOW",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "ElectronicStabilityControlState::ENABLED",
- "ElectronicStabilityControlState::ACTIVATED"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "ElectronicStabilityControlState::ENABLED",
+ "ElectronicStabilityControlState::ACTIVATED"
]
},
{
@@ -5176,21 +5212,24 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "CrossTrafficMonitoringWarningState::NO_WARNING",
- "CrossTrafficMonitoringWarningState::WARNING_FRONT_LEFT",
- "CrossTrafficMonitoringWarningState::WARNING_FRONT_RIGHT",
- "CrossTrafficMonitoringWarningState::WARNING_FRONT_BOTH",
- "CrossTrafficMonitoringWarningState::WARNING_REAR_LEFT",
- "CrossTrafficMonitoringWarningState::WARNING_REAR_RIGHT",
- "CrossTrafficMonitoringWarningState::WARNING_REAR_BOTH"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "CrossTrafficMonitoringWarningState::NO_WARNING",
+ "CrossTrafficMonitoringWarningState::WARNING_FRONT_LEFT",
+ "CrossTrafficMonitoringWarningState::WARNING_FRONT_RIGHT",
+ "CrossTrafficMonitoringWarningState::WARNING_FRONT_BOTH",
+ "CrossTrafficMonitoringWarningState::WARNING_REAR_LEFT",
+ "CrossTrafficMonitoringWarningState::WARNING_REAR_RIGHT",
+ "CrossTrafficMonitoringWarningState::WARNING_REAR_BOTH"
]
},
{
@@ -5210,17 +5249,20 @@
},
"areas": [
{
- "areaId": 0,
- "supportedEnumValues": [
- "ErrorState::NOT_AVAILABLE_SAFETY",
- "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
- "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
- "ErrorState::NOT_AVAILABLE_DISABLED",
- "LowSpeedAutomaticEmergencyBrakingState::ENABLED",
- "LowSpeedAutomaticEmergencyBrakingState::ACTIVATED",
- "LowSpeedAutomaticEmergencyBrakingState::USER_OVERRIDE"
- ]
+ "areaId": 0
}
+ ],
+ "hasSupportedValueInfo": {
+ "hasSupportedValuesList": true
+ },
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "LowSpeedAutomaticEmergencyBrakingState::ENABLED",
+ "LowSpeedAutomaticEmergencyBrakingState::ACTIVATED",
+ "LowSpeedAutomaticEmergencyBrakingState::USER_OVERRIDE"
]
},
{
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 83debf7..e3da23b 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json
+++ b/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"properties": [
{
"property": "TestVendorProperty::MIXED_TYPE_PROPERTY_FOR_TEST",
@@ -75,9 +76,7 @@
1.0
]
},
- "areaId": "Constants::HVAC_LEFT",
- "minFloatValue": -10.0,
- "maxFloatValue": 10.0
+ "areaId": "Constants::HVAC_LEFT"
},
{
"defaultValue": {
@@ -85,13 +84,17 @@
2.0
]
},
- "areaId": "Constants::HVAC_RIGHT",
- "minFloatValue": -10.0,
- "maxFloatValue": 10.0
+ "areaId": "Constants::HVAC_RIGHT"
}
],
"access": "VehiclePropertyAccess::READ_WRITE",
- "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
+ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE",
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ },
+ "minFloatValue": -10.0,
+ "maxFloatValue": 10.0
},
{
"property": "TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY",
@@ -102,12 +105,7 @@
2
]
},
- "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD",
- "hasSupportedValueInfo": {
- "hasMinSupportedValue": true,
- "hasMaxSupportedValue": true,
- "hasSupportedValuesList": true
- }
+ "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD"
},
{
"defaultValue": {
@@ -115,9 +113,7 @@
0
]
},
- "areaId": "VehicleAreaWindow::REAR_WINDSHIELD",
- "minInt32Value": -100,
- "maxInt32Value": 100
+ "areaId": "VehicleAreaWindow::REAR_WINDSHIELD"
},
{
"defaultValue": {
@@ -125,13 +121,23 @@
-1
]
},
- "areaId": "VehicleAreaWindow::ROOF_TOP_1",
- "minInt32Value": -100,
- "maxInt32Value": 100
+ "areaId": "VehicleAreaWindow::ROOF_TOP_1"
}
],
"access": "VehiclePropertyAccess::READ_WRITE",
- "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
+ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE",
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true,
+ "hasSupportedValuesList": true
+ },
+ "minInt32Value": -100,
+ "maxInt32Value": 100,
+ "supportedValues": [
+ 1,
+ 2,
+ 3
+ ]
},
{
"property": "TestVendorProperty::VENDOR_EXTENSION_STRING_PROPERTY",
@@ -209,4 +215,4 @@
]
}
]
-}
\ No newline at end of file
+}
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 e20befc..d51e430 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
@@ -170,6 +170,13 @@
std::shared_ptr<RecurrentTimer::Callback> recurrentAction;
};
+ struct DumpOptionPropIdAreaIdInfo {
+ int32_t propId;
+ int32_t areaId;
+ std::string propIdStr;
+ std::string areaIdStr;
+ };
+
const std::unique_ptr<obd2frame::FakeObd2Frame> mFakeObd2Frame;
const std::unique_ptr<FakeUserHal> mFakeUserHal;
// RecurrentTimer is thread-safe.
@@ -189,9 +196,17 @@
std::unordered_map<PropIdAreaId, VehiclePropValuePool::RecyclableType, PropIdAreaIdHash>
mSavedProps GUARDED_BY(mLock);
std::unordered_set<PropIdAreaId, PropIdAreaIdHash> mSubOnChangePropIdAreaIds GUARDED_BY(mLock);
- int32_t mMinSupportedValueForTestIntProp GUARDED_BY(mLock) = 0;
- int32_t mMaxSupportedValueForTestIntProp GUARDED_BY(mLock) = 10;
- std::vector<int32_t> mSupportedValuesListForTestIntProp GUARDED_BY(mLock) = {0, 2, 4, 6, 8, 10};
+
+ std::unordered_map<PropIdAreaId, aidl::android::hardware::automotive::vehicle::RawPropValues,
+ PropIdAreaIdHash>
+ mMinSupportedValueByPropIdAreaId GUARDED_BY(mLock);
+ std::unordered_map<PropIdAreaId, aidl::android::hardware::automotive::vehicle::RawPropValues,
+ PropIdAreaIdHash>
+ mMaxSupportedValueByPropIdAreaId GUARDED_BY(mLock);
+ std::unordered_map<PropIdAreaId,
+ std::vector<aidl::android::hardware::automotive::vehicle::RawPropValues>,
+ PropIdAreaIdHash>
+ mSupportedValuesByPropIdAreaId GUARDED_BY(mLock);
// PendingRequestHandler is thread-safe.
mutable PendingRequestHandler<GetValuesCallback,
@@ -320,9 +335,17 @@
float sampleRateHz) REQUIRES(mLock);
void unregisterRefreshLocked(PropIdAreaId propIdAreaId) REQUIRES(mLock);
void refreshTimestampForInterval(int64_t intervalInNanos) EXCLUDES(mLock);
- void triggerSupportedValueChange(
- const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config)
- EXCLUDES(mLock);
+ void triggerSupportedValueChange(int32_t propId, int32_t areaId) EXCLUDES(mLock);
+ template <class T>
+ void setMinSupportedValueLocked(int32_t propId, int32_t areaId, T minValue) REQUIRES(mLock);
+ template <class T>
+ void setMaxSupportedValueLocked(int32_t propId, int32_t areaId, T maxValue) REQUIRES(mLock);
+ template <class T>
+ android::base::Result<void> parseAndSetMinMaxValue(int32_t propId, int32_t areaId,
+ const std::vector<std::string>& options,
+ size_t index) EXCLUDES(mLock);
+ android::base::Result<DumpOptionPropIdAreaIdInfo> parseDumpOptionPropIdAreaId(
+ const std::vector<std::string>& options, size_t& index);
static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp(
aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action,
@@ -355,6 +378,14 @@
size_t index);
static android::base::Result<int32_t> parseAreaId(const std::vector<std::string>& options,
size_t index, int32_t propId);
+ template <class T>
+ static android::base::Result<std::vector<T>> parseOptionValues(
+ const std::vector<std::string>& options, size_t index, size_t count);
+
+ template <class T>
+ static android::base::Result<
+ std::vector<aidl::android::hardware::automotive::vehicle::RawPropValues>>
+ parseOptionsToSupportedValuesList(const std::vector<std::string>& options, size_t index);
};
} // namespace fake
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 01e40fb..4eb84dd 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
@@ -297,6 +297,24 @@
return ss.str();
}
+template <class T>
+RawPropValues createRawPropValues(T value);
+
+template <>
+RawPropValues createRawPropValues(int32_t value) {
+ return RawPropValues{.int32Values = {value}};
+}
+
+template <>
+RawPropValues createRawPropValues(int64_t value) {
+ return RawPropValues{.int64Values = {value}};
+}
+
+template <>
+RawPropValues createRawPropValues(float value) {
+ return RawPropValues{.floatValues = {value}};
+}
+
} // namespace
void FakeVehicleHardware::storePropInitialValue(const ConfigDeclaration& config) {
@@ -398,26 +416,152 @@
return configsByPropId;
}
+template <class T>
+void FakeVehicleHardware::setMinSupportedValueLocked(int32_t propId, int32_t areaId, T minValue) {
+ mMinSupportedValueByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ createRawPropValues<T>(minValue);
+}
+
+template <class T>
+void FakeVehicleHardware::setMaxSupportedValueLocked(int32_t propId, int32_t areaId, T maxValue) {
+ mMaxSupportedValueByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ createRawPropValues<T>(maxValue);
+}
+
void FakeVehicleHardware::init(int32_t s2rS2dConfig) {
maybeGetGrpcServiceInfo(&mPowerControllerServiceAddress);
- for (auto& [_, configDeclaration] : loadConfigDeclarations()) {
- VehiclePropConfig cfg = configDeclaration.config;
- VehiclePropertyStore::TokenFunction tokenFunction = nullptr;
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ for (auto& [_, configDeclaration] : loadConfigDeclarations()) {
+ VehiclePropConfig cfg = configDeclaration.config;
+ VehiclePropertyStore::TokenFunction tokenFunction = nullptr;
- if (cfg.prop == toInt(VehicleProperty::AP_POWER_STATE_REQ)) {
- cfg.configArray[0] = s2rS2dConfig;
- } else if (cfg.prop == OBD2_FREEZE_FRAME) {
- tokenFunction = [](const VehiclePropValue& propValue) { return propValue.timestamp; };
- }
+ if (cfg.prop == toInt(VehicleProperty::AP_POWER_STATE_REQ)) {
+ cfg.configArray[0] = s2rS2dConfig;
+ } else if (cfg.prop == OBD2_FREEZE_FRAME) {
+ tokenFunction = [](const VehiclePropValue& propValue) {
+ return propValue.timestamp;
+ };
+ }
- mServerSidePropStore->registerProperty(cfg, tokenFunction);
- if (obd2frame::FakeObd2Frame::isDiagnosticProperty(cfg)) {
- // Ignore storing default value for diagnostic property. They have special get/set
- // logic.
- continue;
+ mServerSidePropStore->registerProperty(cfg, tokenFunction);
+ if (obd2frame::FakeObd2Frame::isDiagnosticProperty(cfg)) {
+ // Ignore storing default value for diagnostic property. They have special get/set
+ // logic.
+ continue;
+ }
+ storePropInitialValue(configDeclaration);
+
+ int32_t propertyType = cfg.prop & toInt(VehiclePropertyType::MASK);
+ for (const auto& areaConfig : cfg.areaConfigs) {
+ if (!areaConfig.hasSupportedValueInfo.has_value()) {
+ continue;
+ }
+ if (areaConfig.hasSupportedValueInfo->hasMinSupportedValue) {
+ switch (propertyType) {
+ case toInt(VehiclePropertyType::INT32):
+ setMinSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.minInt32Value);
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ setMinSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.minInt64Value);
+ break;
+ case toInt(VehiclePropertyType::FLOAT):
+ setMinSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.minFloatValue);
+ break;
+ default:
+ ALOGE("hasMinSupportedValue must only be true for INT32, INT64 or "
+ "FLOAT "
+ "type property");
+ continue;
+ }
+ }
+ if (areaConfig.hasSupportedValueInfo->hasMaxSupportedValue) {
+ switch (propertyType) {
+ case toInt(VehiclePropertyType::INT32):
+ setMaxSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.maxInt32Value);
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ setMaxSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.maxInt64Value);
+ break;
+ case toInt(VehiclePropertyType::FLOAT):
+ setMaxSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.maxFloatValue);
+ break;
+ default:
+ ALOGE("hasMaxSupportedValue must only be true for INT32, INT64 or "
+ "FLOAT type property");
+ continue;
+ }
+ }
+ if (areaConfig.hasSupportedValueInfo->hasSupportedValuesList) {
+ std::vector<RawPropValues> supportedValuesList;
+ // We first check "supportedValues" field to populate supported values list.
+ const auto& supportedValuesForAreaId =
+ configDeclaration.supportedValuesForAreaId;
+ const auto it = supportedValuesForAreaId.find(areaConfig.areaId);
+ if (it != supportedValuesForAreaId.end()) {
+ for (float supportedValueFloat : it->second) {
+ switch (propertyType) {
+ case toInt(VehiclePropertyType::INT32):
+ supportedValuesList.push_back(createRawPropValues(
+ static_cast<int32_t>(supportedValueFloat)));
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ supportedValuesList.push_back(createRawPropValues(
+ static_cast<int64_t>(supportedValueFloat)));
+ break;
+ case toInt(VehiclePropertyType::FLOAT):
+ supportedValuesList.push_back(
+ createRawPropValues(supportedValueFloat));
+ break;
+ default:
+ ALOGE("supportedValues field is only supported for INT32, "
+ "INT64 or FLOAT type "
+ "property");
+ }
+ }
+ } else {
+ // If "supportedValues" is not specified, try to use "supportedEnumValues".
+ switch (propertyType) {
+ case toInt(VehiclePropertyType::INT32):
+ if (areaConfig.supportedEnumValues.has_value()) {
+ for (int64_t supportedEnumValue :
+ *areaConfig.supportedEnumValues) {
+ int32_t supportedValue =
+ static_cast<int32_t>(supportedEnumValue);
+ supportedValuesList.push_back(
+ createRawPropValues(supportedValue));
+ }
+ }
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ if (areaConfig.supportedEnumValues.has_value()) {
+ for (int64_t supportedEnumValue :
+ *areaConfig.supportedEnumValues) {
+ supportedValuesList.push_back(
+ createRawPropValues(supportedEnumValue));
+ }
+ }
+ break;
+ default:
+ // Do nothing
+ break;
+ }
+ }
+ if (!supportedValuesList.empty()) {
+ mSupportedValuesByPropIdAreaId[PropIdAreaId{.propId = cfg.prop,
+ .areaId = areaConfig.areaId}] =
+ std::move(supportedValuesList);
+ }
+ }
+ }
}
- storePropInitialValue(configDeclaration);
}
// OBD2_LIVE_FRAME and OBD2_FREEZE_FRAME must be configured in default configs.
@@ -1799,119 +1943,252 @@
return result;
}
-std::string FakeVehicleHardware::dumpSetMinMaxValue(const std::vector<std::string>& options) {
- if (auto result = checkArgumentsSize(options, /*minSize=*/3); !result.ok()) {
- return getErrorMsg(result);
+Result<FakeVehicleHardware::DumpOptionPropIdAreaIdInfo>
+FakeVehicleHardware::parseDumpOptionPropIdAreaId(const std::vector<std::string>& options,
+ size_t& index) {
+ const std::string& propIdStr = options[index];
+ auto maybePropId = parsePropId(options, index);
+ index++;
+ if (!maybePropId.ok()) {
+ return Error() << "propId not valid: " << propIdStr;
}
- int testPropId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY);
- auto configResult = mServerSidePropStore->getPropConfig(testPropId);
+ int32_t propId = maybePropId.value();
+ auto configResult = mServerSidePropStore->getPropConfig(propId);
if (!configResult.ok()) {
- return "Failed to set min/max supported value: VENDOR_EXTENSION_INT_PROPERTY not supported";
+ return Error() << "property not supported";
}
- int32_t values[2];
- for (size_t i = 1; i < 3; i++) {
- auto int32Result = safelyParseInt<int32_t>(i, options[i]);
- if (!int32Result.ok()) {
- return StringPrintf(
- "Failed to set min/max supported value: Value: \"%s\" is not a valid int: %s\n",
- options[i].c_str(), getErrorMsg(int32Result).c_str());
+ std::string areaIdStr = "0";
+ int32_t areaId = 0;
+ if (EqualsIgnoreCase(options[index], "-a")) {
+ index++;
+ if (index >= options.size()) {
+ return Error() << "Not enough arguments";
}
- values[i - 1] = int32Result.value();
+ areaIdStr = options[index];
+ auto maybeAreaId = parseAreaId(options, index, propId);
+ if (!maybeAreaId.ok()) {
+ return Error() << "areaId not valid: " << areaIdStr;
+ }
+ areaId = maybeAreaId.value();
+ index++;
}
- int32_t minValue = values[0];
- int32_t maxValue = values[1];
+ return DumpOptionPropIdAreaIdInfo{
+ .propId = propId, .areaId = areaId, .propIdStr = propIdStr, .areaIdStr = areaIdStr};
+}
+
+template <class T>
+Result<void> FakeVehicleHardware::parseAndSetMinMaxValue(int32_t propId, int32_t areaId,
+ const std::vector<std::string>& options,
+ size_t index) {
+ auto valuesResult = parseOptionValues<T>(options, index, /*count= */ 2);
+ if (!valuesResult.ok()) {
+ return Error() << "Failed to set min/max supported value: "
+ << valuesResult.error().message();
+ }
+ T minValue = (*valuesResult)[0];
+ T maxValue = (*valuesResult)[1];
if (minValue > maxValue) {
- return StringPrintf("Failed to set min/max supported value: MinValue: %" PRId32
- " must not > MaxValue: %" PRId32,
- minValue, maxValue);
+ return Error() << "Failed to set min/max supported value: MinValue: " << minValue
+ << " must not > MaxValue: " << maxValue;
}
{
std::scoped_lock<std::mutex> lockGuard(mLock);
- mMinSupportedValueForTestIntProp = minValue;
- mMaxSupportedValueForTestIntProp = maxValue;
+ setMinSupportedValueLocked(propId, areaId, minValue);
+ setMaxSupportedValueLocked(propId, areaId, maxValue);
}
- triggerSupportedValueChange(configResult.value());
- return "Min/Max supported value for VENDOR_EXTENSION_INT_PROPERTY set";
+ return {};
+}
+
+template <class T>
+Result<std::vector<T>> FakeVehicleHardware::parseOptionValues(
+ const std::vector<std::string>& options, size_t index, size_t count) {
+ if (index + count > options.size()) {
+ return Error() << "Not enough arguments";
+ }
+ std::vector<T> values;
+ for (size_t i = index; i < index + count; i++) {
+ auto result = safelyParseInt<T>(i, options[i]);
+ if (!result.ok()) {
+ return Error() << StringPrintf("Value: \"%s\" is not a valid int: %s",
+ options[i].c_str(), getErrorMsg(result).c_str());
+ }
+ values.push_back(result.value());
+ }
+ return values;
+}
+
+// This is a special version of parseOptionValues for float type.
+template <>
+Result<std::vector<float>> FakeVehicleHardware::parseOptionValues(
+ const std::vector<std::string>& options, size_t index, size_t count) {
+ if (index + count > options.size()) {
+ return Error() << "Not enough arguments";
+ }
+ std::vector<float> values;
+ for (size_t i = index; i < index + count; i++) {
+ auto result = safelyParseFloat(i, options[i]);
+ if (!result.ok()) {
+ return Error() << StringPrintf("Value: \"%s\" is not a valid float: %s",
+ options[i].c_str(), getErrorMsg(result).c_str());
+ }
+ values.push_back(result.value());
+ }
+ return values;
+}
+
+template <class T>
+Result<std::vector<RawPropValues>> FakeVehicleHardware::parseOptionsToSupportedValuesList(
+ const std::vector<std::string>& options, size_t index) {
+ std::vector<RawPropValues> supportedValuesList;
+ auto valuesResult = parseOptionValues<T>(options, index, options.size() - index);
+ if (!valuesResult.ok()) {
+ return Error() << valuesResult.error().message();
+ }
+ std::vector<T> values = *valuesResult;
+ if (values.size() == 0) {
+ return Error() << "Not enough arguments";
+ }
+ for (T value : *valuesResult) {
+ supportedValuesList.push_back(createRawPropValues(value));
+ }
+ return supportedValuesList;
+}
+
+std::string FakeVehicleHardware::dumpSetMinMaxValue(const std::vector<std::string>& options) {
+ // Requires at least --set-minmaxvalue <PropId> <MinValue> <MaxValue>
+ if (auto result = checkArgumentsSize(options, /*minSize=*/4); !result.ok()) {
+ return "Failed to set min/max supported value: Not enough arguments\n";
+ }
+ size_t index = 1;
+ Result<DumpOptionPropIdAreaIdInfo> maybeInfo = parseDumpOptionPropIdAreaId(options, index);
+ if (!maybeInfo.ok()) {
+ return StringPrintf("Failed to set min/max supported value: %s\n",
+ maybeInfo.error().message().c_str());
+ }
+ int32_t propId = maybeInfo->propId;
+ int32_t areaId = maybeInfo->areaId;
+
+ Result<void> parseAndSetValueResult = {};
+ switch (propId & toInt(VehiclePropertyType::MASK)) {
+ case toInt(VehiclePropertyType::INT32):
+ parseAndSetValueResult =
+ parseAndSetMinMaxValue<int32_t>(propId, areaId, options, index);
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ parseAndSetValueResult =
+ parseAndSetMinMaxValue<int64_t>(propId, areaId, options, index);
+ break;
+ case toInt(VehiclePropertyType::FLOAT):
+ parseAndSetValueResult = parseAndSetMinMaxValue<float>(propId, areaId, options, index);
+ break;
+ default:
+ return StringPrintf(
+ "Failed to set min/max supported value: only int32/int64/float type"
+ " property is supported\n");
+ }
+ if (!parseAndSetValueResult.ok()) {
+ return parseAndSetValueResult.error().message();
+ }
+
+ triggerSupportedValueChange(propId, areaId);
+ return StringPrintf("Min/Max supported value for propId: %s, areaId: %s set",
+ maybeInfo->propIdStr.c_str(), maybeInfo->propIdStr.c_str());
}
std::string FakeVehicleHardware::dumpSetSupportedValues(const std::vector<std::string>& options) {
- if (auto result = checkArgumentsSize(options, /*minSize=*/2); !result.ok()) {
- return getErrorMsg(result);
- }
- int testPropId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY);
- auto configResult = mServerSidePropStore->getPropConfig(testPropId);
- if (!configResult.ok()) {
- return "Failed to set min/max supported value: VENDOR_EXTENSION_INT_PROPERTY not supported";
- }
- std::vector<int32_t> values;
- for (size_t i = 1; i < options.size(); i++) {
- auto int32Result = safelyParseInt<int32_t>(i, options[i]);
- if (!int32Result.ok()) {
- return StringPrintf(
- "Failed to set supported values: Value: \"%s\" is not a valid int: %s\n",
- options[i].c_str(), getErrorMsg(int32Result).c_str());
- }
- values.push_back(int32Result.value());
+ // We at least requires set-supportedvalues <PROP> <SUPPORTED_VALUE>
+ if (auto result = checkArgumentsSize(options, /*minSize=*/3); !result.ok()) {
+ return "Failed to set supported values list: Not enough arguments\n";
}
- {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- mSupportedValuesListForTestIntProp = values;
+ size_t index = 1;
+ Result<DumpOptionPropIdAreaIdInfo> maybeInfo = parseDumpOptionPropIdAreaId(options, index);
+ if (!maybeInfo.ok()) {
+ return StringPrintf("Failed to set supported values list: %s\n",
+ maybeInfo.error().message().c_str());
}
- triggerSupportedValueChange(configResult.value());
- return "Supported values list for VENDOR_EXTENSION_INT_PROPERTY set";
+ int32_t propId = maybeInfo->propId;
+ int32_t areaId = maybeInfo->areaId;
+ Result<std::vector<RawPropValues>> maybeSupportedValues;
+ switch (propId & toInt(VehiclePropertyType::MASK)) {
+ case toInt(VehiclePropertyType::INT32):
+ maybeSupportedValues = parseOptionsToSupportedValuesList<int32_t>(options, index);
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ maybeSupportedValues = parseOptionsToSupportedValuesList<int64_t>(options, index);
+ break;
+ case toInt(VehiclePropertyType::FLOAT):
+ maybeSupportedValues = parseOptionsToSupportedValuesList<float>(options, index);
+ break;
+ default:
+ return StringPrintf(
+ "Failed to set supported values list: only int32/int64/float type"
+ " property is supported\n");
+ }
+ if (!maybeSupportedValues.ok()) {
+ return StringPrintf("Failed to set supported values list: %s\n",
+ maybeSupportedValues.error().message().c_str());
+ }
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ mSupportedValuesByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ *maybeSupportedValues;
+ }
+ triggerSupportedValueChange(maybeInfo->propId, maybeInfo->areaId);
+ return StringPrintf("Supported values list for propId: %s, areaId: %s set",
+ maybeInfo->propIdStr.c_str(), maybeInfo->propIdStr.c_str());
}
-// Triggers supported value change for all areaIds that specify hasSupportedValueInfo.
-void FakeVehicleHardware::triggerSupportedValueChange(const VehiclePropConfig& config) {
+void FakeVehicleHardware::triggerSupportedValueChange(int32_t propId, int32_t areaId) {
if (mOnSupportedValueChangeCallback == nullptr) {
ALOGE("onSupportedValueChangeCallback is not registered, ignore event");
return;
}
- std::vector<PropIdAreaId> propIdAreaIds;
- for (const VehicleAreaConfig& areaConfig : config.areaConfigs) {
- if (areaConfig.hasSupportedValueInfo != std::nullopt) {
- propIdAreaIds.push_back({
- .propId = config.prop,
- .areaId = areaConfig.areaId,
- });
- }
- }
- (*mOnSupportedValueChangeCallback)(std::move(propIdAreaIds));
+ (*mOnSupportedValueChangeCallback)({PropIdAreaId{
+ .propId = propId,
+ .areaId = areaId,
+ }});
}
std::string FakeVehicleHardware::dumpHelp() {
- return "Usage: \n\n"
- "[no args]: dumps (id and value) all supported properties \n"
- "--help: shows this help\n"
- "--list: lists the property IDs and their supported area IDs for all supported "
- "properties\n"
- "--get <PROP_ID_1> [PROP_ID_2] [PROP_ID_N]: dumps the value of specific properties. \n"
- "--getWithArg <PROP_ID> [ValueArguments]: gets the value for a specific property. "
- "The value arguments constructs a VehiclePropValue used in the getValue request. \n"
- "--set <PROP_ID> [ValueArguments]: sets the value of property PROP_ID, the value "
- "arguments constructs a VehiclePropValue used in the setValue request. \n"
- "--set-minmaxvalue <MIN_VALUE(int)> <MAX_VALUE(int)>: sets the min max supported value "
- "for VENDOR_EXTENSION_INT_PROPERTY\n"
- "--set-supportedvalues <VALUE_1(int)> [VALUE_2(int) ...]: sets the supported values list"
- "for VENDOR_EXTENSION_INT_PROPERTY\n"
- "--save-prop <PROP_ID> [-a AREA_ID]: saves the current value for PROP_ID, integration "
- "tests that modify prop value must call this before test and restore-prop after test. \n"
- "--restore-prop <PROP_ID> [-a AREA_ID]: restores a previously saved property value. \n"
- "--inject-event <PROP_ID> [ValueArguments]: inject a property update event from car\n\n"
- "ValueArguments are in the format of [-a OPTIONAL_AREA_ID] "
- "[-i INT_VALUE_1 [INT_VALUE_2 ...]] "
- "[-i64 INT64_VALUE_1 [INT64_VALUE_2 ...]] "
- "[-f FLOAT_VALUE_1 [FLOAT_VALUE_2 ...]] "
- "[-s STR_VALUE] "
- "[-b BYTES_VALUE].\n"
- "For example: to set property ID 0x1234, areaId 0x1 to int32 values: [1, 2, 3], "
- "use \"--set 0x1234 -a 0x1 -i 1 2 3\"\n"
- "Note that the string, bytes and area value can be set just once, while the other can"
- " have multiple values (so they're used in the respective array), "
- "BYTES_VALUE is in the form of 0xXXXX, e.g. 0xdeadbeef.\n" +
- genFakeDataHelp() + "Fake user HAL usage: \n" + mFakeUserHal->showDumpHelp();
+ return R"(Usage:
+[no args]: dumps (id and value) all supported properties
+
+--help: shows this help
+
+--list: lists the property IDs and their supported area IDs for all supported properties
+
+--get <PROP_ID_1> [PROP_ID_2] [PROP_ID_N]: dumps the value of specific properties.
+
+--getWithArg <PROP_ID> [ValueArguments]: gets the value for a specific property.
+The value arguments constructs a VehiclePropValue used in the getValue request.
+
+--set <PROP_ID> [ValueArguments]: sets the value of property PROP_ID
+The value arguments constructs a VehiclePropValue used in the setValue request.
+
+--set-minmaxvalue <PROP_ID> [-a AREA_ID] <MIN_VALUE> <MAX_VALUE>: sets the min max supported value
+e.g. --set-minmaxvalue HVAC_TEMPERATURE_SET -a ROW_1_LEFT 17 32
+
+--set-supportedvalues <PROP_ID> [-a AREA_ID] <VALUE_1> [VALUE_2 ...]: sets the supported values list
+e.g. --set-supportedvalues HVAC_TEMPERATURE_SET -a ROW_1_LEFT 17 17.5 18 18.5
+
+--save-prop <PROP_ID> [-a AREA_ID]: saves the current value for PROP_ID, integration tests that
+modify prop value must call this before test and restore-prop after test.
+
+--restore-prop <PROP_ID> [-a AREA_ID]: restores a previously saved property value.
+
+--inject-event <PROP_ID> [ValueArguments]: inject a property update event from car
+ValueArguments are in the format of
+[-a OPTIONAL_AREA_ID] [-i INT_VALUE_1 [INT_VALUE_2 ...]] [-i64 INT64_VALUE_1 [INT64_VALUE_2 ...]]
+[-f FLOAT_VALUE_1 [FLOAT_VALUE_2 ...]] [-s STR_VALUE] [-b BYTES_VALUE].
+For example: to set property ID 0x1234, areaId 0x1 to int32 values: [1, 2, 3]
+use "--set 0x1234 -a 0x1 -i 1 2 3"
+Note that the string, bytes and area value can be set just once, while the other can have multiple
+values (so they're used in the respective array), BYTES_VALUE is in the form of 0xXXXX,
+e.g. 0xdeadbeef.
+)" + genFakeDataHelp() +
+ "Fake user HAL usage: \n" + mFakeUserHal->showDumpHelp();
}
std::string FakeVehicleHardware::dumpAllProperties() {
@@ -2405,27 +2682,24 @@
const std::vector<PropIdAreaId>& propIdAreaIds) {
std::scoped_lock<std::mutex> lockGuard(mLock);
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)) {
+ const auto minIt = mMinSupportedValueByPropIdAreaId.find(propIdAreaId);
+ const auto maxIt = mMaxSupportedValueByPropIdAreaId.find(propIdAreaId);
+ if (minIt == mMinSupportedValueByPropIdAreaId.end() &&
+ maxIt == mMaxSupportedValueByPropIdAreaId.end()) {
results.push_back(MinMaxSupportedValueResult{
.status = StatusCode::INVALID_ARG,
});
continue;
}
- results.push_back(MinMaxSupportedValueResult{
- .status = StatusCode::OK,
- .minSupportedValue =
- RawPropValues{
- .int32Values = {mMinSupportedValueForTestIntProp},
- },
- .maxSupportedValue =
- RawPropValues{
- .int32Values = {mMaxSupportedValueForTestIntProp},
- },
- });
+ auto result = MinMaxSupportedValueResult{.status = StatusCode::OK};
+ if (minIt != mMinSupportedValueByPropIdAreaId.end()) {
+ result.minSupportedValue = minIt->second;
+ }
+ if (maxIt != mMaxSupportedValueByPropIdAreaId.end()) {
+ result.maxSupportedValue = maxIt->second;
+ }
+ results.push_back(std::move(result));
}
return results;
}
@@ -2434,19 +2708,17 @@
const std::vector<PropIdAreaId>& propIdAreaIds) {
std::scoped_lock<std::mutex> lockGuard(mLock);
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)) {
+ const auto it = mSupportedValuesByPropIdAreaId.find(propIdAreaId);
+ if (it == mSupportedValuesByPropIdAreaId.end()) {
results.push_back(SupportedValuesListResult{
.status = StatusCode::INVALID_ARG,
});
continue;
}
std::vector<std::optional<RawPropValues>> supportedValuesList;
- for (int32_t value : mSupportedValuesListForTestIntProp) {
- supportedValuesList.push_back(RawPropValues{.int32Values = {value}});
+ for (const RawPropValues& supportedValue : it->second) {
+ supportedValuesList.push_back(supportedValue);
}
results.push_back(SupportedValuesListResult{
.status = StatusCode::OK,
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 df5c2a3..8262098 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
@@ -80,6 +80,7 @@
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateShutdownParam;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaSeat;
+using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow;
using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
@@ -399,15 +400,15 @@
};
VehiclePropValue leftHvacTemp = {
+ .areaId = SEAT_1_LEFT,
.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT),
.value = {.floatValues = {170.0}},
- .areaId = SEAT_1_LEFT,
};
VehiclePropValue rightHvacTemp = {
+ .areaId = SEAT_1_RIGHT,
.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT),
.value = {.floatValues = {180.0}},
- .areaId = SEAT_1_RIGHT,
};
return {oilLevel, leftHvacTemp, rightHvacTemp};
@@ -534,8 +535,8 @@
for (auto areaConfig : config.config.areaConfigs) {
StatusCode status = StatusCode::OK;
VehiclePropValue propValue{
- .prop = propId,
.areaId = areaConfig.areaId,
+ .prop = propId,
};
if (config.initialAreaValues.empty()) {
if (config.initialValue == RawPropValues{}) {
@@ -790,12 +791,12 @@
// If we set the value, it should update despite the override.
ASSERT_EQ(setValue(VehiclePropValue{
+ .timestamp = elapsedRealtimeNano(),
.prop = gearProp,
.value =
{
.int32Values = {5},
},
- .timestamp = elapsedRealtimeNano(),
}),
StatusCode::OK)
<< "expect to set the overridden property ok";
@@ -821,8 +822,8 @@
int hvacProp = toInt(VehicleProperty::HVAC_TEMPERATURE_SET);
auto result = getValue(VehiclePropValue{
- .prop = hvacProp,
.areaId = HVAC_LEFT,
+ .prop = hvacProp,
});
ASSERT_TRUE(result.ok()) << "expect to get the overridden property ok: " << getStatus(result);
@@ -1247,16 +1248,16 @@
.value.int32Values = {0},
},
VehiclePropValue{
+ .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT),
.prop = toInt(
VehicleProperty::BLIND_SPOT_WARNING_STATE),
- .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT),
.value.int32Values = {toInt(
ErrorState::NOT_AVAILABLE_DISABLED)},
},
VehiclePropValue{
+ .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT),
.prop = toInt(
VehicleProperty::BLIND_SPOT_WARNING_STATE),
- .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT),
.value.int32Values = {toInt(
ErrorState::NOT_AVAILABLE_DISABLED)},
},
@@ -1280,15 +1281,15 @@
.value.int32Values = {1},
},
VehiclePropValue{
+ .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT),
.prop = toInt(
VehicleProperty::BLIND_SPOT_WARNING_STATE),
- .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT),
.value.int32Values = {1},
},
VehiclePropValue{
+ .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT),
.prop = toInt(
VehicleProperty::BLIND_SPOT_WARNING_STATE),
- .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT),
.value.int32Values = {1},
},
},
@@ -1757,7 +1758,7 @@
std::vector<VehiclePropValue> gotValues;
for (const auto& value : tc.expectedValuesToGet) {
- auto result = getValue(VehiclePropValue{.prop = value.prop, .areaId = value.areaId});
+ auto result = getValue(VehiclePropValue{.areaId = value.areaId, .prop = value.prop});
ASSERT_TRUE(result.ok()) << "failed to get property " << value.prop
<< " status:" << getStatus(result);
@@ -1880,8 +1881,8 @@
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
// Turn off HVAC_POWER_ON for only 1 area ID
- StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ StatusCode status = setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {0}});
EXPECT_EQ(status, StatusCode::OK);
@@ -1895,8 +1896,8 @@
for (auto& powerPropAreaConfig : powerPropConfig->areaConfigs) {
int powerDependentAreaId = powerPropAreaConfig.areaId;
auto getValueResult = getValue(VehiclePropValue{
- .prop = powerPropId,
.areaId = powerDependentAreaId,
+ .prop = powerPropId,
});
// If the current area ID is contained within the HVAC_POWER_ON area ID
@@ -1914,8 +1915,8 @@
// Resetting HVAC_POWER_ON at areaId back to ON state to ensure that there's no dependence
// on this value from any power dependent property values other than those with the same
// areaId.
- setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {1}});
}
}
@@ -1927,8 +1928,8 @@
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
// Turn off HVAC_POWER_ON for only 1 area ID
- StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ StatusCode status = setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {0}});
EXPECT_EQ(status, StatusCode::OK);
@@ -1942,7 +1943,7 @@
// Try setting a value at each area ID supported by the power dependent property
for (auto& powerPropAreaConfig : powerPropConfig->areaConfigs) {
int powerDependentAreaId = powerPropAreaConfig.areaId;
- auto val = VehiclePropValue{.prop = powerPropId, .areaId = powerDependentAreaId};
+ auto val = VehiclePropValue{.areaId = powerDependentAreaId, .prop = powerPropId};
if (propType == VehiclePropertyType::FLOAT) {
val.value.floatValues.emplace_back(20);
} else {
@@ -1964,8 +1965,8 @@
// Resetting HVAC_POWER_ON at areaId back to ON state to ensure that there's no dependence
// on this value from any power dependent property values other than those with the same
// areaId.
- setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {1}});
}
}
@@ -1976,8 +1977,8 @@
EXPECT_NE(hvacPowerOnConfig, nullptr);
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
- StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ StatusCode status = setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {0}});
EXPECT_EQ(status, StatusCode::OK);
auto events = getChangedProperties();
@@ -1992,8 +1993,8 @@
}
clearChangedProperties();
- status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ status = setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {1}});
EXPECT_EQ(status, StatusCode::OK);
events = getChangedProperties();
@@ -2024,8 +2025,8 @@
for (auto& hvacDualOnConfig : hvacDualOnConfig->areaConfigs) {
int32_t hvacDualOnAreaId = hvacDualOnConfig.areaId;
subscribe(toInt(VehicleProperty::HVAC_DUAL_ON), hvacDualOnAreaId, /*sampleRateHz*/ 0);
- StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_DUAL_ON),
- .areaId = hvacDualOnAreaId,
+ StatusCode status = setValue(VehiclePropValue{.areaId = hvacDualOnAreaId,
+ .prop = toInt(VehicleProperty::HVAC_DUAL_ON),
.value.int32Values = {1}});
EXPECT_EQ(status, StatusCode::OK);
@@ -2056,8 +2057,8 @@
continue;
}
float expectedValue = 25;
- status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
- .areaId = hvacTemperatureSetAreaId,
+ status = setValue(VehiclePropValue{.areaId = hvacTemperatureSetAreaId,
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
.value.floatValues = {expectedValue}});
EXPECT_EQ(status, StatusCode::OK);
events = getChangedProperties();
@@ -2069,8 +2070,8 @@
clearChangedProperties();
}
- status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_DUAL_ON),
- .areaId = hvacDualOnAreaId,
+ status = setValue(VehiclePropValue{.areaId = hvacDualOnAreaId,
+ .prop = toInt(VehicleProperty::HVAC_DUAL_ON),
.value.int32Values = {0}});
EXPECT_EQ(status, StatusCode::OK);
@@ -2090,8 +2091,8 @@
continue;
}
float expectedValue = 24;
- status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
- .areaId = hvacTemperatureSetAreaId,
+ status = setValue(VehiclePropValue{.areaId = hvacTemperatureSetAreaId,
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
.value.floatValues = {expectedValue}});
EXPECT_EQ(status, StatusCode::OK);
events = getChangedProperties();
@@ -2354,8 +2355,8 @@
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION),
.areaId = 1,
+ .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION),
.value.int32Values = {666, 1, 1, 2},
};
@@ -2390,8 +2391,8 @@
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = propSwitchUser,
.areaId = 1,
+ .prop = propSwitchUser,
.value.int32Values = {666, 3, 2},
};
@@ -2401,8 +2402,8 @@
// Simulate a request from Android side.
VehiclePropValue switchUserRequest = {
- .prop = propSwitchUser,
.areaId = 0,
+ .prop = propSwitchUser,
.value.int32Values = {666, 3},
};
// Clear existing events.
@@ -2455,8 +2456,8 @@
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = toInt(VehicleProperty::CREATE_USER),
.areaId = 1,
+ .prop = toInt(VehicleProperty::CREATE_USER),
.value.int32Values = {666, 2},
};
@@ -2466,8 +2467,8 @@
// Simulate a request from Android side.
VehiclePropValue createUserRequest = {
- .prop = propCreateUser,
.areaId = 0,
+ .prop = propCreateUser,
.value.int32Values = {666},
};
// Clear existing events.
@@ -2517,8 +2518,8 @@
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = propInitialUserInfo,
.areaId = 1,
+ .prop = propInitialUserInfo,
.value.int32Values = {666, 1, 11},
};
@@ -2528,8 +2529,8 @@
// Simulate a request from Android side.
VehiclePropValue initialUserInfoRequest = {
- .prop = propInitialUserInfo,
.areaId = 0,
+ .prop = propInitialUserInfo,
.value.int32Values = {3},
};
// Clear existing events.
@@ -2591,7 +2592,7 @@
DumpResult result = getHardware()->dump(options);
ASSERT_FALSE(result.callerShouldDumpState);
ASSERT_NE(result.buffer, "");
- ASSERT_THAT(result.buffer, ContainsRegex("Usage: "));
+ ASSERT_THAT(result.buffer, ContainsRegex("Usage:"));
}
TEST_F(FakeVehicleHardwareTest, testDumpListProperties) {
@@ -2697,8 +2698,8 @@
ASSERT_THAT(result.buffer, ContainsRegex("saved"));
ASSERT_EQ(setValue(VehiclePropValue{
- .prop = prop,
.areaId = WHEEL_FRONT_LEFT,
+ .prop = prop,
.value =
{
.floatValues = {210.0},
@@ -2711,7 +2712,7 @@
ASSERT_FALSE(result.callerShouldDumpState);
ASSERT_THAT(result.buffer, ContainsRegex("restored"));
- auto getResult = getValue(VehiclePropValue{.prop = prop, .areaId = WHEEL_FRONT_LEFT});
+ auto getResult = getValue(VehiclePropValue{.areaId = WHEEL_FRONT_LEFT, .prop = prop});
ASSERT_TRUE(getResult.ok());
// The default value is 200.0.
@@ -2761,8 +2762,9 @@
"response\nNo SetUserIdentificationAssociation response\n"));
}
-TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue) {
- std::vector<std::string> options = {"--set-minmaxvalue", "1", "100"};
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_Int) {
+ std::vector<std::string> options = {
+ "--set-minmaxvalue", "SEAT_MEMORY_SELECT", "-a", "ROW_1_LEFT", "1", "4"};
std::vector<PropIdAreaId> changedPropIdAreaIds;
getHardware()->registerSupportedValueChangeCallback(
@@ -2776,37 +2778,124 @@
ASSERT_THAT(result.buffer, ContainsRegex("Min/Max supported value .* set"));
ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0], (PropIdAreaId{
+ .propId = toInt(VehicleProperty::SEAT_MEMORY_SELECT),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT),
+ }));
- auto results = getHardware()->getMinMaxSupportedValues({PropIdAreaId{
- .propId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY), .areaId = 0}});
+ auto results = getHardware()->getMinMaxSupportedValues({changedPropIdAreaIds[0]});
ASSERT_EQ(results.size(), 1u);
EXPECT_EQ(results[0].status, StatusCode::OK);
EXPECT_EQ(results[0].minSupportedValue.value(), RawPropValues{.int32Values = {1}});
- EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {100}});
+ EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {4}});
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_forGlobalProperty) {
+ // -a can be emitted for global property
+ std::vector<std::string> options = {"--set-minmaxvalue", "EV_BRAKE_REGENERATION_LEVEL", "1",
+ "4"};
+ std::vector<PropIdAreaId> changedPropIdAreaIds;
+
+ getHardware()->registerSupportedValueChangeCallback(
+ std::make_unique<IVehicleHardware::SupportedValueChangeCallback>(
+ [&changedPropIdAreaIds](std::vector<PropIdAreaId> propIdAreaIds) {
+ changedPropIdAreaIds = propIdAreaIds;
+ }));
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_FALSE(result.callerShouldDumpState);
+ ASSERT_THAT(result.buffer, ContainsRegex("Min/Max supported value .* set"));
+
+ ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0],
+ (PropIdAreaId{
+ .propId = toInt(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL),
+ .areaId = 0,
+ }));
+
+ auto results = getHardware()->getMinMaxSupportedValues({changedPropIdAreaIds[0]});
+
+ ASSERT_EQ(results.size(), 1u);
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ EXPECT_EQ(results[0].minSupportedValue.value(), RawPropValues{.int32Values = {1}});
+ EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {4}});
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_Float) {
+ std::vector<std::string> options = {
+ "--set-minmaxvalue", "HVAC_TEMPERATURE_SET", "-a", "ROW_1_LEFT", "-5.1", "5.1"};
+ std::vector<PropIdAreaId> changedPropIdAreaIds;
+
+ getHardware()->registerSupportedValueChangeCallback(
+ std::make_unique<IVehicleHardware::SupportedValueChangeCallback>(
+ [&changedPropIdAreaIds](std::vector<PropIdAreaId> propIdAreaIds) {
+ changedPropIdAreaIds = propIdAreaIds;
+ }));
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_FALSE(result.callerShouldDumpState);
+ ASSERT_THAT(result.buffer, ContainsRegex("Min/Max supported value .* set"));
+
+ ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0],
+ (PropIdAreaId{
+ .propId = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT),
+ }));
+
+ auto results = getHardware()->getMinMaxSupportedValues({changedPropIdAreaIds[0]});
+
+ ASSERT_EQ(results.size(), 1u);
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ EXPECT_EQ(results[0].minSupportedValue.value(), RawPropValues{.floatValues = {-5.1}});
+ EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.floatValues = {5.1}});
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_notEnoughArguments) {
+ std::vector<std::string> options = {"--set-minmaxvalue", "SEAT_MEMORY_SELECT"};
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Not enough arguments"));
+
+ options = {"--set-minmaxvalue", "SEAT_MEMORY_SELECT", "2"};
+
+ result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Not enough arguments"));
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_notEnoughArguments_missingMax) {
+ std::vector<std::string> options = {"--set-minmaxvalue", "SEAT_MEMORY_SELECT", "-a",
+ "ROW_1_LEFT", "2"};
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Not enough arguments"));
}
TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_invalidInt) {
- std::vector<std::string> options = {"--set-minmaxvalue", "abc", "100"};
+ std::vector<std::string> options = {
+ "--set-minmaxvalue", "HVAC_TEMPERATURE_SET", "-a", "ROW_1_LEFT", "abc", "100"};
DumpResult result = getHardware()->dump(options);
ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
- options = {"--set-minmaxvalue", "1", "abc"};
+ options = {"--set-minmaxvalue", "HVAC_TEMPERATURE_SET", "-a", "ROW_1_LEFT", "100", "abc"};
result = getHardware()->dump(options);
ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
}
TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_minLargerThanMax) {
- std::vector<std::string> options = {"--set-minmaxvalue", "2", "1"};
+ std::vector<std::string> options = {
+ "--set-minmaxvalue", "SEAT_MEMORY_SELECT", "-a", "ROW_1_LEFT", "2", "1"};
DumpResult result = getHardware()->dump(options);
ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
}
-TEST_F(FakeVehicleHardwareTest, testDumpSetSupportedValues) {
- std::vector<std::string> options = {"--set-supportedvalues", "1", "2", "3"};
+TEST_F(FakeVehicleHardwareTest, testDumpSetSupportedValues_Int) {
+ std::vector<std::string> options = {
+ "--set-supportedvalues", "EV_STOPPING_MODE", "-a", "0", "1", "2", "3"};
std::vector<PropIdAreaId> changedPropIdAreaIds;
getHardware()->registerSupportedValueChangeCallback(
@@ -2820,11 +2909,13 @@
ASSERT_THAT(result.buffer, ContainsRegex("Supported values list .* set"));
ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0], (PropIdAreaId{
+ .propId = toInt(VehicleProperty::EV_STOPPING_MODE),
+ .areaId = 0,
+ }));
- auto results = getHardware()->getSupportedValuesLists({PropIdAreaId{
- .propId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY), .areaId = 0}});
+ auto results = getHardware()->getSupportedValuesLists({changedPropIdAreaIds[0]});
- ASSERT_EQ(results.size(), 1u);
EXPECT_EQ(results[0].status, StatusCode::OK);
EXPECT_NE(results[0].supportedValuesList, std::nullopt);
EXPECT_EQ(results[0].supportedValuesList.value(), std::vector<std::optional<RawPropValues>>({
@@ -2834,13 +2925,108 @@
}));
}
+TEST_F(FakeVehicleHardwareTest, testDumpSetSupportedValues_forGlobalPropertySkipArea) {
+ std::vector<std::string> options = {"--set-supportedvalues", "EV_STOPPING_MODE", "1", "2", "3"};
+ std::vector<PropIdAreaId> changedPropIdAreaIds;
+
+ getHardware()->registerSupportedValueChangeCallback(
+ std::make_unique<IVehicleHardware::SupportedValueChangeCallback>(
+ [&changedPropIdAreaIds](std::vector<PropIdAreaId> propIdAreaIds) {
+ changedPropIdAreaIds = propIdAreaIds;
+ }));
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_FALSE(result.callerShouldDumpState);
+ ASSERT_THAT(result.buffer, ContainsRegex("Supported values list .* set"));
+
+ ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0], (PropIdAreaId{
+ .propId = toInt(VehicleProperty::EV_STOPPING_MODE),
+ .areaId = 0,
+ }));
+
+ auto results = getHardware()->getSupportedValuesLists({changedPropIdAreaIds[0]});
+
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ EXPECT_NE(results[0].supportedValuesList, std::nullopt);
+ EXPECT_EQ(results[0].supportedValuesList.value(), std::vector<std::optional<RawPropValues>>({
+ RawPropValues{.int32Values = {1}},
+ RawPropValues{.int32Values = {2}},
+ RawPropValues{.int32Values = {3}},
+ }));
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetSupportedValues_Float) {
+ std::vector<std::string> options = {"--set-supportedvalues",
+ "HVAC_TEMPERATURE_SET",
+ "-a",
+ "ROW_1_LEFT",
+ "1.1",
+ "2.2",
+ "3.3"};
+ std::vector<PropIdAreaId> changedPropIdAreaIds;
+
+ getHardware()->registerSupportedValueChangeCallback(
+ std::make_unique<IVehicleHardware::SupportedValueChangeCallback>(
+ [&changedPropIdAreaIds](std::vector<PropIdAreaId> propIdAreaIds) {
+ changedPropIdAreaIds = propIdAreaIds;
+ }));
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_FALSE(result.callerShouldDumpState);
+ ASSERT_THAT(result.buffer, ContainsRegex("Supported values list .* set"));
+
+ ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0],
+ (PropIdAreaId{
+ .propId = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT),
+ }));
+
+ auto results = getHardware()->getSupportedValuesLists({changedPropIdAreaIds[0]});
+
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ EXPECT_NE(results[0].supportedValuesList, std::nullopt);
+ EXPECT_EQ(results[0].supportedValuesList.value(), std::vector<std::optional<RawPropValues>>({
+ RawPropValues{.floatValues = {1.1}},
+ RawPropValues{.floatValues = {2.2}},
+ RawPropValues{.floatValues = {3.3}},
+ }));
+}
+
TEST_F(FakeVehicleHardwareTest, testDumpSetSupportedValues_invalidInt) {
- std::vector<std::string> options = {"--set-supportedvalues", "1", "2", "ab", "3"};
+ std::vector<std::string> options = {
+ "--set-supportedvalues", "EV_STOPPING_MODE", "1", "2", "ab", "3"};
DumpResult result = getHardware()->dump(options);
ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
}
+TEST_F(FakeVehicleHardwareTest, testDumpSetSupportedValues_notEnoughArguments) {
+ std::vector<std::string> options = {"--set-supportedvalues", "EV_STOPPING_MODE"};
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
+ ASSERT_THAT(result.buffer, ContainsRegex("Not enough arguments"));
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetSupportedValues_withAreaId_notEnoughArguments) {
+ std::vector<std::string> options = {"--set-supportedvalues", "EV_STOPPING_MODE", "-a", "0"};
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
+ ASSERT_THAT(result.buffer, ContainsRegex("Not enough arguments"));
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetSupportedValues_invalidAreaId) {
+ std::vector<std::string> options = {"--set-supportedvalues", "EV_STOPPING_MODE", "-a", "blah",
+ "1"};
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
+ ASSERT_THAT(result.buffer, ContainsRegex("areaId not valid"));
+}
+
struct SetPropTestCase {
std::string test_name;
std::vector<std::string> options;
@@ -3569,15 +3755,15 @@
ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe";
status = setValue({
- .prop = propSpeed,
.areaId = 0,
+ .prop = propSpeed,
.value.floatValues = {1.1f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set speed";
status = setValue({
- .prop = propSpeed,
.areaId = 0,
+ .prop = propSpeed,
.value.floatValues = {1.2f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set speed";
@@ -3604,8 +3790,8 @@
ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe";
status = setValue({
- .prop = propHvac,
.areaId = areaId,
+ .prop = propHvac,
.value.floatValues = {20.0f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
@@ -3615,8 +3801,8 @@
clearChangedProperties();
status = setValue({
- .prop = propHvac,
.areaId = areaId,
+ .prop = propHvac,
.value.floatValues = {21.0f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
@@ -3629,8 +3815,8 @@
ASSERT_EQ(status, StatusCode::OK);
status = setValue({
- .prop = propHvac,
.areaId = areaId,
+ .prop = propHvac,
.value.floatValues = {22.0f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
@@ -3655,31 +3841,31 @@
subscribe(propHvacTempValueSuggest, HVAC_ALL, /*sampleRateHz*/ 0);
VehiclePropValue floatArraySizeFour = {
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {0, CELSIUS, 0, 0},
};
StatusCode status = setValue(floatArraySizeFour);
EXPECT_EQ(status, StatusCode::OK);
VehiclePropValue floatArraySizeZero = {
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
};
status = setValue(floatArraySizeZero);
EXPECT_EQ(status, StatusCode::INVALID_ARG);
VehiclePropValue floatArraySizeFive = {
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {0, CELSIUS, 0, 0, 0},
};
status = setValue(floatArraySizeFive);
EXPECT_EQ(status, StatusCode::INVALID_ARG);
VehiclePropValue invalidUnit = {
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {0, 0, 0, 0},
};
status = setValue(invalidUnit);
@@ -3709,16 +3895,16 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius, CELSIUS, 0, 0},
},
},
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius, CELSIUS,
minTempInCelsius,
minTempInFahrenheit},
@@ -3730,8 +3916,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit, FAHRENHEIT,
0, 0},
},
@@ -3739,8 +3925,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit, FAHRENHEIT,
minTempInCelsius,
minTempInFahrenheit},
@@ -3752,16 +3938,16 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInCelsius, CELSIUS, 0, 0},
},
},
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInCelsius, CELSIUS,
maxTempInCelsius,
maxTempInFahrenheit},
@@ -3773,8 +3959,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInFahrenheit, FAHRENHEIT,
0, 0},
},
@@ -3782,8 +3968,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInFahrenheit, FAHRENHEIT,
maxTempInCelsius,
maxTempInFahrenheit},
@@ -3795,8 +3981,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius - 1, CELSIUS, 0,
0},
},
@@ -3804,8 +3990,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius - 1, CELSIUS,
minTempInCelsius,
minTempInFahrenheit},
@@ -3817,8 +4003,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit - 1,
FAHRENHEIT, 0, 0},
},
@@ -3826,8 +4012,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit - 1,
FAHRENHEIT, minTempInCelsius,
minTempInFahrenheit},
@@ -3839,8 +4025,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInCelsius + 1, CELSIUS, 0,
0},
},
@@ -3848,8 +4034,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInCelsius + 1, CELSIUS,
maxTempInCelsius,
maxTempInFahrenheit},
@@ -3861,8 +4047,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInFahrenheit + 1,
FAHRENHEIT, 0, 0},
},
@@ -3870,8 +4056,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInFahrenheit + 1,
FAHRENHEIT, maxTempInCelsius,
maxTempInFahrenheit},
@@ -3883,8 +4069,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius +
incrementInCelsius * 2.5f,
CELSIUS, 0, 0},
@@ -3893,8 +4079,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues =
{minTempInCelsius + incrementInCelsius * 2.5f,
CELSIUS,
@@ -3909,8 +4095,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit +
incrementInFahrenheit *
2.5f,
@@ -3920,8 +4106,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues =
{minTempInFahrenheit +
incrementInFahrenheit * 2.5f,
@@ -3968,9 +4154,10 @@
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},
+ PropIdAreaId{.propId = toInt(VehicleProperty::SEAT_MEMORY_SELECT),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT)},
+ // This property does not specify min/max value
+ PropIdAreaId{.propId = toInt(VehicleProperty::EV_BATTERY_DISPLAY_UNITS), .areaId = 0},
});
ASSERT_EQ(results.size(), 2u);
@@ -3978,32 +4165,39 @@
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[0].maxSupportedValue.value(), RawPropValues{.int32Values = {3}});
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},
+ .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)},
+ // This property does not specify supported values list.
+ PropIdAreaId{.propId = toInt(VehicleProperty::INFO_EV_BATTERY_CAPACITY), .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[0].supportedValuesList.value(),
+ std::vector<std::optional<RawPropValues>>({RawPropValues{.int32Values = {1}},
+ RawPropValues{.int32Values = {2}},
+ RawPropValues{.int32Values = {3}}}));
EXPECT_EQ(results[1].status, StatusCode::INVALID_ARG);
}
+TEST_F(FakeVehicleHardwareTest, testGetSupportedValuesLists_populateFromSupportedEnumValues) {
+ auto results = getHardware()->getSupportedValuesLists({PropIdAreaId{
+ .propId = toInt(VehicleProperty::FORWARD_COLLISION_WARNING_STATE), .areaId = 0}});
+
+ ASSERT_EQ(results.size(), 1u);
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ ASSERT_NE(results[0].supportedValuesList, std::nullopt);
+ ASSERT_THAT(results[0].supportedValuesList.value(), ::testing::Not(::testing::IsEmpty()));
+}
+
} // namespace fake
} // namespace vehicle
} // namespace automotive
diff --git a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.cpp b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.cpp
index 8750375..e64c696 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.cpp
@@ -29,19 +29,45 @@
namespace android::hardware::automotive::vehicle::virtualization {
+using ::grpc::ChannelCredentials;
+using ::grpc::ClientContext;
+using ::grpc::CreateChannel;
+using ::grpc::InsecureChannelCredentials;
+using ::grpc::Status;
+
namespace {
constexpr size_t MAX_RETRY_COUNT = 5;
-std::shared_ptr<::grpc::ChannelCredentials> getChannelCredentials() {
- return ::grpc::InsecureChannelCredentials();
+std::shared_ptr<ChannelCredentials> getChannelCredentials() {
+ return InsecureChannelCredentials();
+}
+
+template <class ProtoRequestType>
+void fillPropIdAreaIdsToProtoRequest(const std::vector<PropIdAreaId>& propIdAreaIds,
+ ProtoRequestType* protoRequest) {
+ for (const auto& propIdAreaId : propIdAreaIds) {
+ proto_msg_converter::aidlToProto(propIdAreaId, protoRequest->add_prop_id_area_id());
+ }
+}
+
+template <class AidlResultType, class ProtoResultType>
+std::vector<AidlResultType> convertSupportedValueProtoResultToAidlResults(
+ const std::vector<PropIdAreaId>& propIdAreaIds, const ProtoResultType& protoResult) {
+ std::vector<AidlResultType> aidlResults;
+ for (const auto& protoResultPerRequest : protoResult.result()) {
+ AidlResultType aidlResult = {};
+ proto_msg_converter::protoToAidl(protoResultPerRequest, &aidlResult);
+ aidlResults.push_back(std::move(aidlResult));
+ }
+ return aidlResults;
}
} // namespace
GRPCVehicleHardware::GRPCVehicleHardware(std::string service_addr)
: mServiceAddr(std::move(service_addr)),
- mGrpcChannel(::grpc::CreateChannel(mServiceAddr, getChannelCredentials())),
+ mGrpcChannel(CreateChannel(mServiceAddr, getChannelCredentials())),
mGrpcStub(proto::VehicleServer::NewStub(mGrpcChannel)),
mValuePollingThread([this] { ValuePollingLoop(); }) {}
@@ -67,7 +93,7 @@
std::vector<aidlvhal::VehiclePropConfig> GRPCVehicleHardware::getAllPropertyConfigs() const {
std::vector<aidlvhal::VehiclePropConfig> configs;
- ::grpc::ClientContext context;
+ ClientContext context;
auto config_stream = mGrpcStub->GetAllPropertyConfig(&context, ::google::protobuf::Empty());
proto::VehiclePropConfig protoConfig;
while (config_stream->Read(&protoConfig)) {
@@ -97,7 +123,7 @@
aidlvhal::StatusCode GRPCVehicleHardware::setValues(
std::shared_ptr<const SetValuesCallback> callback,
const std::vector<aidlvhal::SetValueRequest>& requests) {
- ::grpc::ClientContext context;
+ ClientContext context;
proto::VehiclePropValueRequests protoRequests;
proto::SetValueResults protoResults;
for (const auto& request : requests) {
@@ -160,7 +186,7 @@
}
// TODO(chenhaosjtuacm): Make it Async.
- ::grpc::ClientContext context;
+ ClientContext context;
proto::GetValueResults protoResults;
auto grpc_status = mGrpcStub->GetValues(&context, protoRequests, &protoResults);
if (!grpc_status.ok()) {
@@ -262,7 +288,7 @@
}
DumpResult GRPCVehicleHardware::dump(const std::vector<std::string>& options) {
- ::grpc::ClientContext context;
+ ClientContext context;
proto::DumpOptions protoDumpOptions;
proto::DumpResult protoDumpResult;
for (const auto& option : options) {
@@ -281,7 +307,7 @@
}
aidlvhal::StatusCode GRPCVehicleHardware::checkHealth() {
- ::grpc::ClientContext context;
+ ClientContext context;
proto::VehicleHalCallStatus protoStatus;
auto grpc_status = mGrpcStub->CheckHealth(&context, ::google::protobuf::Empty(), &protoStatus);
if (!grpc_status.ok()) {
@@ -293,7 +319,7 @@
aidlvhal::StatusCode GRPCVehicleHardware::subscribe(aidlvhal::SubscribeOptions options) {
proto::SubscribeRequest request;
- ::grpc::ClientContext context;
+ ClientContext context;
proto::VehicleHalCallStatus protoStatus;
proto_msg_converter::aidlToProto(options, request.mutable_options());
auto grpc_status = mGrpcStub->Subscribe(&context, request, &protoStatus);
@@ -311,7 +337,7 @@
aidlvhal::StatusCode GRPCVehicleHardware::unsubscribe(int32_t propId, int32_t areaId) {
proto::UnsubscribeRequest request;
- ::grpc::ClientContext context;
+ ClientContext context;
proto::VehicleHalCallStatus protoStatus;
request.set_prop_id(propId);
request.set_area_id(areaId);
@@ -330,7 +356,7 @@
aidlvhal::StatusCode GRPCVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId,
float sampleRate) {
- ::grpc::ClientContext context;
+ ClientContext context;
proto::UpdateSampleRateRequest request;
proto::VehicleHalCallStatus protoStatus;
request.set_prop(propId);
@@ -357,7 +383,7 @@
}
void GRPCVehicleHardware::pollValue() {
- ::grpc::ClientContext context;
+ ClientContext context;
bool rpc_stopped{false};
std::thread shuttingdown_watcher([this, &rpc_stopped, &context]() {
@@ -408,4 +434,56 @@
LOG(ERROR) << __func__ << ": GRPC Value Streaming Failed: " << grpc_status.error_message();
}
+std::vector<aidlvhal::MinMaxSupportedValueResult> GRPCVehicleHardware::getMinMaxSupportedValues(
+ const std::vector<PropIdAreaId>& propIdAreaIds) {
+ ClientContext context;
+ proto::GetMinMaxSupportedValuesRequest protoRequest = {};
+ proto::GetMinMaxSupportedValuesResult protoResult = {};
+ fillPropIdAreaIdsToProtoRequest(propIdAreaIds, &protoRequest);
+
+ auto grpc_status = mGrpcStub->GetMinMaxSupportedValues(&context, protoRequest, &protoResult);
+ std::vector<aidlvhal::MinMaxSupportedValueResult> aidlResults;
+ if (!grpc_status.ok()) {
+ LOG(ERROR) << __func__
+ << ": GRPC GetMinMaxSupportedValues Failed: " << grpc_status.error_message();
+ for (const auto& propIdAreaId : propIdAreaIds) {
+ aidlResults.push_back({
+ .status = aidlvhal::StatusCode::INTERNAL_ERROR,
+ });
+ }
+ return aidlResults;
+ }
+ aidlResults =
+ convertSupportedValueProtoResultToAidlResults<aidlvhal::MinMaxSupportedValueResult,
+ proto::GetMinMaxSupportedValuesResult>(
+ propIdAreaIds, protoResult);
+ return aidlResults;
+}
+
+std::vector<aidlvhal::SupportedValuesListResult> GRPCVehicleHardware::getSupportedValuesLists(
+ const std::vector<PropIdAreaId>& propIdAreaIds) {
+ ClientContext context;
+ proto::GetSupportedValuesListsRequest protoRequest = {};
+ proto::GetSupportedValuesListsResult protoResult = {};
+ fillPropIdAreaIdsToProtoRequest(propIdAreaIds, &protoRequest);
+
+ auto grpc_status = mGrpcStub->GetSupportedValuesLists(&context, protoRequest, &protoResult);
+ std::vector<aidlvhal::SupportedValuesListResult> aidlResults;
+ if (!grpc_status.ok()) {
+ LOG(ERROR) << __func__
+ << ": GRPC GetSupportedValuesLists Failed: " << grpc_status.error_message();
+ for (const auto& propIdAreaId : propIdAreaIds) {
+ aidlResults.push_back({
+ .status = aidlvhal::StatusCode::INTERNAL_ERROR,
+ });
+ }
+ return aidlResults;
+ }
+ aidlResults =
+ convertSupportedValueProtoResultToAidlResults<aidlvhal::SupportedValuesListResult,
+ proto::GetSupportedValuesListsResult>(
+ propIdAreaIds, protoResult);
+ return aidlResults;
+}
+
} // namespace android::hardware::automotive::vehicle::virtualization
diff --git a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.h b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.h
index ad2f512..7fc3d79 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.h
@@ -90,6 +90,12 @@
aidlvhal::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;
+
bool waitForConnected(std::chrono::milliseconds waitTime);
protected:
diff --git a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.cpp b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.cpp
index 927a595..f216683 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.cpp
@@ -31,13 +31,33 @@
namespace android::hardware::automotive::vehicle::virtualization {
-std::atomic<uint64_t> GrpcVehicleProxyServer::ConnectionDescriptor::connection_id_counter_{0};
-
-static std::shared_ptr<::grpc::ServerCredentials> getServerCredentials() {
- // TODO(chenhaosjtuacm): get secured credentials here
+namespace {
+std::shared_ptr<::grpc::ServerCredentials> getServerCredentials() {
return ::grpc::InsecureServerCredentials();
}
+template <class ProtoRequestType>
+std::vector<PropIdAreaId> getPropIdAreaIdsFromProtoRequest(const ProtoRequestType* request) {
+ std::vector<PropIdAreaId> propIdAreaIds;
+ for (const proto::PropIdAreaId& protoPropIdAreaId : request->prop_id_area_id()) {
+ PropIdAreaId aidlPropIdAreaId = {};
+ proto_msg_converter::protoToAidl(protoPropIdAreaId, &aidlPropIdAreaId);
+ propIdAreaIds.push_back(aidlPropIdAreaId);
+ }
+ return propIdAreaIds;
+}
+
+template <class AidlResultType, class ProtoResultType>
+void aidlResultsToProtoResults(const AidlResultType& aidlResults, ProtoResultType* result) {
+ for (const auto& aidlResult : aidlResults) {
+ auto* protoResult = result->add_result();
+ proto_msg_converter::aidlToProto(aidlResult, protoResult);
+ }
+}
+} // namespace
+
+std::atomic<uint64_t> GrpcVehicleProxyServer::ConnectionDescriptor::connection_id_counter_{0};
+
GrpcVehicleProxyServer::GrpcVehicleProxyServer(std::string serverAddr,
std::unique_ptr<IVehicleHardware>&& hardware)
: GrpcVehicleProxyServer(std::vector<std::string>({serverAddr}), std::move(hardware)) {};
@@ -243,6 +263,26 @@
return ::grpc::Status(::grpc::StatusCode::ABORTED, "Connection lost.");
}
+::grpc::Status GrpcVehicleProxyServer::GetMinMaxSupportedValues(
+ ::grpc::ServerContext* context, const proto::GetMinMaxSupportedValuesRequest* request,
+ proto::GetMinMaxSupportedValuesResult* result) {
+ std::vector<PropIdAreaId> propIdAreaIds = getPropIdAreaIdsFromProtoRequest(request);
+ std::vector<aidlvhal::MinMaxSupportedValueResult> minMaxSupportedValueResults =
+ mHardware->getMinMaxSupportedValues(propIdAreaIds);
+ aidlResultsToProtoResults(minMaxSupportedValueResults, result);
+ return ::grpc::Status::OK;
+}
+
+::grpc::Status GrpcVehicleProxyServer::GetSupportedValuesLists(
+ ::grpc::ServerContext* context, const proto::GetSupportedValuesListsRequest* request,
+ proto::GetSupportedValuesListsResult* result) {
+ std::vector<PropIdAreaId> propIdAreaIds = getPropIdAreaIdsFromProtoRequest(request);
+ std::vector<aidlvhal::SupportedValuesListResult> supportedValuesListResults =
+ mHardware->getSupportedValuesLists(propIdAreaIds);
+ aidlResultsToProtoResults(supportedValuesListResults, result);
+ return ::grpc::Status::OK;
+}
+
void GrpcVehicleProxyServer::OnVehiclePropChange(
const std::vector<aidlvhal::VehiclePropValue>& values) {
std::unordered_set<uint64_t> brokenConn;
diff --git a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.h b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.h
index 5ffb531..eb261ca 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.h
+++ b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.h
@@ -77,6 +77,14 @@
::grpc::ServerContext* context, const ::google::protobuf::Empty* request,
::grpc::ServerWriter<proto::VehiclePropValues>* stream) override;
+ ::grpc::Status GetMinMaxSupportedValues(
+ ::grpc::ServerContext* context, const proto::GetMinMaxSupportedValuesRequest* requests,
+ proto::GetMinMaxSupportedValuesResult* results) override;
+
+ ::grpc::Status GetSupportedValuesLists(::grpc::ServerContext* context,
+ const proto::GetSupportedValuesListsRequest* requests,
+ proto::GetSupportedValuesListsResult* results) override;
+
GrpcVehicleProxyServer& Start();
GrpcVehicleProxyServer& Shutdown();
diff --git a/automotive/vehicle/aidl/impl/current/grpc/proto/VehicleServer.proto b/automotive/vehicle/aidl/impl/current/grpc/proto/VehicleServer.proto
index 732957f..3364ed7 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/proto/VehicleServer.proto
+++ b/automotive/vehicle/aidl/impl/current/grpc/proto/VehicleServer.proto
@@ -20,6 +20,8 @@
import "android/hardware/automotive/vehicle/DumpOptions.proto";
import "android/hardware/automotive/vehicle/DumpResult.proto";
+import "android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.proto";
+import "android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.proto";
import "android/hardware/automotive/vehicle/SubscribeRequest.proto";
import "android/hardware/automotive/vehicle/StatusCode.proto";
import "android/hardware/automotive/vehicle/UnsubscribeRequest.proto";
@@ -46,4 +48,10 @@
rpc Subscribe(SubscribeRequest) returns (VehicleHalCallStatus) {}
rpc Unsubscribe(UnsubscribeRequest) returns (VehicleHalCallStatus) {}
+
+ rpc GetMinMaxSupportedValues(GetMinMaxSupportedValuesRequest)
+ returns (GetMinMaxSupportedValuesResult) {}
+
+ rpc GetSupportedValuesLists(GetSupportedValuesListsRequest)
+ returns (GetSupportedValuesListsResult) {}
}
diff --git a/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleHardwareUnitTest.cpp b/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleHardwareUnitTest.cpp
index 20af231..343e5b2 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleHardwareUnitTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleHardwareUnitTest.cpp
@@ -442,4 +442,119 @@
EXPECT_LT(gotResults[0].prop->timestamp, elapsedRealtimeNano());
}
+TEST_F(GRPCVehicleHardwareUnitTest, testGetMinMaxSupportedValues) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ int32_t testValue2 = 123456;
+ std::vector<PropIdAreaId> propIdAreaIds = {{.propId = testPropId, .areaId = testAreaId}};
+
+ EXPECT_CALL(*mGrpcStub, GetMinMaxSupportedValues(_, _, _))
+ .WillOnce([=](::grpc::ClientContext* context,
+ const proto::GetMinMaxSupportedValuesRequest& request,
+ proto::GetMinMaxSupportedValuesResult* response) {
+ for (const auto& propIdAreaId : request.prop_id_area_id()) {
+ proto::MinMaxSupportedValueResult* individualResult = response->add_result();
+ individualResult->set_status(proto::StatusCode::OK);
+ individualResult->mutable_min_supported_value()->add_int32_values(testValue1);
+ individualResult->mutable_max_supported_value()->add_int32_values(testValue2);
+ }
+ return ::grpc::Status::OK;
+ });
+
+ auto results = mHardware->getMinMaxSupportedValues(propIdAreaIds);
+
+ ASSERT_THAT(results, ::testing::SizeIs(1));
+ EXPECT_EQ(results[0].status, aidlvhal::StatusCode::OK);
+ ASSERT_TRUE(results[0].minSupportedValue.has_value());
+ EXPECT_EQ(results[0].minSupportedValue.value(),
+ aidlvhal::RawPropValues{.int32Values = {testValue1}});
+ ASSERT_TRUE(results[0].maxSupportedValue.has_value());
+ EXPECT_EQ(results[0].maxSupportedValue.value(),
+ aidlvhal::RawPropValues{.int32Values = {testValue2}});
+}
+
+TEST_F(GRPCVehicleHardwareUnitTest, testGetMinMaxSupportedValues_noMaxValue) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ std::vector<PropIdAreaId> propIdAreaIds = {{.propId = testPropId, .areaId = testAreaId}};
+
+ EXPECT_CALL(*mGrpcStub, GetMinMaxSupportedValues(_, _, _))
+ .WillOnce([=](::grpc::ClientContext* context,
+ const proto::GetMinMaxSupportedValuesRequest& request,
+ proto::GetMinMaxSupportedValuesResult* response) {
+ for (const auto& propIdAreaId : request.prop_id_area_id()) {
+ proto::MinMaxSupportedValueResult* individualResult = response->add_result();
+ individualResult->set_status(proto::StatusCode::OK);
+ individualResult->mutable_min_supported_value()->add_int32_values(testValue1);
+ }
+ return ::grpc::Status::OK;
+ });
+
+ auto results = mHardware->getMinMaxSupportedValues(propIdAreaIds);
+
+ ASSERT_THAT(results, ::testing::SizeIs(1));
+ EXPECT_EQ(results[0].status, aidlvhal::StatusCode::OK);
+ ASSERT_TRUE(results[0].minSupportedValue.has_value());
+ EXPECT_EQ(results[0].minSupportedValue.value(),
+ aidlvhal::RawPropValues{.int32Values = {testValue1}});
+ ASSERT_FALSE(results[0].maxSupportedValue.has_value());
+}
+
+TEST_F(GRPCVehicleHardwareUnitTest, testGetSupportedValuesLists) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ int32_t testValue2 = 123456;
+ std::vector<PropIdAreaId> propIdAreaIds = {{.propId = testPropId, .areaId = testAreaId}};
+
+ EXPECT_CALL(*mGrpcStub, GetSupportedValuesLists(_, _, _))
+ .WillOnce([=](::grpc::ClientContext* context,
+ const proto::GetSupportedValuesListsRequest& request,
+ proto::GetSupportedValuesListsResult* response) {
+ for (const auto& propIdAreaId : request.prop_id_area_id()) {
+ proto::SupportedValuesListResult* individualResult = response->add_result();
+ individualResult->set_status(proto::StatusCode::OK);
+ individualResult->add_supported_values_list()->add_int32_values(testValue1);
+ individualResult->add_supported_values_list()->add_int32_values(testValue2);
+ }
+ return ::grpc::Status::OK;
+ });
+
+ auto results = mHardware->getSupportedValuesLists(propIdAreaIds);
+
+ ASSERT_THAT(results, ::testing::SizeIs(1));
+ EXPECT_EQ(results[0].status, aidlvhal::StatusCode::OK);
+ ASSERT_TRUE(results[0].supportedValuesList.has_value());
+ ASSERT_THAT(results[0].supportedValuesList.value(), ::testing::SizeIs(2));
+ EXPECT_EQ(results[0].supportedValuesList.value()[0],
+ aidlvhal::RawPropValues{.int32Values = {testValue1}});
+ EXPECT_EQ(results[0].supportedValuesList.value()[1],
+ aidlvhal::RawPropValues{.int32Values = {testValue2}});
+}
+
+TEST_F(GRPCVehicleHardwareUnitTest, testGetSupportedValuesLists_noSupportedValue) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ std::vector<PropIdAreaId> propIdAreaIds = {{.propId = testPropId, .areaId = testAreaId}};
+
+ EXPECT_CALL(*mGrpcStub, GetSupportedValuesLists(_, _, _))
+ .WillOnce([=](::grpc::ClientContext* context,
+ const proto::GetSupportedValuesListsRequest& request,
+ proto::GetSupportedValuesListsResult* response) {
+ for (const auto& propIdAreaId : request.prop_id_area_id()) {
+ proto::SupportedValuesListResult* individualResult = response->add_result();
+ individualResult->set_status(proto::StatusCode::INTERNAL_ERROR);
+ }
+ return ::grpc::Status::OK;
+ });
+
+ auto results = mHardware->getSupportedValuesLists(propIdAreaIds);
+
+ ASSERT_THAT(results, ::testing::SizeIs(1));
+ EXPECT_EQ(results[0].status, aidlvhal::StatusCode::INTERNAL_ERROR);
+ ASSERT_FALSE(results[0].supportedValuesList.has_value());
+}
+
} // namespace android::hardware::automotive::vehicle::virtualization
diff --git a/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleProxyServerUnitTest.cpp b/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleProxyServerUnitTest.cpp
index ca5c2d5..c07c629 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleProxyServerUnitTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleProxyServerUnitTest.cpp
@@ -105,6 +105,10 @@
MOCK_METHOD(aidlvhal::StatusCode, unsubscribe, (int32_t propId, int32_t areaId), (override));
MOCK_METHOD(aidlvhal::StatusCode, updateSampleRate,
(int32_t propId, int32_t areaId, float sampleRate), (override));
+ MOCK_METHOD(std::vector<aidlvhal::MinMaxSupportedValueResult>, getMinMaxSupportedValues,
+ (const std::vector<PropIdAreaId>& propIdAreaIds), (override));
+ MOCK_METHOD(std::vector<aidlvhal::SupportedValuesListResult>, getSupportedValuesLists,
+ (const std::vector<PropIdAreaId>& propIdAreaIds), (override));
};
TEST(GRPCVehicleProxyServerUnitTest, ClientConnectDisconnect) {
@@ -117,7 +121,7 @@
constexpr auto kWaitForConnectionMaxTime = std::chrono::seconds(5);
constexpr auto kWaitForStreamStartTime = std::chrono::seconds(1);
- constexpr auto kWaitForUpdateDeliveryTime = std::chrono::milliseconds(100);
+ constexpr auto kWaitForUpdateDeliveryTime = std::chrono::seconds(1);
auto updateReceived1 = std::make_shared<bool>(false);
auto vehicleHardware1 = std::make_unique<GRPCVehicleHardware>(kFakeServerAddr);
@@ -129,7 +133,7 @@
// Client hardware 1 received update from the server.
EXPECT_FALSE(*updateReceived1);
- testHardwareRaw->onPropertyEvent({});
+ testHardwareRaw->onPropertyEvent({aidlvhal::VehiclePropValue{.prop = 1}});
// Wait for the update delivery.
std::this_thread::sleep_for(kWaitForUpdateDeliveryTime);
EXPECT_TRUE(*updateReceived1);
@@ -148,7 +152,7 @@
// Both client hardware 1 and 2 received update from the server.
EXPECT_FALSE(*updateReceived1);
EXPECT_FALSE(*updateReceived2);
- testHardwareRaw->onPropertyEvent({});
+ testHardwareRaw->onPropertyEvent({aidlvhal::VehiclePropValue{.prop = 1}});
// Wait for the update delivery.
std::this_thread::sleep_for(kWaitForUpdateDeliveryTime);
EXPECT_TRUE(*updateReceived1);
@@ -163,7 +167,7 @@
// Client 1 exited, only client hardware 2 received update from the server.
EXPECT_FALSE(*updateReceived1);
EXPECT_FALSE(*updateReceived2);
- testHardwareRaw->onPropertyEvent({});
+ testHardwareRaw->onPropertyEvent({aidlvhal::VehiclePropValue{.prop = 1}});
// Wait for the update delivery.
std::this_thread::sleep_for(kWaitForUpdateDeliveryTime);
EXPECT_FALSE(*updateReceived1);
@@ -238,4 +242,85 @@
EXPECT_EQ(returnStatus.status_code(), proto::StatusCode::OK);
}
+TEST(GRPCVehicleProxyServerUnitTest, testGetMinMaxSupportedValues) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ int32_t testValue2 = 54321;
+ auto mockHardware = std::make_unique<MockVehicleHardware>();
+ // We make sure this is alive inside the function scope.
+ MockVehicleHardware* mockHardwarePtr = mockHardware.get();
+ GrpcVehicleProxyServer server = GrpcVehicleProxyServer("", std::move(mockHardware));
+ ::grpc::ServerContext context;
+ proto::GetMinMaxSupportedValuesRequest request;
+ proto::GetMinMaxSupportedValuesResult result;
+ auto* requestPropIdAreaId = request.add_prop_id_area_id();
+ requestPropIdAreaId->set_prop_id(testPropId);
+ requestPropIdAreaId->set_area_id(testAreaId);
+ std::vector<PropIdAreaId> propIdAreaIds;
+ std::vector<aidlvhal::MinMaxSupportedValueResult> resultFromHardware = {{
+ .status = aidlvhal::StatusCode::OK,
+ .minSupportedValue = aidlvhal::RawPropValues{.int32Values = {testValue1}},
+ .maxSupportedValue = aidlvhal::RawPropValues{.int32Values = {testValue2}},
+ }};
+
+ EXPECT_CALL(*mockHardwarePtr, getMinMaxSupportedValues(_))
+ .WillOnce(DoAll(SaveArg<0>(&propIdAreaIds), Return(resultFromHardware)));
+
+ auto grpcStatus = server.GetMinMaxSupportedValues(&context, &request, &result);
+
+ ASSERT_THAT(propIdAreaIds, ::testing::SizeIs(1));
+ EXPECT_EQ(propIdAreaIds[0], PropIdAreaId({.propId = testPropId, .areaId = testAreaId}));
+
+ ASSERT_TRUE(grpcStatus.ok());
+ ASSERT_THAT(result.result(), ::testing::SizeIs(1));
+ EXPECT_EQ(result.result()[0].status(), proto::StatusCode::OK);
+ ASSERT_THAT(result.result()[0].min_supported_value().int32_values(), ::testing::SizeIs(1));
+ EXPECT_EQ(result.result()[0].min_supported_value().int32_values()[0], testValue1);
+ ASSERT_THAT(result.result()[0].max_supported_value().int32_values(), ::testing::SizeIs(1));
+ EXPECT_EQ(result.result()[0].max_supported_value().int32_values()[0], testValue2);
+}
+
+TEST(GRPCVehicleProxyServerUnitTest, testGetSupportedValuesLists) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ int32_t testValue2 = 54321;
+ auto mockHardware = std::make_unique<MockVehicleHardware>();
+ // We make sure this is alive inside the function scope.
+ MockVehicleHardware* mockHardwarePtr = mockHardware.get();
+ GrpcVehicleProxyServer server = GrpcVehicleProxyServer("", std::move(mockHardware));
+ ::grpc::ServerContext context;
+ proto::GetSupportedValuesListsRequest request;
+ proto::GetSupportedValuesListsResult result;
+ auto* requestPropIdAreaId = request.add_prop_id_area_id();
+ requestPropIdAreaId->set_prop_id(testPropId);
+ requestPropIdAreaId->set_area_id(testAreaId);
+ std::vector<PropIdAreaId> propIdAreaIds;
+ std::vector<aidlvhal::SupportedValuesListResult> resultFromHardware = {{
+ .status = aidlvhal::StatusCode::OK,
+ .supportedValuesList = std::vector<std::optional<aidlvhal::RawPropValues>>({
+ aidlvhal::RawPropValues{.int32Values = {testValue1}},
+ aidlvhal::RawPropValues{.int32Values = {testValue2}},
+ }),
+ }};
+
+ EXPECT_CALL(*mockHardwarePtr, getSupportedValuesLists(_))
+ .WillOnce(DoAll(SaveArg<0>(&propIdAreaIds), Return(resultFromHardware)));
+
+ auto grpcStatus = server.GetSupportedValuesLists(&context, &request, &result);
+
+ ASSERT_THAT(propIdAreaIds, ::testing::SizeIs(1));
+ EXPECT_EQ(propIdAreaIds[0], PropIdAreaId({.propId = testPropId, .areaId = testAreaId}));
+
+ ASSERT_TRUE(grpcStatus.ok());
+ ASSERT_THAT(result.result(), ::testing::SizeIs(1));
+ EXPECT_EQ(result.result()[0].status(), proto::StatusCode::OK);
+ ASSERT_THAT(result.result()[0].supported_values_list(), ::testing::SizeIs(2));
+ ASSERT_THAT(result.result()[0].supported_values_list()[0].int32_values(), ::testing::SizeIs(1));
+ EXPECT_THAT(result.result()[0].supported_values_list()[0].int32_values()[0], testValue1);
+ ASSERT_THAT(result.result()[0].supported_values_list()[1].int32_values(), ::testing::SizeIs(1));
+ EXPECT_THAT(result.result()[0].supported_values_list()[1].int32_values()[0], testValue2);
+}
+
} // namespace android::hardware::automotive::vehicle::virtualization
diff --git a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h
index 25c07ef..1cac067 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h
+++ b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h
@@ -18,6 +18,11 @@
#define android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_
#include <VehicleHalTypes.h>
+#include <VehicleUtils.h>
+#include <android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.pb.h>
+#include <android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.pb.h>
+#include <android/hardware/automotive/vehicle/PropIdAreaId.pb.h>
+#include <android/hardware/automotive/vehicle/RawPropValues.pb.h>
#include <android/hardware/automotive/vehicle/SubscribeOptions.pb.h>
#include <android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h>
#include <android/hardware/automotive/vehicle/VehiclePropConfig.pb.h>
@@ -53,6 +58,34 @@
// Convert Protobuf SubscribeOptions to AIDL SubscribeOptions.
void protoToAidl(const ::android::hardware::automotive::vehicle::proto::SubscribeOptions& in,
::aidl::android::hardware::automotive::vehicle::SubscribeOptions* out);
+// Convert VehicleUtils PropIdAreaId to Protobuf PropIdAreaId.
+void aidlToProto(const PropIdAreaId& in,
+ ::android::hardware::automotive::vehicle::proto::PropIdAreaId* out);
+// Convert Protobuf PropIdAreaId to VehicleUtils PropIdAreaId.
+void protoToAidl(const ::android::hardware::automotive::vehicle::proto::PropIdAreaId& in,
+ PropIdAreaId* out);
+// Convert AIDL RawPropValues to Protobuf RawPropValues.
+void aidlToProto(const ::aidl::android::hardware::automotive::vehicle::RawPropValues& in,
+ ::android::hardware::automotive::vehicle::proto::RawPropValues* out);
+// Convert Protobuf RawPropValues to AIDL RawPropValues.
+void protoToAidl(const ::android::hardware::automotive::vehicle::proto::RawPropValues& in,
+ ::aidl::android::hardware::automotive::vehicle::RawPropValues* out);
+// Convert AIDL MinMaxSupportedValueResult to Protobuf MinMaxSupportedValueResult.
+void aidlToProto(
+ const ::aidl::android::hardware::automotive::vehicle::MinMaxSupportedValueResult& in,
+ ::android::hardware::automotive::vehicle::proto::MinMaxSupportedValueResult* out);
+// Convert Protobuf MinMaxSupportedValueResult to AIDL MinMaxSupportedValueResult.
+void protoToAidl(
+ const ::android::hardware::automotive::vehicle::proto::MinMaxSupportedValueResult& in,
+ ::aidl::android::hardware::automotive::vehicle::MinMaxSupportedValueResult* out);
+// Convert AIDL SupportedValuesListResult to Protobuf SupportedValuesListResult.
+void aidlToProto(
+ const ::aidl::android::hardware::automotive::vehicle::SupportedValuesListResult& in,
+ ::android::hardware::automotive::vehicle::proto::SupportedValuesListResult* out);
+// Convert Protobuf SupportedValuesListResult to AIDL SupportedValuesListResult.
+void protoToAidl(
+ const ::android::hardware::automotive::vehicle::proto::SupportedValuesListResult& in,
+ ::aidl::android::hardware::automotive::vehicle::SupportedValuesListResult* out);
} // namespace proto_msg_converter
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
index c40004a..bb16da4 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
@@ -80,6 +80,17 @@
}
}
protoACfg->set_support_variable_update_rate(areaConfig.supportVariableUpdateRate);
+ if (areaConfig.hasSupportedValueInfo.has_value()) {
+ // Creates the has_supported_value_info field.
+ proto::HasSupportedValueInfo* hasSupportedValueInfoProto =
+ protoACfg->mutable_has_supported_value_info();
+ hasSupportedValueInfoProto->set_has_min_supported_value(
+ areaConfig.hasSupportedValueInfo->hasMinSupportedValue);
+ hasSupportedValueInfoProto->set_has_max_supported_value(
+ areaConfig.hasSupportedValueInfo->hasMaxSupportedValue);
+ hasSupportedValueInfoProto->set_has_supported_values_list(
+ areaConfig.hasSupportedValueInfo->hasSupportedValuesList);
+ }
}
}
@@ -96,13 +107,13 @@
auto cast_to_acfg = [](const proto::VehicleAreaConfig& protoAcfg) {
auto vehicleAreaConfig = aidl_vehicle::VehicleAreaConfig{
.areaId = protoAcfg.area_id(),
- .access = static_cast<aidl_vehicle::VehiclePropertyAccess>(protoAcfg.access()),
.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(),
+ .access = static_cast<aidl_vehicle::VehiclePropertyAccess>(protoAcfg.access()),
.supportVariableUpdateRate = protoAcfg.support_variable_update_rate(),
};
if (protoAcfg.supported_enum_values().size() != 0) {
@@ -110,6 +121,16 @@
COPY_PROTOBUF_VEC_TO_VHAL_TYPE(protoAcfg, supported_enum_values, (&vehicleAreaConfig),
supportedEnumValues.value());
}
+ if (protoAcfg.has_has_supported_value_info()) {
+ aidl_vehicle::HasSupportedValueInfo hasSupportedValueInfo = {};
+ hasSupportedValueInfo.hasMinSupportedValue =
+ protoAcfg.has_supported_value_info().has_min_supported_value();
+ hasSupportedValueInfo.hasMaxSupportedValue =
+ protoAcfg.has_supported_value_info().has_max_supported_value();
+ hasSupportedValueInfo.hasSupportedValuesList =
+ protoAcfg.has_supported_value_info().has_supported_values_list();
+ vehicleAreaConfig.hasSupportedValueInfo = hasSupportedValueInfo;
+ }
return vehicleAreaConfig;
};
@@ -170,6 +191,94 @@
out->enableVariableUpdateRate = in.enable_variable_update_rate();
}
+void aidlToProto(const PropIdAreaId& in, proto::PropIdAreaId* out) {
+ out->set_prop_id(in.propId);
+ out->set_area_id(in.areaId);
+}
+
+void protoToAidl(const proto::PropIdAreaId& in, PropIdAreaId* out) {
+ out->propId = in.prop_id();
+ out->areaId = in.area_id();
+}
+
+void aidlToProto(const aidl_vehicle::RawPropValues& in, proto::RawPropValues* out) {
+ out->set_string_value(in.stringValue);
+ out->set_byte_values(in.byteValues.data(), in.byteValues.size());
+ for (auto& int32Value : in.int32Values) {
+ out->add_int32_values(int32Value);
+ }
+ for (auto& int64Value : in.int64Values) {
+ out->add_int64_values(int64Value);
+ }
+ for (auto& floatValue : in.floatValues) {
+ out->add_float_values(floatValue);
+ }
+}
+
+void protoToAidl(const proto::RawPropValues& in, aidl_vehicle::RawPropValues* out) {
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, int32_values, out, int32Values);
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, int64_values, out, int64Values);
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, float_values, out, floatValues);
+ out->stringValue = in.string_value();
+ for (const char& byte : in.byte_values()) {
+ out->byteValues.push_back(byte);
+ }
+}
+
+void aidlToProto(const aidl_vehicle::MinMaxSupportedValueResult& in,
+ proto::MinMaxSupportedValueResult* out) {
+ out->set_status(static_cast<proto::StatusCode>(in.status));
+ if (in.minSupportedValue.has_value()) {
+ aidlToProto(in.minSupportedValue.value(), out->mutable_min_supported_value());
+ }
+ if (in.maxSupportedValue.has_value()) {
+ aidlToProto(in.maxSupportedValue.value(), out->mutable_max_supported_value());
+ }
+}
+
+void protoToAidl(const proto::MinMaxSupportedValueResult& in,
+ aidl_vehicle::MinMaxSupportedValueResult* out) {
+ out->status = static_cast<aidl_vehicle::StatusCode>(in.status());
+ if (in.has_min_supported_value()) {
+ aidl_vehicle::RawPropValues minSupportedValue = {};
+ protoToAidl(in.min_supported_value(), &minSupportedValue);
+ out->minSupportedValue = minSupportedValue;
+ }
+ if (in.has_max_supported_value()) {
+ aidl_vehicle::RawPropValues maxSupportedValue = {};
+ protoToAidl(in.max_supported_value(), &maxSupportedValue);
+ out->maxSupportedValue = maxSupportedValue;
+ }
+}
+
+void aidlToProto(const aidl_vehicle::SupportedValuesListResult& in,
+ proto::SupportedValuesListResult* out) {
+ out->set_status(static_cast<proto::StatusCode>(in.status));
+ if (!in.supportedValuesList.has_value()) {
+ return;
+ }
+ for (const auto& protoSupportedValue : in.supportedValuesList.value()) {
+ if (protoSupportedValue.has_value()) {
+ aidlToProto(protoSupportedValue.value(), out->add_supported_values_list());
+ }
+ }
+}
+
+void protoToAidl(const proto::SupportedValuesListResult& in,
+ aidl_vehicle::SupportedValuesListResult* out) {
+ out->status = static_cast<aidl_vehicle::StatusCode>(in.status());
+ if (out->status != aidl_vehicle::StatusCode::OK) {
+ return;
+ }
+ std::vector<std::optional<aidl_vehicle::RawPropValues>> aidlSupportedValuesList;
+ for (const auto& protoRawPropValues : in.supported_values_list()) {
+ aidl_vehicle::RawPropValues aidlRawPropValues = {};
+ protoToAidl(protoRawPropValues, &aidlRawPropValues);
+ aidlSupportedValuesList.push_back(std::move(aidlRawPropValues));
+ }
+ out->supportedValuesList = std::move(aidlSupportedValuesList);
+}
+
#undef COPY_PROTOBUF_VEC_TO_VHAL_TYPE
#undef CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE
diff --git a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp
index 2efda5b..eafbe91 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp
@@ -83,7 +83,7 @@
} // namespace
-TEST_P(PropConfigConversionTest, testConversion) {
+TEST_P(PropConfigConversionTest, testConvertPropConfig) {
proto::VehiclePropConfig protoCfg;
aidl_vehicle::VehiclePropConfig aidlCfg;
@@ -93,7 +93,7 @@
EXPECT_EQ(aidlCfg, GetParam());
}
-TEST_P(PropValueConversionTest, testConversion) {
+TEST_P(PropValueConversionTest, testConvertPropValue) {
proto::VehiclePropValue protoVal;
aidl_vehicle::VehiclePropValue aidlVal;
@@ -130,6 +130,132 @@
EXPECT_EQ(aidlOptions, outputOptions);
}
+TEST_F(PropValueConversionTest, testConvertPropIdAreaId) {
+ proto::PropIdAreaId protoValue;
+ PropIdAreaId aidlValue = {.propId = 12, .areaId = 34};
+ PropIdAreaId outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertRawPropValues) {
+ proto::RawPropValues protoValue;
+ aidl_vehicle::RawPropValues aidlValue = {
+ .int32Values = {1, 2, 3, 4},
+ .floatValues = {1.1, 2.2, 3.3, 4.4},
+ .int64Values = {4L, 3L, 2L, 1L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::RawPropValues outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertMinMaxSupportedValueResult) {
+ proto::MinMaxSupportedValueResult protoValue;
+ aidl_vehicle::RawPropValues aidlValue1 = {
+ .int32Values = {1, 2, 3, 4},
+ .floatValues = {1.1, 2.2, 3.3, 4.4},
+ .int64Values = {4L, 3L, 2L, 1L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::RawPropValues aidlValue2 = {
+ .int32Values = {4, 3, 2, 1},
+ .floatValues = {3.3},
+ .int64Values = {2L, 3L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::MinMaxSupportedValueResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::OK,
+ .minSupportedValue = aidlValue1,
+ .maxSupportedValue = aidlValue2,
+ };
+ aidl_vehicle::MinMaxSupportedValueResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertMinMaxSupportedValueResult_errorStatus) {
+ proto::MinMaxSupportedValueResult protoValue;
+ aidl_vehicle::MinMaxSupportedValueResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::INTERNAL_ERROR,
+ };
+ aidl_vehicle::MinMaxSupportedValueResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertSupportedValuesListResult) {
+ proto::SupportedValuesListResult protoValue;
+ aidl_vehicle::RawPropValues aidlValue1 = {
+ .int32Values = {1, 2, 3, 4},
+ .floatValues = {1.1, 2.2, 3.3, 4.4},
+ .int64Values = {4L, 3L, 2L, 1L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::RawPropValues aidlValue2 = {
+ .int32Values = {4, 3, 2, 1},
+ .floatValues = {3.3},
+ .int64Values = {2L, 3L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::SupportedValuesListResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::OK,
+ .supportedValuesList = std::vector<std::optional<aidl_vehicle::RawPropValues>>(
+ {aidlValue1, aidlValue2}),
+ };
+ aidl_vehicle::SupportedValuesListResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertSupportedValuesListResult_emptySupportedValues) {
+ proto::SupportedValuesListResult protoValue;
+ aidl_vehicle::SupportedValuesListResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::OK,
+ .supportedValuesList = std::vector<std::optional<aidl_vehicle::RawPropValues>>({}),
+ };
+ aidl_vehicle::SupportedValuesListResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertSupportedValuesListResult_errorStatus) {
+ proto::SupportedValuesListResult protoValue;
+ aidl_vehicle::SupportedValuesListResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::INTERNAL_ERROR,
+ };
+ aidl_vehicle::SupportedValuesListResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
} // namespace proto_msg_converter
} // namespace vehicle
} // namespace automotive
diff --git a/automotive/vehicle/aidl/impl/current/proto/Android.bp b/automotive/vehicle/aidl/impl/current/proto/Android.bp
index 2b5cdf4..b12288b 100644
--- a/automotive/vehicle/aidl/impl/current/proto/Android.bp
+++ b/automotive/vehicle/aidl/impl/current/proto/Android.bp
@@ -42,6 +42,11 @@
out: [
"android/hardware/automotive/vehicle/DumpOptions.pb.h",
"android/hardware/automotive/vehicle/DumpResult.pb.h",
+ "android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.pb.h",
+ "android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.pb.h",
+ "android/hardware/automotive/vehicle/HasSupportedValueInfo.pb.h",
+ "android/hardware/automotive/vehicle/PropIdAreaId.pb.h",
+ "android/hardware/automotive/vehicle/RawPropValues.pb.h",
"android/hardware/automotive/vehicle/StatusCode.pb.h",
"android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h",
"android/hardware/automotive/vehicle/VehiclePropConfig.pb.h",
@@ -69,6 +74,11 @@
out: [
"android/hardware/automotive/vehicle/DumpOptions.pb.cc",
"android/hardware/automotive/vehicle/DumpResult.pb.cc",
+ "android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.pb.cc",
+ "android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.pb.cc",
+ "android/hardware/automotive/vehicle/HasSupportedValueInfo.pb.cc",
+ "android/hardware/automotive/vehicle/PropIdAreaId.pb.cc",
+ "android/hardware/automotive/vehicle/RawPropValues.pb.cc",
"android/hardware/automotive/vehicle/StatusCode.pb.cc",
"android/hardware/automotive/vehicle/VehicleAreaConfig.pb.cc",
"android/hardware/automotive/vehicle/VehiclePropConfig.pb.cc",
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.proto
new file mode 100644
index 0000000..b70c24c
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.proto
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2025 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/PropIdAreaId.proto";
+import "android/hardware/automotive/vehicle/RawPropValues.proto";
+import "android/hardware/automotive/vehicle/StatusCode.proto";
+
+message MinMaxSupportedValueResult {
+ /**
+ * The status for result. If this is not OK, the operation failed for this
+ * [propId, areaId].
+ */
+ StatusCode status = 1;
+ /**
+ * The min supported value.
+ *
+ * If the [propId, areaId] does not specify a min supported value, this
+ * is {@code null}.
+ */
+ RawPropValues min_supported_value = 2;
+ /**
+ * The max supported value.
+ *
+ * If the [propId, areaId] does not specify a max supported value, this
+ * is {@code null}.
+ *
+ * This must be ignored if status is not {@code StatusCode.OK}.
+ */
+ RawPropValues max_supported_value = 3;
+};
+
+message GetMinMaxSupportedValuesRequest {
+ repeated PropIdAreaId prop_id_area_id = 1;
+};
+
+message GetMinMaxSupportedValuesResult {
+ repeated MinMaxSupportedValueResult result = 1;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.proto
new file mode 100644
index 0000000..a1488ea
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.proto
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2025 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/PropIdAreaId.proto";
+import "android/hardware/automotive/vehicle/RawPropValues.proto";
+import "android/hardware/automotive/vehicle/StatusCode.proto";
+
+message SupportedValuesListResult {
+ /**
+ * The status for result. If this is not OK, the operation failed for this
+ * [propId, areaId].
+ */
+ StatusCode status = 1;
+ /**
+ * The supported values list.
+ *
+ * If the [propId, areaId] does not specify a supported values list, this
+ * is {@code null}.
+ *
+ * This must be ignored if status is not {@code StatusCode.OK}.
+ */
+ repeated RawPropValues supported_values_list = 2;
+};
+
+message GetSupportedValuesListsRequest {
+ repeated PropIdAreaId prop_id_area_id = 1;
+};
+
+message GetSupportedValuesListsResult {
+ repeated SupportedValuesListResult result = 1;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/HasSupportedValueInfo.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/HasSupportedValueInfo.proto
new file mode 100644
index 0000000..c04deb4
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/HasSupportedValueInfo.proto
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2025 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 HasSupportedValueInfo.aidl. */
+message HasSupportedValueInfo {
+ /**
+ * Whether [propId, areaId] has min supported value specified.
+ *
+ * If this is {@code true}, the hardware specifies a min supported value.
+ * If {@code MinMaxSupportedValueResult}'s {@code status} is
+ * {@code StatusCode.OK}, its {@code minSupportedValue} must not be
+ * {@code null}.
+ *
+ * If this is {@code false}, {@code minSupportedValue} must be {@code null}.
+ *
+ * Unless otherwise specified, this field is set to {@code false} for any
+ * properties whose type is not int32, int64 or float.
+ *
+ * For certain properties, e.g. {@code EV_BRAKE_REGENERATION_LEVEL}, this
+ * must always be {@code true}. Check {@code VehicleProperty}
+ * documentation.
+ */
+ bool has_min_supported_value = 1;
+
+ /**
+ * Whether [propId, areaId] has max supported value specified.
+ *
+ * If this is {@code true}, the hardware specifies a max supported value.
+ * If {@code MinMaxSupportedValueResult}'s {@code status} is
+ * {@code StatusCode.OK}, its {@code maxSupportedValue} must not be
+ * {@code null}.
+ *
+ * If this is {@code false}, {@code maxSupportedValue} must be {@code null}.
+ *
+ * Unless otherwise specified, this field is set to {@code false} for any
+ * properties whose type is not int32, int64 or float.
+ *
+ * For certain properties, e.g. {@code EV_BRAKE_REGENERATION_LEVEL}, this
+ * must always be {@code true}. Check {@code VehicleProperty}
+ * documentation.
+ */
+ bool has_max_supported_value = 2;
+
+ /**
+ * Whether [propId, areaId] has supported values list specified.
+ *
+ * If this is {@code true}, it means the hardware specifies supported
+ * values for this property.
+ * If {@code SupportedValueListResult}'s {@code status} is
+ * {@code StatusCode.OK}, its {@code supportedValuesList} must not be
+ * {@code null}.
+ *
+ * If this is {@code false}, {@code supportedValuesList} must always be
+ * {@code null}.
+ *
+ * The supported value is the superset for both the input value for writable
+ * property and the output value for readable property.
+ *
+ * For certain properties, e.g. {@code GEAR_SELECTION}, this must always be
+ * {@code true}. Check {@code VehicleProperty} documentation.
+ */
+ bool has_supported_values_list = 3;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/PropIdAreaId.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/PropIdAreaId.proto
new file mode 100644
index 0000000..556eec6
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/PropIdAreaId.proto
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2025 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 PropIdAreaId {
+ int32 prop_id = 1;
+ int32 area_id = 2;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/RawPropValues.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/RawPropValues.proto
new file mode 100644
index 0000000..8f54fea
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/RawPropValues.proto
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2025 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 RawPropValues.aidl. */
+message RawPropValues {
+ /* This is used for properties of types VehiclePropertyType#INT
+ * and VehiclePropertyType#INT_VEC */
+ repeated int32 int32_values = 1;
+
+ /* This is used for properties of types VehiclePropertyType#FLOAT
+ * and VehiclePropertyType#FLOAT_VEC */
+ repeated float float_values = 2;
+
+ /* This is used for properties of type VehiclePropertyType#INT64 */
+ repeated int64 int64_values = 3;
+
+ /* This is used for properties of type VehiclePropertyType#BYTES */
+ bytes byte_values = 4;
+
+ /* This is used for properties of type VehiclePropertyType#STRING */
+ string string_value = 5;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
index 7ea8540..695af31 100644
--- a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
@@ -19,6 +19,7 @@
package android.hardware.automotive.vehicle.proto;
import "android/hardware/automotive/vehicle/VehiclePropertyAccess.proto";
+import "android/hardware/automotive/vehicle/HasSupportedValueInfo.proto";
/* Must be in sync with VehicleAreaConfig.aidl. */
message VehicleAreaConfig {
@@ -47,4 +48,30 @@
repeated int64 supported_enum_values = 8;
VehiclePropertyAccess access = 9;
bool support_variable_update_rate = 10;
+ /**
+ * This specifies whether this property may have min/max supported value or supported values
+ * list for [propId, areaId] that supports new supported values APIs.
+ *
+ * If this is not {@code null}. The client may use {@code getMinMaxSupportedValue},
+ * {@code getSupportedValuesLists}, {@code subscribeSupportedValueChange},
+ * {@code unsubscribeSupportedValueChange}.
+ *
+ * If this is not {@code null}. The VHAL implementation must implement
+ * {@code getMinMaxSupportedValue}, {@code getSupportedValuesLists},
+ * {@code subscribeSupportedValueChange} for the [propId, areaId].
+ *
+ * This should be non-null if the VHAL implementation wants to expose
+ * min/max supported value or supported values list that may change dynamically. For example,
+ * if the max HVAC fan speed may change due to HVAC power settings.
+ *
+ * This should not be non-null if the VHAL implementation wants to expose supported
+ * values list for property ID that is not an enum type (hence do not support
+ * {@code VehicleAreaConfig#supportedEnumValues}).
+ *
+ * If this is {@code null}, the APIs mentioned before are not supported.
+ * Client must fallback to use static supported value information in {@code VehicleAreaConfig}.
+ *
+ * For VHAL implementation < V4, this is always {@code null}.
+ */
+ HasSupportedValueInfo has_supported_value_info = 11;
};
diff --git a/bluetooth/aidl/Android.bp b/bluetooth/aidl/Android.bp
index 4ee2f49..0daecf7 100644
--- a/bluetooth/aidl/Android.bp
+++ b/bluetooth/aidl/Android.bp
@@ -16,6 +16,13 @@
srcs: ["android/hardware/bluetooth/*.aidl"],
stability: "vintf",
backend: {
+ cpp: {
+ // FIXME should this be disabled?
+ // prefer NDK backend which can be used anywhere
+ // If you disable this, you also need to delete the C++
+ // translate code.
+ enabled: true,
+ },
rust: {
enabled: true,
},
@@ -37,4 +44,5 @@
},
],
frozen: true,
+
}
diff --git a/bluetooth/aidl/default/Android.bp b/bluetooth/aidl/default/Android.bp
index d3f6364..46a6983 100644
--- a/bluetooth/aidl/default/Android.bp
+++ b/bluetooth/aidl/default/Android.bp
@@ -2,61 +2,58 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
-cc_library_static {
- name: "libbluetoothhcihalimpl",
- vendor_available: true,
- host_supported: true,
- srcs: [
- "BluetoothHci.cpp",
- "net_bluetooth_mgmt.cpp",
- ],
+cc_defaults {
+ name: "android.hardware.bluetooth-service-build-defaults",
cflags: [
"-Wall",
"-Wextra",
],
- header_libs: [
- "libbluetooth_offload_hal_headers",
+ shared_libs: [
+ "android.hardware.bluetooth-V1-ndk",
+ "libbase",
+ "libbinder_ndk",
+ "libcutils",
+ "libhidlbase",
+ "liblog",
+ "libutils",
],
static_libs: [
"android.hardware.bluetooth.async",
"android.hardware.bluetooth.hci",
- ],
- shared_libs: [
- "libbase",
- "libcutils",
- "liblog",
- "libutils",
+ "libbluetooth_offload_hal",
],
}
-rust_binary {
+cc_library_static {
+ name: "libbluetoothhcihalimpl",
+ vendor_available: true,
+ defaults: ["android.hardware.bluetooth-service-build-defaults"],
+ srcs: [
+ "BluetoothHci.cpp",
+ "net_bluetooth_mgmt.cpp",
+ ],
+}
+
+cc_binary {
name: "android.hardware.bluetooth-service.default",
- crate_name: "bluetooth_hci_hal_server",
relative_install_path: "hw",
init_rc: ["bluetooth-service-default.rc"],
vintf_fragments: [":manifest_android.hardware.bluetooth-service.default.xml"],
vendor: true,
- prefer_rlib: true,
- srcs: ["main.rs"],
- rustlibs: [
- "android.hardware.bluetooth-V1-rust",
- "libbluetooth_offload_hal",
- "libbluetooth_offload_leaudio_hci",
- "libbinder_rs",
- "liblogger",
- "liblog_rust",
- ],
- static_libs: [
- "android.hardware.bluetooth.async",
- "android.hardware.bluetooth.hci",
- "libbluetoothhcihalimpl",
+ defaults: ["android.hardware.bluetooth-service-build-defaults"],
+ srcs: [
+ "service.cpp",
],
shared_libs: [
+ "android.hardware.bluetooth-V1-ndk",
"libbase",
- "libc++",
- "libcutils",
- "liblog",
+ "libbinder_ndk",
+ "libhidlbase",
"libutils",
+ "liblog",
+ ],
+ static_libs: [
+ "libbluetoothhcihalimpl",
],
}
diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp
index bcdb67e..5ac3afe 100644
--- a/bluetooth/aidl/default/BluetoothHci.cpp
+++ b/bluetooth/aidl/default/BluetoothHci.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright 2022 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.
@@ -16,20 +16,18 @@
#define LOG_TAG "android.hardware.bluetooth.service.default"
+#include "BluetoothHci.h"
+
#include <cutils/properties.h>
#include <fcntl.h>
-#include <hal/ffi.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <poll.h>
#include <string.h>
+#include <sys/uio.h>
#include <termios.h>
-#include <future>
-#include <memory>
-#include <vector>
-
-#include "async_fd_watcher.h"
-#include "h4_protocol.h"
#include "log/log.h"
-#include "net_bluetooth_mgmt.h"
namespace {
int SetTerminalRaw(int fd) {
@@ -46,6 +44,7 @@
using namespace ::android::hardware::bluetooth::hci;
using namespace ::android::hardware::bluetooth::async;
+using aidl::android::hardware::bluetooth::hal::Status;
namespace aidl::android::hardware::bluetooth::impl {
@@ -62,298 +61,234 @@
return str.compare(0, prefix.length(), prefix) == 0;
}
-class Hal {
- public:
- Hal(const std::string& dev_path = "/dev/hvc5") {
- char property_bytes[PROPERTY_VALUE_MAX];
- property_get("vendor.ser.bt-uart", property_bytes, dev_path.c_str());
- mDevPath = std::string(property_bytes);
- }
+BluetoothHci::BluetoothHci(const std::string& dev_path) {
+ char property_bytes[PROPERTY_VALUE_MAX];
+ property_get("vendor.ser.bt-uart", property_bytes, dev_path.c_str());
+ mDevPath = std::string(property_bytes);
+}
- static void Initialize(void* instance,
- const struct hal_callbacks* callbacks) {
- static_cast<Hal*>(instance)->Initialize(callbacks);
- }
-
- static void Close(void* instance) { static_cast<Hal*>(instance)->Close(); }
-
- static void SendCommand(void* instance, const uint8_t* data, size_t len) {
- static_cast<Hal*>(instance)->SendCommand(
- std::vector<uint8_t>(data, data + len));
- }
-
- static void SendAcl(void* instance, const uint8_t* data, size_t len) {
- static_cast<Hal*>(instance)->SendAcl(
- std::vector<uint8_t>(data, data + len));
- }
-
- static void SendSco(void* instance, const uint8_t* data, size_t len) {
- static_cast<Hal*>(instance)->SendSco(
- std::vector<uint8_t>(data, data + len));
- }
-
- static void SendIso(void* instance, const uint8_t* data, size_t len) {
- static_cast<Hal*>(instance)->SendIso(
- std::vector<uint8_t>(data, data + len));
- }
-
- private:
- int getFdFromDevPath() {
- int fd = open(mDevPath.c_str(), O_RDWR);
- if (fd < 0) {
- ALOGE("Could not connect to bt: %s (%s)", mDevPath.c_str(),
- strerror(errno));
- return fd;
- }
- if (int ret = SetTerminalRaw(fd) < 0) {
- ALOGI("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
- strerror(errno));
- }
+int BluetoothHci::getFdFromDevPath() {
+ int fd = open(mDevPath.c_str(), O_RDWR);
+ if (fd < 0) {
+ ALOGE("Could not connect to bt: %s (%s)", mDevPath.c_str(),
+ strerror(errno));
return fd;
}
+ if (int ret = SetTerminalRaw(fd) < 0) {
+ ALOGI("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
+ strerror(errno));
+ }
+ return fd;
+}
- void reset() {
- // Send a reset command and wait until the command complete comes back.
+void BluetoothHci::reset() {
+ // Send a reset command and wait until the command complete comes back.
- std::vector<uint8_t> reset = {0x03, 0x0c, 0x00};
+ std::vector<uint8_t> reset = {0x03, 0x0c, 0x00};
- auto resetPromise = std::make_shared<std::promise<void>>();
- auto resetFuture = resetPromise->get_future();
+ auto resetPromise = std::make_shared<std::promise<void>>();
+ auto resetFuture = resetPromise->get_future();
- mH4 = std::make_shared<H4Protocol>(
- mFd,
- [](const std::vector<uint8_t>& raw_command) {
- ALOGI("Discarding %d bytes with command type",
- static_cast<int>(raw_command.size()));
- },
- [](const std::vector<uint8_t>& raw_acl) {
- ALOGI("Discarding %d bytes with acl type",
- static_cast<int>(raw_acl.size()));
- },
- [](const std::vector<uint8_t>& raw_sco) {
- ALOGI("Discarding %d bytes with sco type",
- static_cast<int>(raw_sco.size()));
- },
- [resetPromise](const std::vector<uint8_t>& raw_event) {
- std::vector<uint8_t> reset_complete = {0x0e, 0x04, 0x01,
- 0x03, 0x0c, 0x00};
- bool valid = raw_event.size() == 6 &&
- raw_event[0] == reset_complete[0] &&
- raw_event[1] == reset_complete[1] &&
- // Don't compare the number of packets field.
- raw_event[3] == reset_complete[3] &&
- raw_event[4] == reset_complete[4] &&
- raw_event[5] == reset_complete[5];
- if (valid) {
- resetPromise->set_value();
- } else {
- ALOGI("Discarding %d bytes with event type",
- static_cast<int>(raw_event.size()));
- }
- },
- [](const std::vector<uint8_t>& raw_iso) {
- ALOGI("Discarding %d bytes with iso type",
- static_cast<int>(raw_iso.size()));
- },
- [this]() {
- ALOGI("HCI socket device disconnected while waiting for reset");
- mFdWatcher.StopWatchingFileDescriptors();
- });
- mFdWatcher.WatchFdForNonBlockingReads(mFd,
- [this](int) { mH4->OnDataReady(); });
+ mH4 = std::make_shared<H4Protocol>(
+ mFd,
+ [](const std::vector<uint8_t>& raw_command) {
+ ALOGI("Discarding %d bytes with command type",
+ static_cast<int>(raw_command.size()));
+ },
+ [](const std::vector<uint8_t>& raw_acl) {
+ ALOGI("Discarding %d bytes with acl type",
+ static_cast<int>(raw_acl.size()));
+ },
+ [](const std::vector<uint8_t>& raw_sco) {
+ ALOGI("Discarding %d bytes with sco type",
+ static_cast<int>(raw_sco.size()));
+ },
+ [resetPromise](const std::vector<uint8_t>& raw_event) {
+ std::vector<uint8_t> reset_complete = {0x0e, 0x04, 0x01,
+ 0x03, 0x0c, 0x00};
+ bool valid = raw_event.size() == 6 &&
+ raw_event[0] == reset_complete[0] &&
+ raw_event[1] == reset_complete[1] &&
+ // Don't compare the number of packets field.
+ raw_event[3] == reset_complete[3] &&
+ raw_event[4] == reset_complete[4] &&
+ raw_event[5] == reset_complete[5];
+ if (valid) {
+ resetPromise->set_value();
+ } else {
+ ALOGI("Discarding %d bytes with event type",
+ static_cast<int>(raw_event.size()));
+ }
+ },
+ [](const std::vector<uint8_t>& raw_iso) {
+ ALOGI("Discarding %d bytes with iso type",
+ static_cast<int>(raw_iso.size()));
+ },
+ [this]() {
+ ALOGI("HCI socket device disconnected while waiting for reset");
+ mFdWatcher.StopWatchingFileDescriptors();
+ });
+ mFdWatcher.WatchFdForNonBlockingReads(mFd,
+ [this](int) { mH4->OnDataReady(); });
- if (!send(PacketType::COMMAND, reset)) {
- ALOGE("Error sending reset command");
- }
- auto status = resetFuture.wait_for(std::chrono::seconds(1));
- mFdWatcher.StopWatchingFileDescriptors();
- if (status == std::future_status::ready) {
- ALOGI("HCI Reset successful");
- } else {
- ALOGE("HCI Reset Response not received in one second");
- }
-
- resetPromise.reset();
+ send(PacketType::COMMAND, reset);
+ auto status = resetFuture.wait_for(std::chrono::seconds(1));
+ mFdWatcher.StopWatchingFileDescriptors();
+ if (status == std::future_status::ready) {
+ ALOGI("HCI Reset successful");
+ } else {
+ ALOGE("HCI Reset Response not received in one second");
}
- void Initialize(const struct hal_callbacks* callbacks) {
- ALOGI(__func__);
+ resetPromise.reset();
+}
- HalState old_state = HalState::READY;
- {
- std::lock_guard<std::mutex> guard(mStateMutex);
- if (mState != HalState::READY) {
- old_state = mState;
- } else {
- mState = HalState::INITIALIZING;
- }
- }
+void BluetoothHci::initialize(
+ const std::shared_ptr<hal::IBluetoothHciCallbacks>& cb) {
+ ALOGI(__func__);
- if (old_state != HalState::READY) {
- ALOGE("initialize: Unexpected State %d", static_cast<int>(old_state));
- Close();
- callbacks->initialization_complete(callbacks->handle,
- STATUS_ALREADY_INITIALIZED);
- return;
- }
-
- mCallbacks = std::make_unique<struct hal_callbacks>(*callbacks);
- management_.reset(new NetBluetoothMgmt);
- mFd = management_->openHci();
- if (mFd < 0) {
- management_.reset();
-
- ALOGI("Unable to open Linux interface, trying default path.");
- mFd = getFdFromDevPath();
- if (mFd < 0) {
- mState = HalState::READY;
- mCallbacks->initialization_complete(mCallbacks->handle,
- STATUS_UNABLE_TO_OPEN_INTERFACE);
- return;
- }
- }
-
- // TODO: HCI Reset on emulators since the bluetooth controller
- // cannot be powered on/off during the HAL setup; and the stack
- // might received spurious packets/events during boottime.
- // Proper solution would be to use bt-virtio or vsock to better
- // control the link to rootcanal and the controller lifetime.
- const std::string kBoardProperty = "ro.product.board";
- const std::string kCuttlefishBoard = "cutf";
- auto board_name = GetSystemProperty(kBoardProperty);
- if (board_name.has_value() &&
- (starts_with(board_name.value(), "cutf") ||
- starts_with(board_name.value(), "goldfish"))) {
- reset();
- }
-
- mH4 = std::make_shared<H4Protocol>(
- mFd,
- [](const std::vector<uint8_t>& /* raw_command */) {
- LOG_ALWAYS_FATAL("Unexpected command!");
- },
- [this](const std::vector<uint8_t>& raw_acl) {
- mCallbacks->acl_received(mCallbacks->handle, raw_acl.data(),
- raw_acl.size());
- },
- [this](const std::vector<uint8_t>& raw_sco) {
- mCallbacks->sco_received(mCallbacks->handle, raw_sco.data(),
- raw_sco.size());
- },
- [this](const std::vector<uint8_t>& raw_event) {
- mCallbacks->event_received(mCallbacks->handle, raw_event.data(),
- raw_event.size());
- },
- [this](const std::vector<uint8_t>& raw_iso) {
- mCallbacks->iso_received(mCallbacks->handle, raw_iso.data(),
- raw_iso.size());
- },
- [this]() {
- ALOGI("HCI socket device disconnected");
- mFdWatcher.StopWatchingFileDescriptors();
- });
- mFdWatcher.WatchFdForNonBlockingReads(mFd,
- [this](int) { mH4->OnDataReady(); });
-
- {
- std::lock_guard<std::mutex> guard(mStateMutex);
- mState = HalState::ONE_CLIENT;
- }
-
- ALOGI("initialization complete");
- mCallbacks->initialization_complete(mCallbacks->handle, STATUS_SUCCESS);
+ if (cb == nullptr) {
+ ALOGE("cb == nullptr! -> Unable to call initializationComplete(ERR)");
+ abort();
}
- void Close() {
- ALOGI(__func__);
- {
- std::lock_guard<std::mutex> guard(mStateMutex);
- if (mState != HalState::ONE_CLIENT) {
- LOG_ALWAYS_FATAL_IF(mState == HalState::INITIALIZING,
- "mState is INITIALIZING");
- ALOGI("Already closed");
- return;
- }
- mCallbacks.reset();
- mState = HalState::CLOSING;
- }
-
- mFdWatcher.StopWatchingFileDescriptors();
-
- if (management_) {
- management_->closeHci();
- } else {
- ::close(mFd);
- }
-
- {
- std::lock_guard<std::mutex> guard(mStateMutex);
- mState = HalState::READY;
- mH4 = nullptr;
- }
- }
-
- void SendCommand(const std::vector<uint8_t>& data) {
- send(PacketType::COMMAND, data);
- }
- void SendAcl(const std::vector<uint8_t>& data) {
- send(PacketType::ACL_DATA, data);
- }
- void SendSco(const std::vector<uint8_t>& data) {
- send(PacketType::SCO_DATA, data);
- }
- void SendIso(const std::vector<uint8_t>& data) {
- send(PacketType::ISO_DATA, data);
- }
-
- bool send(PacketType type, const std::vector<uint8_t>& v) {
- if (v.empty()) {
- ALOGE("Packet is empty, no data was found to be sent");
- return false;
- }
-
+ HalState old_state = HalState::READY;
+ {
std::lock_guard<std::mutex> guard(mStateMutex);
- if (mH4 == nullptr) {
- ALOGE("Illegal State");
- return false;
+ if (mState != HalState::READY) {
+ old_state = mState;
+ } else {
+ mState = HalState::INITIALIZING;
}
-
- mH4->Send(type, v);
- return true;
}
- std::unique_ptr<struct hal_callbacks> mCallbacks;
- std::string mDevPath;
- int mFd{-1};
- ::android::hardware::bluetooth::async::AsyncFdWatcher mFdWatcher;
- std::shared_ptr<::android::hardware::bluetooth::hci::H4Protocol> mH4;
- std::unique_ptr<NetBluetoothMgmt> management_{};
+ if (old_state != HalState::READY) {
+ ALOGE("initialize: Unexpected State %d", static_cast<int>(old_state));
+ close();
+ cb->initializationComplete(Status::ALREADY_INITIALIZED);
+ }
- // Don't close twice or open before close is complete
- std::mutex mStateMutex;
- enum class HalState {
- READY,
- INITIALIZING,
- ONE_CLIENT,
- CLOSING,
- } mState{HalState::READY};
-};
+ mCb = cb;
+ management_.reset(new NetBluetoothMgmt);
+ mFd = management_->openHci();
+ if (mFd < 0) {
+ management_.reset();
+
+ ALOGI("Unable to open Linux interface, trying default path.");
+ mFd = getFdFromDevPath();
+ if (mFd < 0) {
+ mState = HalState::READY;
+ cb->initializationComplete(Status::UNABLE_TO_OPEN_INTERFACE);
+ }
+ }
+
+ // TODO: HCI Reset on emulators since the bluetooth controller
+ // cannot be powered on/off during the HAL setup; and the stack
+ // might received spurious packets/events during boottime.
+ // Proper solution would be to use bt-virtio or vsock to better
+ // control the link to rootcanal and the controller lifetime.
+ const std::string kBoardProperty = "ro.product.board";
+ const std::string kCuttlefishBoard = "cutf";
+ auto board_name = GetSystemProperty(kBoardProperty);
+ if (board_name.has_value() && (
+ starts_with(board_name.value(), "cutf") ||
+ starts_with(board_name.value(), "goldfish"))) {
+ reset();
+ }
+
+ mH4 = std::make_shared<H4Protocol>(
+ mFd,
+ [](const std::vector<uint8_t>& /* raw_command */) {
+ LOG_ALWAYS_FATAL("Unexpected command!");
+ },
+ [this](const std::vector<uint8_t>& raw_acl) {
+ mCb->aclDataReceived(raw_acl);
+ },
+ [this](const std::vector<uint8_t>& raw_sco) {
+ mCb->scoDataReceived(raw_sco);
+ },
+ [this](const std::vector<uint8_t>& raw_event) {
+ mCb->hciEventReceived(raw_event);
+ },
+ [this](const std::vector<uint8_t>& raw_iso) {
+ mCb->isoDataReceived(raw_iso);
+ },
+ [this]() {
+ ALOGI("HCI socket device disconnected");
+ mFdWatcher.StopWatchingFileDescriptors();
+ });
+ mFdWatcher.WatchFdForNonBlockingReads(mFd,
+ [this](int) { mH4->OnDataReady(); });
+
+ {
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ mState = HalState::ONE_CLIENT;
+ }
+ ALOGI("initialization complete");
+ mCb->initializationComplete(Status::SUCCESS);
+}
+
+void BluetoothHci::close() {
+ ALOGI(__func__);
+ {
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ if (mState != HalState::ONE_CLIENT) {
+ LOG_ALWAYS_FATAL_IF(mState == HalState::INITIALIZING,
+ "mState is INITIALIZING");
+ ALOGI("Already closed");
+ }
+ mState = HalState::CLOSING;
+ }
+
+ mFdWatcher.StopWatchingFileDescriptors();
+
+ if (management_) {
+ management_->closeHci();
+ } else {
+ ::close(mFd);
+ }
+
+ {
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ mState = HalState::READY;
+ mH4 = nullptr;
+ }
+}
+
+void BluetoothHci::clientDied() {
+ ALOGI(__func__);
+ close();
+}
+
+void BluetoothHci::sendHciCommand(const std::vector<uint8_t>& packet) {
+ return send(PacketType::COMMAND, packet);
+}
+
+void BluetoothHci::sendAclData(const std::vector<uint8_t>& packet) {
+ return send(PacketType::ACL_DATA, packet);
+}
+
+void BluetoothHci::sendScoData(const std::vector<uint8_t>& packet) {
+ return send(PacketType::SCO_DATA, packet);
+}
+
+void BluetoothHci::sendIsoData(const std::vector<uint8_t>& packet) {
+ return send(PacketType::ISO_DATA, packet);
+}
+
+void BluetoothHci::send(PacketType type, const std::vector<uint8_t>& v) {
+ if (v.empty()) {
+ ALOGE("Packet is empty, no data was found to be sent");
+ abort();
+ }
+
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ if (mH4 == nullptr) {
+ ALOGE("Illegal State");
+ abort();
+ }
+
+ mH4->Send(type, v);
+}
} // namespace aidl::android::hardware::bluetooth::impl
-
-extern "C" {
-
-using namespace aidl::android::hardware::bluetooth::impl;
-
-struct hal_interface hal_new() {
- return (struct hal_interface){
- .handle = new Hal(),
- .initialize = &Hal::Initialize,
- .close = &Hal::Close,
- .send_command = &Hal::SendCommand,
- .send_acl = &Hal::SendAcl,
- .send_sco = &Hal::SendSco,
- .send_iso = &Hal::SendIso,
- };
-}
-}
diff --git a/bluetooth/aidl/default/BluetoothHci.h b/bluetooth/aidl/default/BluetoothHci.h
new file mode 100644
index 0000000..5c31468
--- /dev/null
+++ b/bluetooth/aidl/default/BluetoothHci.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2022 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.
+ */
+
+#pragma once
+
+#include <hal/ffi.h>
+
+#include <future>
+#include <string>
+
+#include "async_fd_watcher.h"
+#include "h4_protocol.h"
+#include "net_bluetooth_mgmt.h"
+
+namespace aidl::android::hardware::bluetooth::impl {
+
+// This Bluetooth HAL implementation connects with a serial port at dev_path_.
+class BluetoothHci : public hal::IBluetoothHci {
+ public:
+ BluetoothHci(const std::string& dev_path = "/dev/hvc5");
+
+ void initialize(
+ const std::shared_ptr<hal::IBluetoothHciCallbacks>& cb) override;
+
+ void sendHciCommand(const std::vector<uint8_t>& packet) override;
+
+ void sendAclData(const std::vector<uint8_t>& packet) override;
+
+ void sendScoData(const std::vector<uint8_t>& packet) override;
+
+ void sendIsoData(const std::vector<uint8_t>& packet) override;
+
+ void close() override;
+
+ void clientDied() override;
+
+ static void OnPacketReady();
+
+ static BluetoothHci* get();
+
+ private:
+ int mFd{-1};
+ std::shared_ptr<hal::IBluetoothHciCallbacks> mCb = nullptr;
+
+ std::shared_ptr<::android::hardware::bluetooth::hci::H4Protocol> mH4;
+
+ std::string mDevPath;
+
+ ::android::hardware::bluetooth::async::AsyncFdWatcher mFdWatcher;
+
+ int getFdFromDevPath();
+ void send(::android::hardware::bluetooth::hci::PacketType type,
+ const std::vector<uint8_t>& packet);
+ std::unique_ptr<NetBluetoothMgmt> management_{};
+
+ // Send a reset command and discard all packets until a reset is received.
+ void reset();
+
+ // Don't close twice or open before close is complete
+ std::mutex mStateMutex;
+ enum class HalState {
+ READY,
+ INITIALIZING,
+ ONE_CLIENT,
+ CLOSING,
+ } mState{HalState::READY};
+};
+
+} // namespace aidl::android::hardware::bluetooth::impl
diff --git a/bluetooth/aidl/default/main.rs b/bluetooth/aidl/default/main.rs
deleted file mode 100644
index b30162a..0000000
--- a/bluetooth/aidl/default/main.rs
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2024, 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.
-
-use android_hardware_bluetooth::aidl::android::hardware::bluetooth::IBluetoothHci::{
- self,
- IBluetoothHci as _
-};
-use android_hardware_bluetooth::binder;
-use bluetooth_offload_hal::{ HciHalProxy, CInterface };
-use bluetooth_offload_leaudio_hci::LeAudioModuleBuilder;
-use log;
-use std::panic;
-
-fn new_hal() -> CInterface {
- extern "C" { fn hal_new() -> CInterface; }
- unsafe { hal_new() }
-}
-
-fn main() {
- logger::init(
- logger::Config::default()
- .with_max_level(log::LevelFilter::Debug)
- .with_tag_on_device("android.hardware.bluetooth"),
- );
-
- panic::set_hook(Box::new(|panic_info| {
- log::error!("{}", panic_info);
- }));
-
- log::info!("Bluetooth HAL starting up");
-
- binder::ProcessState::set_thread_pool_max_thread_count(0);
- binder::ProcessState::start_thread_pool();
-
- binder::add_service(
- &format!("{}/default", IBluetoothHci::BpBluetoothHci::get_descriptor()),
- IBluetoothHci::BnBluetoothHci::new_binder(
- HciHalProxy::new(
- vec![ Box::new(LeAudioModuleBuilder {}) ],
- new_hal()
- ),
- binder::BinderFeatures::default(),
- ).as_binder()
- ).expect("Failed to register service");
-
- binder::ProcessState::join_thread_pool();
-}
diff --git a/bluetooth/aidl/default/service.cpp b/bluetooth/aidl/default/service.cpp
new file mode 100644
index 0000000..9e1a22c
--- /dev/null
+++ b/bluetooth/aidl/default/service.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 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 "aidl.android.hardware.bluetooth.service.default"
+
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
+
+#include "BluetoothHci.h"
+
+using ::aidl::android::hardware::bluetooth::hal::IBluetoothHci_addService;
+using ::aidl::android::hardware::bluetooth::impl::BluetoothHci;
+using ::android::hardware::configureRpcThreadpool;
+using ::android::hardware::joinRpcThreadpool;
+
+int main(int /* argc */, char** /* argv */) {
+ ALOGI("Bluetooth HAL starting");
+ if (!ABinderProcess_setThreadPoolMaxThreadCount(0)) {
+ ALOGI("failed to set thread pool max thread count");
+ return 1;
+ }
+
+ IBluetoothHci_addService(new BluetoothHci());
+ ABinderProcess_joinThreadPool();
+ return 0;
+}
diff --git a/bluetooth/audio/aidl/default/A2dpOffloadCodecSbc.cpp b/bluetooth/audio/aidl/default/A2dpOffloadCodecSbc.cpp
index 6b9046c..10c347b 100644
--- a/bluetooth/audio/aidl/default/A2dpOffloadCodecSbc.cpp
+++ b/bluetooth/audio/aidl/default/A2dpOffloadCodecSbc.cpp
@@ -102,7 +102,7 @@
kBlockLength16
};
-enum { kSubbands8 = kSubbands.first, kSubbands4 };
+enum { kSubbands4 = kSubbands.first, kSubbands8 };
enum {
kAllocationMethodSnr = kAllocationMethod.first,
@@ -486,7 +486,7 @@
}
min_bitpool = std::max(min_bitpool, uint8_t(lcaps.get(kMinimumBitpool)));
- max_bitpool = std::max(max_bitpool, uint8_t(lcaps.get(kMaximumBitpool)));
+ max_bitpool = std::min(max_bitpool, uint8_t(lcaps.get(kMaximumBitpool)));
if (hint) {
min_bitpool =
diff --git a/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp b/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
index 8d03fae..d68113d 100644
--- a/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
@@ -78,8 +78,7 @@
cookie);
LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_);
- onSessionReady(_aidl_return);
- return ndk::ScopedAStatus::ok();
+ return onSessionReady(_aidl_return);
}
ndk::ScopedAStatus BluetoothAudioProvider::endSession() {
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
index 003da11..9cd63d6 100644
--- a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
@@ -37,8 +37,9 @@
/**
* The value used by the Host stack for the local Maximum Packet Size shall be the value
* LE_ACL_Data_Packet_Length returned by the controller in response to the command HCI LE Read
- * Buffer Size. Then, the MPS size must be in range 1 to 255. We do not make the MPS
- * configurable in HAL because using the maximum value does not require a large amount of
- * memory.
+ * Buffer Size if Total_Num_LE_ACL_Data_Packets is not zero. The MPS shall be the value
+ * ACL_Data_Packet_Length returned in response to the command HCI Read Buffer Size if
+ * Total_Num_LE_ACL_Data_Packets is zero. We do not make the MPS configurable in HAL because
+ * using the maximum value does not require a large amount of memory.
*/
}
diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp
index 63ef223..0d37060 100644
--- a/compatibility_matrices/Android.bp
+++ b/compatibility_matrices/Android.bp
@@ -88,8 +88,6 @@
"compatibility_matrix.5.xml",
],
kernel_configs: [
- "kernel_config_r_4.14",
- "kernel_config_r_4.19",
"kernel_config_r_5.4",
],
}
diff --git a/compatibility_matrices/compatibility_matrix.5.xml b/compatibility_matrices/compatibility_matrix.5.xml
index 1cf98b0..d01a6ea 100644
--- a/compatibility_matrices/compatibility_matrix.5.xml
+++ b/compatibility_matrices/compatibility_matrix.5.xml
@@ -1,578 +1,7 @@
<compatibility-matrix version="1.0" type="framework" level="5">
- <hal format="hidl">
- <name>android.hardware.atrace</name>
- <version>1.0</version>
- <interface>
- <name>IAtraceDevice</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.audio</name>
- <version>6.0</version>
- <interface>
- <name>IDevicesFactory</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.audio.effect</name>
- <version>6.0</version>
- <interface>
- <name>IEffectsFactory</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.authsecret</name>
- <version>1.0</version>
- <interface>
- <name>IAuthSecret</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.automotive.audiocontrol</name>
- <version>1.0</version>
- <version>2.0</version>
- <interface>
- <name>IAudioControl</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.automotive.can</name>
- <version>1.0</version>
- <interface>
- <name>ICanBus</name>
- <regex-instance>.*</regex-instance>
- </interface>
- <interface>
- <name>ICanController</name>
- <regex-instance>.*</regex-instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.automotive.evs</name>
- <version>1.0-1</version>
- <interface>
- <name>IEvsEnumerator</name>
- <instance>default</instance>
- <regex-instance>[a-z]+/[0-9]+</regex-instance>
- </interface>
- </hal>
- <hal format="aidl">
- <name>android.hardware.automotive.occupant_awareness</name>
- <interface>
- <name>IOccupantAwareness</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.automotive.sv</name>
- <version>1.0</version>
- <interface>
- <name>ISurroundViewService</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.automotive.vehicle</name>
- <version>2.0</version>
- <interface>
- <name>IVehicle</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.biometrics.face</name>
- <version>1.0</version>
- <interface>
- <name>IBiometricsFace</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.biometrics.fingerprint</name>
- <version>2.1-2</version>
- <interface>
- <name>IBiometricsFingerprint</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.bluetooth</name>
- <version>1.0-1</version>
- <interface>
- <name>IBluetoothHci</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.bluetooth.audio</name>
- <version>2.0</version>
- <interface>
- <name>IBluetoothAudioProvidersFactory</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.boot</name>
- <version>1.1</version>
- <interface>
- <name>IBootControl</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.broadcastradio</name>
- <version>1.0-1</version>
- <interface>
- <name>IBroadcastRadioFactory</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.broadcastradio</name>
- <version>2.0</version>
- <interface>
- <name>IBroadcastRadio</name>
- <regex-instance>.*</regex-instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.camera.provider</name>
- <version>2.4-6</version>
- <interface>
- <name>ICameraProvider</name>
- <regex-instance>[^/]+/[0-9]+</regex-instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.cas</name>
- <version>1.1-2</version>
- <interface>
- <name>IMediaCasService</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.confirmationui</name>
- <version>1.0</version>
- <interface>
- <name>IConfirmationUI</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.contexthub</name>
- <version>1.0-1</version>
- <interface>
- <name>IContexthub</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.drm</name>
- <version>1.3</version>
- <interface>
- <name>ICryptoFactory</name>
- <regex-instance>.*</regex-instance>
- </interface>
- <interface>
- <name>IDrmFactory</name>
- <regex-instance>.*</regex-instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.dumpstate</name>
- <version>1.1</version>
- <interface>
- <name>IDumpstateDevice</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.gatekeeper</name>
- <version>1.0</version>
- <interface>
- <name>IGatekeeper</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.gnss</name>
- <version>2.0-1</version>
- <interface>
- <name>IGnss</name>
- <instance>default</instance>
- </interface>
- </hal>
- <!-- Either the AIDL or the HIDL allocator HAL must exist on the device.
- If the HIDL composer HAL exists, it must be at least version 2.0.
- See DeviceManifestTest.GrallocHal -->
- <hal format="hidl">
- <name>android.hardware.graphics.allocator</name>
- <!-- New, non-Go devices should use 4.0, tested in vts_treble_vintf_vendor_test -->
- <version>2.0</version>
- <version>3.0</version>
- <version>4.0</version>
- <interface>
- <name>IAllocator</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.graphics.composer</name>
- <version>2.1-4</version>
- <interface>
- <name>IComposer</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.graphics.mapper</name>
- <!-- New, non-Go devices should use 4.0, tested in vts_treble_vintf_vendor_test -->
- <version>2.1</version>
- <version>3.0</version>
- <version>4.0</version>
- <interface>
- <name>IMapper</name>
- <instance>default</instance>
- </interface>
- </hal>
- <!-- Either the AIDL or the HIDL health HAL must exist on the device.
- If the HIDL health HAL exists, it must be at least version 2.1.
- See DeviceManifestTest.HealthHal -->
- <hal format="hidl">
- <name>android.hardware.health</name>
- <version>2.1</version>
- <interface>
- <name>IHealth</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.health.storage</name>
- <version>1.0</version>
- <interface>
- <name>IStorage</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="aidl">
- <name>android.hardware.identity</name>
- <!--
- b/178458001: identity V2 is introduced in R, but Android R VINTF does not support AIDL
- versions. Hence, we only specify identity V2 in compatibility_matrix.5.xml in Android S+
- branches. In Android R branches, the matrix implicitly specifies V1.
- SingleManifestTest.ManifestAidlHalsServed has an exemption for this.
- -->
- <version>1-2</version>
- <interface>
- <name>IIdentityCredentialStore</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.ir</name>
- <version>1.0</version>
- <interface>
- <name>IConsumerIr</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.input.classifier</name>
- <version>1.0</version>
- <interface>
- <name>IInputClassifier</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.keymaster</name>
- <version>3.0</version>
- <version>4.0-1</version>
- <interface>
- <name>IKeymasterDevice</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.keymaster</name>
- <version>4.0-1</version>
- <interface>
- <name>IKeymasterDevice</name>
- <instance>strongbox</instance>
- </interface>
- </hal>
- <hal format="aidl">
- <name>android.hardware.light</name>
- <interface>
- <name>ILights</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.media.c2</name>
- <version>1.0-1</version>
- <interface>
- <name>IComponentStore</name>
- <instance>software</instance>
- <regex-instance>default[0-9]*</regex-instance>
- <regex-instance>vendor[0-9]*_software</regex-instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.media.c2</name>
- <version>1.0</version>
- <interface>
- <name>IConfigurable</name>
- <instance>default</instance>
- <instance>software</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.media.omx</name>
- <version>1.0</version>
- <interface>
- <name>IOmx</name>
- <instance>default</instance>
- </interface>
- <interface>
- <name>IOmxStore</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.memtrack</name>
- <version>1.0</version>
- <interface>
- <name>IMemtrack</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.neuralnetworks</name>
- <version>1.0-3</version>
- <interface>
- <name>IDevice</name>
- <regex-instance>.*</regex-instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.nfc</name>
- <version>1.2</version>
- <interface>
- <name>INfc</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.oemlock</name>
- <version>1.0</version>
- <interface>
- <name>IOemLock</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="aidl">
- <name>android.hardware.power</name>
- <interface>
- <name>IPower</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.power.stats</name>
- <version>1.0</version>
- <interface>
- <name>IPowerStats</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.radio</name>
- <version>1.4</version>
- <version>1.5</version>
- <interface>
- <name>IRadio</name>
- <instance>slot1</instance>
- <instance>slot2</instance>
- <instance>slot3</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.radio</name>
- <version>1.2</version>
- <interface>
- <name>ISap</name>
- <instance>slot1</instance>
- <instance>slot2</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.radio.config</name>
- <!--
- See compatibility_matrix.4.xml on versioning of radio config HAL.
- -->
- <version>1.1</version>
- <interface>
- <name>IRadioConfig</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.renderscript</name>
- <version>1.0</version>
- <interface>
- <name>IDevice</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="aidl">
- <name>android.hardware.rebootescrow</name>
- <interface>
- <name>IRebootEscrow</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.secure_element</name>
- <version>1.0-2</version>
- <interface>
- <name>ISecureElement</name>
- <regex-instance>eSE[1-9][0-9]*</regex-instance>
- <regex-instance>SIM[1-9][0-9]*</regex-instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.sensors</name>
- <version>1.0</version>
- <version>2.0-1</version>
- <interface>
- <name>ISensors</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.soundtrigger</name>
- <version>2.0-3</version>
- <interface>
- <name>ISoundTriggerHw</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.tetheroffload.config</name>
- <version>1.0</version>
- <interface>
- <name>IOffloadConfig</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.tetheroffload.control</name>
- <version>1.0</version>
- <interface>
- <name>IOffloadControl</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.thermal</name>
- <version>2.0</version>
- <interface>
- <name>IThermal</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.tv.cec</name>
- <version>1.0</version>
- <interface>
- <name>IHdmiCec</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.tv.input</name>
- <version>1.0</version>
- <interface>
- <name>ITvInput</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.tv.tuner</name>
- <version>1.0</version>
- <interface>
- <name>ITuner</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.usb</name>
- <version>1.0-2</version>
- <interface>
- <name>IUsb</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.usb.gadget</name>
- <version>1.0-1</version>
- <interface>
- <name>IUsbGadget</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="aidl">
- <name>android.hardware.vibrator</name>
- <interface>
- <name>IVibrator</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.vr</name>
- <version>1.0</version>
- <interface>
- <name>IVr</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.weaver</name>
- <version>1.0</version>
- <interface>
- <name>IWeaver</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.wifi</name>
- <version>1.0-4</version>
- <interface>
- <name>IWifi</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.wifi.hostapd</name>
- <version>1.0-2</version>
- <interface>
- <name>IHostapd</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.wifi.supplicant</name>
- <version>1.0-3</version>
- <interface>
- <name>ISupplicant</name>
- <instance>default</instance>
- </interface>
- </hal>
+ <!--
+ Android R FCM has been deprecated, but this file is kept
+ to help manage the android11-5.4 kernel config requirements as that
+ kernel version is not being deprecated with the R FCM.
+ -->
</compatibility-matrix>
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index 57e039c..a2a13d1 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -104,6 +104,28 @@
"android.hardware.vibrator@1.1",
"android.hardware.vibrator@1.2",
"android.hardware.vibrator@1.3",
+
+ // b/392700935 for HALs deprecated in R
+ "android.hardware.automotive.audiocontrol@1.0",
+ "android.hardware.automotive.audiocontrol@2.0",
+ "android.hardware.boot@1.1",
+ "android.hardware.contexthub@1.0",
+ "android.hardware.contexthub@1.1",
+ "android.hardware.health.storage@1.0",
+ "android.hardware.memtrack@1.0",
+ "android.hardware.power.stats@1.0",
+ "android.hardware.radio@1.4",
+ "android.hardware.radio@1.5",
+ "android.hardware.soundtrigger@2.0",
+ "android.hardware.soundtrigger@2.1",
+ "android.hardware.soundtrigger@2.2",
+ "android.hardware.tetheroffload.control@1.0",
+ "android.hardware.vr@1.0",
+ "android.hardware.wifi.supplicant@1.0",
+ "android.hardware.wifi.supplicant@1.1",
+ "android.hardware.wifi@1.0",
+ "android.hardware.wifi@1.1",
+ "android.hardware.wifi@1.2",
};
auto package_has_prefix = [&](const std::string& prefix) {
diff --git a/configstore/OWNERS b/configstore/OWNERS
index 70ad434..74789b5 100644
--- a/configstore/OWNERS
+++ b/configstore/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 24939
-lpy@google.com
diff --git a/confirmationui/1.0/default/OWNERS b/confirmationui/1.0/default/OWNERS
index 17aed51..d8b8840 100644
--- a/confirmationui/1.0/default/OWNERS
+++ b/confirmationui/1.0/default/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 1124672
-jdanis@google.com
swillden@google.com
diff --git a/confirmationui/1.0/vts/OWNERS b/confirmationui/1.0/vts/OWNERS
index aa07242..b0ee996 100644
--- a/confirmationui/1.0/vts/OWNERS
+++ b/confirmationui/1.0/vts/OWNERS
@@ -1,4 +1,3 @@
# Bug component: 1124672
-jdanis@google.com
swillden@google.com
yim@google.com
diff --git a/confirmationui/support/OWNERS b/confirmationui/support/OWNERS
index 17aed51..d8b8840 100644
--- a/confirmationui/support/OWNERS
+++ b/confirmationui/support/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 1124672
-jdanis@google.com
swillden@google.com
diff --git a/gatekeeper/1.0/default/OWNERS b/gatekeeper/1.0/default/OWNERS
index c97fba6..d552a9a 100644
--- a/gatekeeper/1.0/default/OWNERS
+++ b/gatekeeper/1.0/default/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 1124862
-jdanis@google.com
swillden@google.com
diff --git a/gatekeeper/1.0/software/OWNERS b/gatekeeper/1.0/software/OWNERS
index c97fba6..d552a9a 100644
--- a/gatekeeper/1.0/software/OWNERS
+++ b/gatekeeper/1.0/software/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 1124862
-jdanis@google.com
swillden@google.com
diff --git a/gnss/OWNERS b/gnss/OWNERS
index 57982e7..2c54f9f 100644
--- a/gnss/OWNERS
+++ b/gnss/OWNERS
@@ -2,7 +2,6 @@
gomo@google.com
smalkos@google.com
-trong@google.com
wyattriley@google.com
yim@google.com
yuhany@google.com
diff --git a/graphics/OWNERS b/graphics/OWNERS
index 4317831..9ba1ee0 100644
--- a/graphics/OWNERS
+++ b/graphics/OWNERS
@@ -5,5 +5,4 @@
alecmouri@google.com
chrisforbes@google.com
jreck@google.com
-lpy@google.com
sumir@google.com
diff --git a/ir/OWNERS b/ir/OWNERS
index 04de9ef..376fe0a 100644
--- a/ir/OWNERS
+++ b/ir/OWNERS
@@ -1,2 +1,2 @@
# Bug component: 163905
-connoro@google.com
+devinmoore@google.com
\ No newline at end of file
diff --git a/nfc/1.0/default/OWNERS b/nfc/1.0/default/OWNERS
index 5febd1d..e681870 100644
--- a/nfc/1.0/default/OWNERS
+++ b/nfc/1.0/default/OWNERS
@@ -1,2 +1 @@
rmojumder@google.com
-zachoverflow@google.com
diff --git a/nfc/1.2/vts/OWNERS b/nfc/1.2/vts/OWNERS
index 21d4df1..eeeadd1 100644
--- a/nfc/1.2/vts/OWNERS
+++ b/nfc/1.2/vts/OWNERS
@@ -1,3 +1,2 @@
-zachoverflow@google.com
jackcwyu@google.com
georgekgchang@google.com
diff --git a/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp b/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
index 9c44c3a..d3fcbb3 100644
--- a/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
+++ b/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
@@ -153,8 +153,7 @@
SyncEventGuard guard(sNfaVsCommand);
sNfaVsCommand.notifyOne();
} break;
- case NCI_ANDROID_SET_PASSIVE_OBSERVER_TECH:
- case NCI_ANDROID_PASSIVE_OBSERVE: {
+ case NCI_ANDROID_SET_PASSIVE_OBSERVER_TECH: {
if (param_len == 5) {
if ((p_param[0] & NCI_MT_MASK) == (NCI_MT_RSP << NCI_MT_SHIFT)) {
sVSCmdStatus = p_param[4];
@@ -190,36 +189,6 @@
}
/*
- * Enable passive observe mode.
- */
-tNFA_STATUS static nfaObserveModeEnable(bool enable) {
- tNFA_STATUS status = NFA_STATUS_FAILED;
-
- status = NFA_StopRfDiscovery();
- if (status == NFA_STATUS_OK) {
- if (!sNfaEnableDisablePollingEvent.wait(1000)) {
- LOG(WARNING) << "Timeout waiting to disable NFC RF discovery";
- return NFA_STATUS_TIMEOUT;
- }
- }
-
- uint8_t cmd[] = {NCI_ANDROID_PASSIVE_OBSERVE,
- static_cast<uint8_t>(enable ? NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE
- : NCI_ANDROID_PASSIVE_OBSERVE_PARAM_DISABLE)};
-
- status = NFA_SendVsCommand(NCI_MSG_PROP_ANDROID, sizeof(cmd), cmd, nfaVSCallback);
-
- if (status == NFA_STATUS_OK) {
- if (!sNfaVsCommand.wait(1000)) {
- LOG(WARNING) << "Timeout waiting for set observe mode command response";
- return NFA_STATUS_TIMEOUT;
- }
- }
-
- return status;
-}
-
-/*
* Get observe mode state.
*/
tNFA_STATUS static nfaQueryObserveModeState() {
@@ -322,33 +291,6 @@
};
/*
- * ObserveModeEnableDisable:
- * Attempts to enable observe mode. Does not test Observe Mode functionality,
- * but simply verifies that the enable command responds successfully.
- *
- * @VsrTest = GMS-VSR-3.2.8-001
- */
-TEST_P(NfcBehaviorChanges, ObserveModeEnableDisable) {
- if (get_vsr_api_level() < 202404) {
- GTEST_SKIP() << "Skipping test for board API level < 202404";
- }
-
- tNFA_STATUS status = nfaObserveModeEnable(true);
- ASSERT_EQ(status, NFA_STATUS_OK);
-
- status = nfaQueryObserveModeState();
- ASSERT_EQ(status, NFA_STATUS_OK);
- ASSERT_NE(sObserveModeState, 0);
-
- status = nfaObserveModeEnable(false);
- ASSERT_EQ(status, NFA_STATUS_OK);
-
- status = nfaQueryObserveModeState();
- ASSERT_EQ(status, NFA_STATUS_OK);
- ASSERT_EQ(sObserveModeState, 0);
-}
-
-/*
* SetPassiveObserverTech_getCaps:
* Verifies GET_CAPS returns get correct value for observe mode capabilities.
*/
diff --git a/power/1.0/vts/OWNERS b/power/1.0/vts/OWNERS
index 6de2cd5..53948b9 100644
--- a/power/1.0/vts/OWNERS
+++ b/power/1.0/vts/OWNERS
@@ -1,2 +1 @@
# Bug component: 158088
-connoro@google.com
diff --git a/power/1.1/vts/functional/OWNERS b/power/1.1/vts/functional/OWNERS
index 6de2cd5..53948b9 100644
--- a/power/1.1/vts/functional/OWNERS
+++ b/power/1.1/vts/functional/OWNERS
@@ -1,2 +1 @@
# Bug component: 158088
-connoro@google.com
diff --git a/power/stats/1.0/default/OWNERS b/power/stats/1.0/default/OWNERS
index 2d95a97..0557220 100644
--- a/power/stats/1.0/default/OWNERS
+++ b/power/stats/1.0/default/OWNERS
@@ -1,3 +1,2 @@
krossmo@google.com
bsschwar@google.com
-tstrudel@google.com
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 5c1955a..ff231db 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -1020,6 +1020,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::SIM_ABSENT}));
@@ -1072,6 +1075,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_InvalidArgument, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
@@ -1138,6 +1144,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_InvalidInterval1, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
@@ -1172,6 +1181,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_InvalidInterval2, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
@@ -1206,6 +1218,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_InvalidMaxSearchTime1, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
@@ -1240,6 +1255,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_InvalidMaxSearchTime2, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
@@ -1274,6 +1292,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_InvalidPeriodicity1, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
@@ -1308,6 +1329,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_InvalidPeriodicity2, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
@@ -1342,6 +1366,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_GoodRequest1, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::NONE, RadioError::SIM_ABSENT}));
@@ -1382,6 +1409,9 @@
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
ALOGI("startNetworkScan_GoodRequest2, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping startNetworkScan because it's not supported";
+ }
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::NONE, RadioError::SIM_ABSENT}));
@@ -1418,7 +1448,8 @@
radioRsp_network->rspInfo.error,
{RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS,
RadioError::INVALID_STATE, RadioError::NO_MEMORY, RadioError::INTERNAL_ERR,
- RadioError::SYSTEM_ERR, RadioError::CANCELLED, RadioError::MODEM_ERR}));
+ RadioError::SYSTEM_ERR, RadioError::CANCELLED, RadioError::MODEM_ERR,
+ RadioError::REQUEST_NOT_SUPPORTED}));
}
/*
@@ -1435,6 +1466,9 @@
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ if (radioRsp_network->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping getBarringInfo because it's not supported";
+ }
ASSERT_TRUE(radioRsp_network->barringInfoList.size() > 0);
std::set<int> reportedServices;
diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp
index 138424c..e7c7c65 100644
--- a/radio/aidl/vts/radio_sim_test.cpp
+++ b/radio/aidl/vts/radio_sim_test.cpp
@@ -87,7 +87,12 @@
EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
{RadioError::NONE, RadioError::INVALID_ARGUMENTS,
- RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ERR}));
+ RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ERR,
+ RadioError::REQUEST_NOT_SUPPORTED}));
+
+ if (radioRsp_sim->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) {
+ GTEST_SKIP() << "Skipping setSimCardPower because it's not supported";
+ }
// setSimCardPower does not return until the request is handled, and should not trigger
// CardStatus::STATE_ABSENT when turning off power
@@ -667,7 +672,8 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_sim->rspInfo.error,
- {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE}));
+ {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE,
+ RadioError::REQUEST_NOT_SUPPORTED}));
}
}
}
@@ -728,7 +734,8 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_sim->rspInfo.error,
- {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE}));
+ {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE,
+ RadioError::REQUEST_NOT_SUPPORTED}));
}
}
}
diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
index 1908d05..0ae4b96 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
@@ -550,8 +550,14 @@
void deleteKey(in byte[] keyBlob);
/**
- * Deletes all keys in the hardware keystore. Used when keystore is reset completely. After
- * this function is called all keys created previously must be rendered permanently unusable.
+ * Deletes all keys in the hardware keystore. Used when keystore is reset completely.
+ *
+ * For StrongBox KeyMint: After this function is called all keys created previously must be
+ * rendered permanently unusable.
+ *
+ * For TEE KeyMint: After this function is called all keys with Tag::ROLLBACK_RESISTANCE in
+ * their hardware-enforced authorization lists must be rendered permanently unusable. Keys
+ * without Tag::ROLLBACK_RESISTANCE may or may not be rendered unusable.
*/
void deleteAllKeys();
diff --git a/security/secretkeeper/OWNERS b/security/secretkeeper/OWNERS
index acf4c6c..d63ba9b 100644
--- a/security/secretkeeper/OWNERS
+++ b/security/secretkeeper/OWNERS
@@ -1,6 +1,5 @@
# Bug component: 867125
-alanstokes@google.com
drysdale@google.com
hasinitg@google.com
shikhapanwar@google.com
diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl
index adaf8e6..bc1b4b2 100644
--- a/sensors/aidl/android/hardware/sensors/SensorType.aidl
+++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl
@@ -275,8 +275,9 @@
* than every period_ns passed to setDelay() or to batch().
* See the definition of the on-change reporting mode for more information.
*
- * SensorInfo.requiredPermission must be set to
- * SENSOR_PERMISSION_BODY_SENSORS.
+ * The framework will override the SensorInfo.requiredPermission to either
+ * SENSOR_PERMISSION_BODY_SENSORS or SENSOR_PERMISSION_READ_HEART_RATE
+ * depending on the platform SDK version in order to ensure compatibility.
*
* Both wake-up and non wake-up versions are useful.
*/
diff --git a/threadnetwork/aidl/default/Android.bp b/threadnetwork/aidl/default/Android.bp
index a840fa3..481f027 100644
--- a/threadnetwork/aidl/default/Android.bp
+++ b/threadnetwork/aidl/default/Android.bp
@@ -45,6 +45,41 @@
],
}
+cc_library_static {
+ name: "android.hardware.threadnetwork.lib",
+
+ vendor: true,
+ export_include_dirs: ["."],
+
+ defaults: ["android.hardware.threadnetwork-service.defaults"],
+
+ srcs: [
+ "service.cpp",
+ "thread_chip.cpp",
+ "utils.cpp",
+ ],
+
+ shared_libs: [
+ "libbinder_ndk",
+ "liblog",
+ ],
+
+ static_libs: [
+ "android.hardware.threadnetwork-V1-ndk",
+ "libbase",
+ "libcutils",
+ "libutils",
+ "openthread-common",
+ "openthread-hdlc",
+ "openthread-platform",
+ "openthread-posix",
+ "openthread-spi",
+ "openthread-url",
+ ],
+
+ stl: "c++_static",
+}
+
cc_defaults {
name: "android.hardware.threadnetwork-service.defaults",
product_variables: {
diff --git a/threadnetwork/aidl/default/thread_chip.cpp b/threadnetwork/aidl/default/thread_chip.cpp
index e312728..ba0baf2 100644
--- a/threadnetwork/aidl/default/thread_chip.cpp
+++ b/threadnetwork/aidl/default/thread_chip.cpp
@@ -83,6 +83,11 @@
mRxFrameBuffer.GetFrame(), mRxFrameBuffer.GetFrame() + mRxFrameBuffer.GetLength()));
}
+ if (mVendorCallback != nullptr) {
+ mVendorCallback->onReceiveSpinelFrame(std::vector<uint8_t>(
+ mRxFrameBuffer.GetFrame(), mRxFrameBuffer.GetFrame() + mRxFrameBuffer.GetLength()));
+ }
+
mRxFrameBuffer.DiscardFrame();
}
@@ -193,6 +198,10 @@
}
}
+void ThreadChip::setVendorCallback(const std::shared_ptr<IThreadChipCallback>& vendorCallback) {
+ mVendorCallback = vendorCallback;
+}
+
ndk::ScopedAStatus ThreadChip::errorStatus(int32_t error, const char* message) {
return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(error, message));
}
diff --git a/threadnetwork/aidl/default/thread_chip.hpp b/threadnetwork/aidl/default/thread_chip.hpp
index d07d049..6f23efe 100644
--- a/threadnetwork/aidl/default/thread_chip.hpp
+++ b/threadnetwork/aidl/default/thread_chip.hpp
@@ -43,6 +43,7 @@
ndk::ScopedAStatus hardwareReset() override;
void Update(otSysMainloopContext& context) override;
void Process(const otSysMainloopContext& context) override;
+ void setVendorCallback(const std::shared_ptr<IThreadChipCallback>& vendorCallback);
private:
static void onBinderDiedJump(void* context);
@@ -59,6 +60,7 @@
std::shared_ptr<ot::Spinel::SpinelInterface> mSpinelInterface;
ot::Spinel::SpinelInterface::RxFrameBuffer mRxFrameBuffer;
std::shared_ptr<IThreadChipCallback> mCallback;
+ std::shared_ptr<IThreadChipCallback> mVendorCallback;
::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient;
};
diff --git a/wifi/OWNERS b/wifi/OWNERS
index c10bbab..ec21f2e 100644
--- a/wifi/OWNERS
+++ b/wifi/OWNERS
@@ -7,4 +7,3 @@
# This will get them auto-assigned to the on-call triage engineer, ensuring quickest response.
#
arabawy@google.com
-etancohen@google.com
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index 6c7ae09..8bc9d1a 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -3895,12 +3895,13 @@
return false;
}
*aidl_scan_result = {};
- aidl_scan_result->timeStampInUs =
- ts_us - (static_cast<uint64_t>(legacy_scan_result.age_ms) * 1000);
- if (aidl_scan_result->timeStampInUs < 0) {
+ // Ensure that subtracting does not result in a negative value
+ uint64_t age_us = static_cast<uint64_t>(legacy_scan_result.age_ms) * 1000;
+ if (ts_us < age_us) {
aidl_scan_result->timeStampInUs = 0;
return false;
}
+ aidl_scan_result->timeStampInUs = ts_us - age_us;
size_t max_len_excluding_null = sizeof(legacy_scan_result.ssid) - 1;
size_t ssid_len = strnlen((const char*)legacy_scan_result.ssid, max_len_excluding_null);
aidl_scan_result->ssid =