Merge "wifi: New wifi SAR design for the CAP sensor device" into main
diff --git a/audio/aidl/default/alsa/StreamAlsa.cpp b/audio/aidl/default/alsa/StreamAlsa.cpp
index 114c4c0..210c26b 100644
--- a/audio/aidl/default/alsa/StreamAlsa.cpp
+++ b/audio/aidl/default/alsa/StreamAlsa.cpp
@@ -280,13 +280,22 @@
const size_t bufferSize = mBufferSizeFrames * mFrameSizeBytes;
std::vector<char> buffer(bufferSize);
while (mIoThreadIsRunning) {
- ssize_t framesRead = mSources[idx]->read(&buffer[0], mBufferSizeFrames);
- if (framesRead > 0) {
+ ssize_t framesReadOrError = mSources[idx]->read(&buffer[0], mBufferSizeFrames);
+ if (framesReadOrError > 0) {
int ret = proxy_write_with_retries(mAlsaDeviceProxies[idx].get(), &buffer[0],
- framesRead * mFrameSizeBytes, mReadWriteRetries);
+ framesReadOrError * mFrameSizeBytes,
+ mReadWriteRetries);
// Errors when the stream is being stopped are expected.
LOG_IF(WARNING, ret != 0 && mIoThreadIsRunning)
<< __func__ << "[" << idx << "]: Error writing into ALSA: " << ret;
+ } else if (framesReadOrError == 0) {
+ // MonoPipeReader does not have a blocking read, while use of std::condition_variable
+ // requires use of a mutex. For now, just do a 1ms sleep. Consider using a different
+ // pipe / ring buffer mechanism.
+ if (mIoThreadIsRunning) usleep(1000);
+ } else {
+ LOG(WARNING) << __func__ << "[" << idx
+ << "]: Error while reading from the pipe: " << framesReadOrError;
}
}
}
diff --git a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
index cef0ea6..f8ead16 100644
--- a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
+++ b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
@@ -283,6 +283,15 @@
}
return ::android::OK;
}
+ // get and hold the sink because 'MonoPipeReader' does not hold a strong pointer to it.
+ sp<MonoPipe> sink = mCurrentRoute->getSink();
+ if (sink == nullptr) {
+ if (++mReadErrorCount < kMaxErrorLogs) {
+ LOG(ERROR) << __func__
+ << ": the sink has been released! (not all errors will be logged)";
+ }
+ return ::android::OK;
+ }
mReadErrorCount = 0;
LOG(VERBOSE) << __func__ << ": " << mDeviceAddress.toString() << ", " << frameCount
diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h
index 5c75e48..e334ee9 100644
--- a/audio/aidl/vts/EffectHelper.h
+++ b/audio/aidl/vts/EffectHelper.h
@@ -88,6 +88,7 @@
static constexpr int kNPointFFT = 16384;
static constexpr int kSamplingFrequency = 44100;
static constexpr int kDefaultChannelLayout = AudioChannelLayout::LAYOUT_STEREO;
+static constexpr float kLn10Div20 = -0.11512925f; // -ln(10)/20
class EffectHelper {
public:
@@ -595,6 +596,8 @@
}
}
+ constexpr float dBToAmplitude(float dB) { return std::exp(dB * kLn10Div20); }
+
static int getHalVersion(const std::shared_ptr<IEffect>& effect) {
int version = 0;
return (effect && effect->getInterfaceVersion(&version).isOk()) ? version : 0;
diff --git a/audio/aidl/vts/TestUtils.h b/audio/aidl/vts/TestUtils.h
index 3a6c137..9ebdc6e 100644
--- a/audio/aidl/vts/TestUtils.h
+++ b/audio/aidl/vts/TestUtils.h
@@ -124,3 +124,30 @@
EXPECT_PRED_FORMAT2( \
::android::hardware::audio::common::testing::detail::assertResultOrUnknownTransaction, \
expected, ret)
+
+namespace android::hardware::audio::common::testing::detail {
+
+template <typename>
+struct mf_traits {};
+template <class T, class U>
+struct mf_traits<U T::*> {
+ using member_type = U;
+};
+
+} // namespace android::hardware::audio::common::testing::detail
+
+namespace aidl::android::media::audio::common {
+
+template <typename P>
+std::enable_if_t<std::is_function_v<typename ::android::hardware::audio::common::testing::detail::
+ mf_traits<decltype(&P::toString)>::member_type>,
+ std::ostream&>
+operator<<(std::ostream& os, const P& p) {
+ return os << p.toString();
+}
+template <typename E>
+std::enable_if_t<std::is_enum_v<E>, std::ostream&> operator<<(std::ostream& os, const E& e) {
+ return os << toString(e);
+}
+
+} // namespace aidl::android::media::audio::common
diff --git a/audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp
index eaec88b..7b15e5e 100644
--- a/audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp
@@ -341,7 +341,7 @@
auto values = criterionV2.values;
auto valueIt = find_if(values.begin(), values.end(),
[&](const auto& typedValue) { return typedValue == value; });
- EXPECT_NE(valueIt, values.end());
+ EXPECT_NE(valueIt, values.end()) << "Not found: \"" << value << "\"";
}
/**
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 70790c4..95bcaf0 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -788,9 +788,10 @@
void SetUp() override {
SetUpDynamicsProcessingEffect();
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
- ASSERT_NO_FATAL_FAILURE(generateSineWave(1000 /*Input Frequency*/, mInput, 1.0,
- kSamplingFrequency, mChannelLayout));
+ ASSERT_NO_FATAL_FAILURE(
+ generateSineWave(kInputFrequency, mInput, 1.0, kSamplingFrequency, mChannelLayout));
mInputDb = calculateDb(mInput);
+ ASSERT_NEAR(mInputDb, kSineFullScaleDb, kToleranceDb);
}
void TearDown() override { TearDownDynamicsProcessingEffect(); }
@@ -823,6 +824,9 @@
static constexpr float kDefaultRatio = 4;
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;
std::vector<DynamicsProcessing::LimiterConfig> mLimiterConfigList;
std::vector<float> mInput;
float mInputDb;
@@ -887,9 +891,13 @@
std::vector<float> output(mInput.size());
for (float postGainDb : postGainDbValues) {
cleanUpLimiterConfig();
+ ASSERT_NO_FATAL_FAILURE(generateSineWave(kInputFrequency, mInput, dBToAmplitude(postGainDb),
+ kSamplingFrequency, mChannelLayout));
+ mInputDb = calculateDb(mInput);
+ EXPECT_NEAR(mInputDb, kSineFullScaleDb - postGainDb, kToleranceDb);
for (int i = 0; i < mChannelCount; i++) {
fillLimiterConfig(mLimiterConfigList, i, true, kDefaultLinkerGroup, kDefaultAttackTime,
- kDefaultReleaseTime, kDefaultRatio, -1, postGainDb);
+ kDefaultReleaseTime, 1, kDefaultThreshold, postGainDb);
}
ASSERT_NO_FATAL_FAILURE(setLimiterParamsAndProcess(mInput, output));
if (!isAllParamsValid()) {
@@ -1075,7 +1083,12 @@
{2, 6000},
{3, 10000},
{4, 16000},
- }, // 5 bands
+ {5, 20000},
+ {6, 26000},
+ {7, 30000},
+ {8, 36000},
+ {9, 40000},
+ }, // 10 bands
{
{0, 800},
{3, 15000},
@@ -1255,6 +1268,7 @@
ASSERT_NO_FATAL_FAILURE(generateSineWave(mTestFrequencies, mInput, 1.0, kSamplingFrequency,
mChannelLayout));
mInputDb = calculateDb(mInput);
+ ASSERT_NEAR(mInputDb, kFullScaleDb, kToleranceDb);
}
void TearDown() override { TearDownDynamicsProcessingEffect(); }
@@ -1267,12 +1281,7 @@
addEngineConfig(mEngineConfigPreset);
addMbcChannelConfig(mChannelConfig);
addMbcBandConfigs(mCfgs);
-
- if (isAllParamsValid()) {
- ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
- ASSERT_NO_FATAL_FAILURE(
- processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
- }
+ ASSERT_NO_FATAL_FAILURE(setParamsAndProcess(mInput, output));
}
void fillMbcBandConfig(std::vector<DynamicsProcessing::MbcBandConfig>& cfgs, int channelIndex,
@@ -1387,9 +1396,9 @@
std::vector<float> postGainDbValues = {-55, -30, 0, 30, 55};
std::vector<float> output(mInput.size());
for (float postGainDb : postGainDbValues) {
- float amplitude = 1.0 / (pow(10, postGainDb / 20));
- ASSERT_NO_FATAL_FAILURE(generateSineWave(mTestFrequencies, mInput, amplitude,
- kSamplingFrequency, mChannelLayout));
+ ASSERT_NO_FATAL_FAILURE(generateSineWave(mTestFrequencies, mInput,
+ dBToAmplitude(postGainDb), kSamplingFrequency,
+ mChannelLayout));
mInputDb = calculateDb(mInput);
EXPECT_NEAR(mInputDb, kFullScaleDb - postGainDb, kToleranceDb);
cleanUpMbcConfig();
diff --git a/audio/effect/all-versions/default/Android.bp b/audio/effect/all-versions/default/Android.bp
index cea085c..095bb86 100644
--- a/audio/effect/all-versions/default/Android.bp
+++ b/audio/effect/all-versions/default/Android.bp
@@ -52,6 +52,12 @@
"libmedia_headers",
"libmediautils_headers",
],
+
+ cflags: [
+ "-Wall",
+ "-Wthread-safety",
+ "-Werror",
+ ],
}
cc_library_shared {
diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp
index 4a9e144..9896653 100644
--- a/audio/effect/all-versions/default/Effect.cpp
+++ b/audio/effect/all-versions/default/Effect.cpp
@@ -321,8 +321,8 @@
status_t status = mProcessThread->join();
ALOGE_IF(status, "processing thread exit error: %s", strerror(-status));
}
- if (mEfGroup) {
- status_t status = EventFlag::deleteEventFlag(&mEfGroup);
+ if (EventFlag* evFlag = mEfGroup.load(std::memory_order_acquire)) {
+ status_t status = EventFlag::deleteEventFlag(&evFlag);
ALOGE_IF(status, "processing MQ event flag deletion error: %s", strerror(-status));
}
mInBuffer.clear();
@@ -437,6 +437,7 @@
Result Effect::analyzeStatus(const char* funcName, const char* subFuncName,
const char* contextDescription, status_t status) {
if (status != OK) {
+ std::lock_guard<std::mutex> lock(mLock);
ALOGW("Effect %p %s %s %s: %s", mHandle, funcName, subFuncName, contextDescription,
strerror(-status));
}
@@ -470,11 +471,14 @@
Return<void> Effect::getConfigImpl(int commandCode, const char* commandName,
GetConfigCallback _hidl_cb) {
- RETURN_RESULT_IF_EFFECT_CLOSED(EffectConfig());
uint32_t halResultSize = sizeof(effect_config_t);
effect_config_t halConfig{};
- status_t status =
- (*mHandle)->command(mHandle, commandCode, 0, NULL, &halResultSize, &halConfig);
+ status_t status = OK;
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_RESULT_IF_EFFECT_CLOSED(EffectConfig());
+ status = (*mHandle)->command(mHandle, commandCode, 0, NULL, &halResultSize, &halConfig);
+ }
EffectConfig config;
if (status == OK) {
status = EffectUtils::effectConfigFromHal(halConfig, mIsInput, &config);
@@ -542,7 +546,10 @@
}
Return<void> Effect::prepareForProcessing(prepareForProcessing_cb _hidl_cb) {
- RETURN_RESULT_IF_EFFECT_CLOSED(StatusMQ::Descriptor());
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_RESULT_IF_EFFECT_CLOSED(StatusMQ::Descriptor());
+ }
status_t status;
// Create message queue.
if (mStatusMQ) {
@@ -556,16 +563,21 @@
_hidl_cb(Result::INVALID_ARGUMENTS, StatusMQ::Descriptor());
return Void();
}
- status = EventFlag::createEventFlag(tempStatusMQ->getEventFlagWord(), &mEfGroup);
- if (status != OK || !mEfGroup) {
+ EventFlag* evFlag = nullptr;
+ status = EventFlag::createEventFlag(tempStatusMQ->getEventFlagWord(), &evFlag);
+ if (status != OK || !evFlag) {
ALOGE("failed creating event flag for status MQ: %s", strerror(-status));
_hidl_cb(Result::INVALID_ARGUMENTS, StatusMQ::Descriptor());
return Void();
}
+ mEfGroup.store(evFlag, std::memory_order_release);
- // Create and launch the thread.
- mProcessThread = new ProcessThread(&mStopProcessThread, mHandle, &mHalInBufferPtr,
- &mHalOutBufferPtr, tempStatusMQ.get(), mEfGroup, this);
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ // Create and launch the thread.
+ mProcessThread = new ProcessThread(&mStopProcessThread, mHandle, &mHalInBufferPtr,
+ &mHalOutBufferPtr, tempStatusMQ.get(), evFlag, this);
+ }
status = mProcessThread->run("effect", PRIORITY_URGENT_AUDIO);
if (status != OK) {
ALOGW("failed to start effect processing thread: %s", strerror(-status));
@@ -575,11 +587,15 @@
// For a spatializer effect, we perform scheduler adjustments to reduce glitches and power.
// We do it here instead of the ProcessThread::threadLoop to ensure that mHandle is valid.
- if (effect_descriptor_t halDescriptor{};
- (*mHandle)->get_descriptor(mHandle, &halDescriptor) == NO_ERROR &&
- memcmp(&halDescriptor.type, FX_IID_SPATIALIZER, sizeof(effect_uuid_t)) == 0) {
- const status_t status = scheduler::updateSpatializerPriority(mProcessThread->getTid());
- ALOGW_IF(status != OK, "Failed to update Spatializer priority");
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_RESULT_IF_EFFECT_CLOSED(StatusMQ::Descriptor());
+ if (effect_descriptor_t halDescriptor{};
+ (*mHandle)->get_descriptor(mHandle, &halDescriptor) == NO_ERROR &&
+ memcmp(&halDescriptor.type, FX_IID_SPATIALIZER, sizeof(effect_uuid_t)) == 0) {
+ const status_t status = scheduler::updateSpatializerPriority(mProcessThread->getTid());
+ ALOGW_IF(status != OK, "Failed to update Spatializer priority");
+ }
}
mStatusMQ = std::move(tempStatusMQ);
@@ -589,7 +605,10 @@
Return<Result> Effect::setProcessBuffers(const AudioBuffer& inBuffer,
const AudioBuffer& outBuffer) {
- RETURN_IF_EFFECT_CLOSED();
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_IF_EFFECT_CLOSED();
+ }
AudioBufferManager& manager = AudioBufferManager::getInstance();
sp<AudioBufferWrapper> tempInBuffer, tempOutBuffer;
if (!manager.wrap(inBuffer, &tempInBuffer)) {
@@ -614,8 +633,12 @@
}
Result Effect::sendCommand(int commandCode, const char* commandName, uint32_t size, void* data) {
- RETURN_IF_EFFECT_CLOSED();
- status_t status = (*mHandle)->command(mHandle, commandCode, size, data, 0, NULL);
+ status_t status = OK;
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_IF_EFFECT_CLOSED();
+ status = (*mHandle)->command(mHandle, commandCode, size, data, 0, NULL);
+ }
return analyzeCommandStatus(commandName, sContextCallToCommand, status);
}
@@ -626,9 +649,13 @@
Result Effect::sendCommandReturningData(int commandCode, const char* commandName, uint32_t size,
void* data, uint32_t* replySize, void* replyData) {
- RETURN_IF_EFFECT_CLOSED();
uint32_t expectedReplySize = *replySize;
- status_t status = (*mHandle)->command(mHandle, commandCode, size, data, replySize, replyData);
+ status_t status = OK;
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_IF_EFFECT_CLOSED();
+ status = (*mHandle)->command(mHandle, commandCode, size, data, replySize, replyData);
+ }
if (status == OK && *replySize != expectedReplySize) {
status = -ENODATA;
}
@@ -651,8 +678,12 @@
uint32_t size, void* data, uint32_t* replySize,
void* replyData, uint32_t minReplySize,
CommandSuccessCallback onSuccess) {
- RETURN_IF_EFFECT_CLOSED();
- status_t status = (*mHandle)->command(mHandle, commandCode, size, data, replySize, replyData);
+ status_t status = OK;
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_IF_EFFECT_CLOSED();
+ status = (*mHandle)->command(mHandle, commandCode, size, data, replySize, replyData);
+ }
Result retval;
if (status == OK && minReplySize >= sizeof(uint32_t) && *replySize >= minReplySize) {
uint32_t commandStatus = *reinterpret_cast<uint32_t*>(replyData);
@@ -860,10 +891,14 @@
}
Return<void> Effect::getDescriptor(getDescriptor_cb _hidl_cb) {
- RETURN_RESULT_IF_EFFECT_CLOSED(EffectDescriptor());
effect_descriptor_t halDescriptor;
memset(&halDescriptor, 0, sizeof(effect_descriptor_t));
- status_t status = (*mHandle)->get_descriptor(mHandle, &halDescriptor);
+ status_t status = OK;
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_RESULT_IF_EFFECT_CLOSED(EffectDescriptor());
+ status = (*mHandle)->get_descriptor(mHandle, &halDescriptor);
+ }
EffectDescriptor descriptor;
if (status == OK) {
status = EffectUtils::effectDescriptorFromHal(halDescriptor, &descriptor);
@@ -874,10 +909,6 @@
Return<void> Effect::command(uint32_t commandId, const hidl_vec<uint8_t>& data,
uint32_t resultMaxSize, command_cb _hidl_cb) {
- if (mHandle == kInvalidEffectHandle) {
- _hidl_cb(-ENODATA, hidl_vec<uint8_t>());
- return Void();
- }
uint32_t halDataSize;
std::unique_ptr<uint8_t[]> halData = hidlVecToHal(data, &halDataSize);
uint32_t halResultSize = resultMaxSize;
@@ -897,8 +928,15 @@
}
[[fallthrough]]; // allow 'gtid' overload (checked halDataSize and resultMaxSize).
default:
- status = (*mHandle)->command(mHandle, commandId, halDataSize, dataPtr, &halResultSize,
- resultPtr);
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ if (mHandle == kInvalidEffectHandle) {
+ _hidl_cb(-ENODATA, hidl_vec<uint8_t>());
+ return Void();
+ }
+ status = (*mHandle)->command(mHandle, commandId, halDataSize, dataPtr,
+ &halResultSize, resultPtr);
+ }
break;
}
hidl_vec<uint8_t> result;
@@ -967,11 +1005,17 @@
return {Result::INVALID_STATE, kInvalidEffectHandle};
}
mStopProcessThread.store(true, std::memory_order_release);
- if (mEfGroup) {
- mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_QUIT));
+ EventFlag* evFlag = mEfGroup.load(std::memory_order_acquire);
+ if (evFlag) {
+ evFlag->wake(static_cast<uint32_t>(
+ MessageQueueFlagBits::REQUEST_QUIT));
}
- effect_handle_t handle = mHandle;
- mHandle = kInvalidEffectHandle;
+ effect_handle_t handle;
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ handle = mHandle;
+ mHandle = kInvalidEffectHandle;
+ }
#if MAJOR_VERSION <= 5
return {Result::OK, handle};
#elif MAJOR_VERSION >= 6
@@ -984,7 +1028,10 @@
}
Return<Result> Effect::close() {
- RETURN_IF_EFFECT_CLOSED();
+ {
+ std::lock_guard<std::mutex> lock(mLock);
+ RETURN_IF_EFFECT_CLOSED();
+ }
auto [result, _] = closeImpl();
return result;
}
diff --git a/audio/effect/all-versions/default/Effect.h b/audio/effect/all-versions/default/Effect.h
index 2bcecec..cc76784 100644
--- a/audio/effect/all-versions/default/Effect.h
+++ b/audio/effect/all-versions/default/Effect.h
@@ -25,6 +25,7 @@
#include <memory>
#include <tuple>
#include <vector>
+#include <mutex>
#include <fmq/EventFlag.h>
#include <fmq/MessageQueue.h>
@@ -194,13 +195,14 @@
static const char* sContextCallFunction;
const bool mIsInput;
- effect_handle_t mHandle;
+ std::mutex mLock;
+ effect_handle_t mHandle GUARDED_BY(mLock);
sp<AudioBufferWrapper> mInBuffer;
sp<AudioBufferWrapper> mOutBuffer;
std::atomic<audio_buffer_t*> mHalInBufferPtr;
std::atomic<audio_buffer_t*> mHalOutBufferPtr;
std::unique_ptr<StatusMQ> mStatusMQ;
- EventFlag* mEfGroup;
+ std::atomic<EventFlag*> mEfGroup;
std::atomic<bool> mStopProcessThread;
sp<Thread> mProcessThread;
diff --git a/automotive/TEST_MAPPING b/automotive/TEST_MAPPING
index 2b2f6b0..f041ca6 100644
--- a/automotive/TEST_MAPPING
+++ b/automotive/TEST_MAPPING
@@ -4,6 +4,12 @@
"name": "AndroidCarApiTest"
},
{
+ "name": "CarHiddenApiTest"
+ },
+ {
+ "name": "CarExtendedApiTest"
+ },
+ {
"name": "CarSecurityPermissionTest"
},
{
diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING
index 56bc047..de59fdc 100644
--- a/automotive/vehicle/TEST_MAPPING
+++ b/automotive/vehicle/TEST_MAPPING
@@ -52,6 +52,9 @@
},
{
"name": "VehicleHalProtoMessageConverterTest"
+ },
+ {
+ "name": "CtsCarTestCases"
}
],
"postsubmit": [
diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp
index d3ce307..1419455 100644
--- a/automotive/vehicle/aidl/aidl_test/Android.bp
+++ b/automotive/vehicle/aidl/aidl_test/Android.bp
@@ -44,6 +44,7 @@
srcs: ["VehiclePropertyAnnotationCppTest.cpp"],
header_libs: ["IVehicleGeneratedHeaders-V4"],
static_libs: [
+ "VehicleHalUtils",
"libgtest",
"libgmock",
],
diff --git a/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp b/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp
index dd82d1b..d982caf 100644
--- a/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp
+++ b/automotive/vehicle/aidl/aidl_test/VehiclePropertyAnnotationCppTest.cpp
@@ -17,6 +17,8 @@
#include <AccessForVehicleProperty.h>
#include <AnnotationsForVehicleProperty.h>
#include <ChangeModeForVehicleProperty.h>
+#include <EnumForVehicleProperty.h>
+#include <VehicleHalTypes.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
#include <gmock/gmock.h>
@@ -73,3 +75,16 @@
<< " must not be empty";
}
}
+
+TEST(VehiclePropertyAnnotationCppTest, testSupportedEnums) {
+ auto supportedEnums =
+ aidl_vehicle::getSupportedEnumValuesForProperty(VehicleProperty::INFO_FUEL_TYPE);
+ // We only listed part of the fuel type values here. This is enough to verify that the
+ // generated code is correct.
+ ASSERT_THAT(supportedEnums,
+ ::testing::IsSupersetOf(
+ {static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_UNLEADED),
+ static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_LEADED),
+ static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_DIESEL_1),
+ static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_DIESEL_2)}));
+}
diff --git a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
index 2867aa2..92681de 100644
--- a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
+++ b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
@@ -388,13 +388,13 @@
"description": "Fan speed setting\nThe maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. All integers between minInt32Value and maxInt32Value must be supported.\nThe minInt32Value indicates the lowest fan speed.\nThe maxInt32Value indicates the highest fan speed.\nIf {@code HasSupportedValueInfo} for a specific area ID is not {@code null}: {@code HasSupportedValueInfo#hasMinSupportedValue} and {@code HasSupportedValueInfo#hasMaxSupportedValue} must be {@code true} for the specific area ID. {@code MinMaxSupportedValueResult#minSupportedValue} has the same meaning as minInt32Value. {@code MinMaxSupportedValueResult#maxSupportedValue} has the same meaning as maxInt32Value. All integers between minSupportedValue and maxSupportedValue must be supported. At boot, minInt32Value is equal to minSupportedValue, maxInt32Value is equal to maxSupportedValue.\nThis property is not in any particular unit but in a specified range of relative speeds.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
- "name": "Fan direction setting",
+ "name": "HVAC_FAN_DIRECTION",
"value": 356517121,
"data_enums": [
"VehicleHvacFanDirection"
],
"data_enum": "VehicleHvacFanDirection",
- "description": "Fan direction setting\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only.\nThe supported hvac fan direction is exposed through {@code HVAC_FAN_DIRECTION_AVAILABLE} property. Caller should not call {@code getSupportedValuesList}, or use {@code VehicleAreaConfig#supportedEnumValues}."
+ "description": "The current HVAC fan direction setting\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only.\nThe supported hvac fan direction is exposed through {@code HVAC_FAN_DIRECTION_AVAILABLE} property. Caller should not call {@code getSupportedValuesList}, or use {@code VehicleAreaConfig#supportedEnumValues}.\nThis property must be supported if {@code HVAC_FAN_DIRECTION_AVAILABLE} is implemented on the vehicle, and vice versa."
},
{
"name": "HVAC current temperature.",
@@ -476,13 +476,13 @@
"description": "Represents global power state for HVAC. Setting this property to false MAY mark some properties that control individual HVAC features\/subsystems to UNAVAILABLE state. Setting this property to true MAY mark some properties that control individual HVAC features\/subsystems to AVAILABLE state (unless any\/all of them are UNAVAILABLE on their own individual merits).\n[Definition] HvacPower_DependentProperties: Properties that need HVAC to be powered on in order to enable their functionality. For example, in some cars, in order to turn on the AC, HVAC must be powered on first.\nHvacPower_DependentProperties list must be set in the VehiclePropConfig.configArray. HvacPower_DependentProperties must only contain properties that are associated with VehicleArea:SEAT. Properties that are not associated with VehicleArea:SEAT, for example, HVAC_DEFROSTER, must never depend on HVAC_POWER_ON property and must never be part of HvacPower_DependentProperties list.\nAreaID mapping for HVAC_POWER_ON property must contain all AreaIDs that HvacPower_DependentProperties are mapped to.\nExample 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). If the HVAC features (AC, Temperature etc.) throughout the car are dependent on a single HVAC power controller then HVAC_POWER_ON must be mapped to [ROW_1_LEFT | ROW_1_RIGHT | ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT].\nExample 2: A car has two seats in the front row (ROW_1_LEFT, ROW_1_RIGHT) and three seats in the second (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT) and third rows (ROW_3_LEFT, ROW_3_CENTER, ROW_3_RIGHT). If the car has temperature controllers in the front row which can operate entirely independently of temperature controllers in the back of the vehicle, then HVAC_POWER_ON must be mapped to a two element array: - ROW_1_LEFT | ROW_1_RIGHT - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
- "name": "Fan Positions Available",
+ "name": "HVAC_FAN_DIRECTION_AVAILABLE",
"value": 356582673,
"data_enums": [
"VehicleHvacFanDirection"
],
"data_enum": "VehicleHvacFanDirection",
- "description": "Fan Positions Available\nThis is a bit mask of fan positions available for the zone. Each available fan direction is denoted by a separate entry in the vector. A fan direction may have multiple bits from vehicle_hvac_fan_direction set. For instance, a typical car may have the following fan positions: - FAN_DIRECTION_FACE (0x1) - FAN_DIRECTION_FLOOR (0x2) - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3) - FAN_DIRECTION_DEFROST (0x4) - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6)"
+ "description": "List of supported fan directions in the vehicle.\nThis is a bit mask of the supported fan positions available each area ID. Each supported fan direction is denoted by a separate entry in the vector. A fan direction may have multiple bits from vehicle_hvac_fan_direction set. For instance, a typical car may have the following fan positions: - FAN_DIRECTION_FACE (0x1) - FAN_DIRECTION_FLOOR (0x2) - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3) - FAN_DIRECTION_DEFROST (0x4) - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6)\nThis property must be supported if {@code #HVAC_FAN_DIRECTION} is implemented on the vehicle, and vice versa."
},
{
"name": "Automatic recirculation on\/off",
@@ -1339,7 +1339,7 @@
{
"name": "EV_CHARGE_CURRENT_DRAW_LIMIT",
"value": 291508031,
- "description": "Indicates the maximum current draw threshold for charging set by the user\nconfigArray[0] is used to specify the max current draw allowed by the vehicle in Amperes at boot time.\nIf {@code HasSupportedValueInfo} for the global area ID (0) is not {@code null}, {@code HasSupportedValueInfo#hasMaxSupportedValue} and {@code HasSupportedValueInfo#hasMinSupportedValue} must be {@code true}. {@code MinMaxSupportedValueResult#maxSupportedValue} specifies the max current draw allowed by the vehicle in Amperes at the current moment. {@code MinMaxSupportedValueResult#minSupportedValue} must be 0. At boot, configArray[0] is equal to maxSupportedValue.\nIf the max current draw allowed by the vehicle may change dynamically, {@code HasSupportedValueInfo#hasMaxSupportedValue} must be {@code true} and {@code MinMaxSupportedValueResult#maxSupportedValue} must be implemented.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
+ "description": "The vehicle's selected alternating current (AC) EV charging draw limit in Amperes.\nconfigArray[0] is used to specify the max current draw allowed by the vehicle in Amperes at boot time.\nIf {@code HasSupportedValueInfo} for the global area ID (0) is not {@code null}, {@code HasSupportedValueInfo#hasMaxSupportedValue} and {@code HasSupportedValueInfo#hasMinSupportedValue} must be {@code true}. {@code MinMaxSupportedValueResult#maxSupportedValue} specifies the max current draw allowed by the vehicle in Amperes at the current moment. {@code MinMaxSupportedValueResult#minSupportedValue} must be 0. At boot, configArray[0] is equal to maxSupportedValue.\nIf the max current draw allowed by the vehicle may change dynamically, {@code HasSupportedValueInfo#hasMaxSupportedValue} must be {@code true} and {@code MinMaxSupportedValueResult#maxSupportedValue} must be implemented.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
"name": "EV_CHARGE_PERCENT_LIMIT",
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h
index eea1c5c..e645b7c 100644
--- a/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/AnnotationsForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/AnnotationsForVehicleProperty.h
index 27301a5..5b6048a 100644
--- a/automotive/vehicle/aidl/generated_lib/4/cpp/AnnotationsForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/AnnotationsForVehicleProperty.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h
index b353ab9..ca07ecf 100644
--- a/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/EnumForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/EnumForVehicleProperty.h
new file mode 100644
index 0000000..5afe069
--- /dev/null
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/EnumForVehicleProperty.h
@@ -0,0 +1,313 @@
+/*
+ * 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.
+ */
+
+/**
+ * DO NOT EDIT MANUALLY!!!
+ *
+ * Generated by tools/generate_annotation_enums.py.
+ */
+
+// clang-format off
+
+#pragma once
+
+#define addSupportedValues(EnumType) \
+{ \
+constexpr auto values = ndk::internal::enum_values<EnumType>; \
+for (size_t i = 0; i < values.size(); i++) { \
+ supportedValues.insert(static_cast<int64_t>(values[i])); \
+} \
+}
+
+#include <VehicleHalTypes.h>
+#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
+
+#include <unordered_set>
+
+namespace aidl::android::hardware::automotive::vehicle {
+std::unordered_set<int64_t> getSupportedEnumValuesForProperty(VehicleProperty propertyId) {
+ std::unordered_set<int64_t> supportedValues;
+ switch (propertyId) {
+ case VehicleProperty::INFO_FUEL_TYPE:
+ addSupportedValues(FuelType)
+ break;
+ case VehicleProperty::INFO_EV_CONNECTOR_TYPE:
+ addSupportedValues(EvConnectorType)
+ break;
+ case VehicleProperty::INFO_FUEL_DOOR_LOCATION:
+ addSupportedValues(PortLocationType)
+ break;
+ case VehicleProperty::INFO_EV_PORT_LOCATION:
+ addSupportedValues(PortLocationType)
+ break;
+ case VehicleProperty::INFO_DRIVER_SEAT:
+ addSupportedValues(VehicleAreaSeat)
+ break;
+ case VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS:
+ addSupportedValues(PortLocationType)
+ break;
+ case VehicleProperty::INFO_VEHICLE_SIZE_CLASS:
+ addSupportedValues(VehicleSizeClass)
+ break;
+ case VehicleProperty::ENGINE_OIL_LEVEL:
+ addSupportedValues(VehicleOilLevel)
+ break;
+ case VehicleProperty::IMPACT_DETECTED:
+ addSupportedValues(ImpactSensorLocation)
+ break;
+ case VehicleProperty::GEAR_SELECTION:
+ addSupportedValues(VehicleGear)
+ break;
+ case VehicleProperty::CURRENT_GEAR:
+ addSupportedValues(VehicleGear)
+ break;
+ case VehicleProperty::TURN_SIGNAL_STATE:
+ addSupportedValues(VehicleTurnSignal)
+ break;
+ case VehicleProperty::IGNITION_STATE:
+ addSupportedValues(VehicleIgnitionState)
+ break;
+ case VehicleProperty::EV_STOPPING_MODE:
+ addSupportedValues(EvStoppingMode)
+ break;
+ case VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE:
+ addSupportedValues(ElectronicStabilityControlState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::TURN_SIGNAL_LIGHT_STATE:
+ addSupportedValues(VehicleTurnSignal)
+ break;
+ case VehicleProperty::TURN_SIGNAL_SWITCH:
+ addSupportedValues(VehicleTurnSignal)
+ break;
+ case VehicleProperty::HVAC_FAN_DIRECTION:
+ addSupportedValues(VehicleHvacFanDirection)
+ break;
+ case VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS:
+ addSupportedValues(VehicleUnit)
+ break;
+ case VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE:
+ addSupportedValues(VehicleHvacFanDirection)
+ break;
+ case VehicleProperty::DISTANCE_DISPLAY_UNITS:
+ addSupportedValues(VehicleUnit)
+ break;
+ case VehicleProperty::FUEL_VOLUME_DISPLAY_UNITS:
+ addSupportedValues(VehicleUnit)
+ break;
+ case VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS:
+ addSupportedValues(VehicleUnit)
+ break;
+ case VehicleProperty::EV_BATTERY_DISPLAY_UNITS:
+ addSupportedValues(VehicleUnit)
+ break;
+ case VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS:
+ addSupportedValues(VehicleUnit)
+ break;
+ case VehicleProperty::HW_ROTARY_INPUT:
+ addSupportedValues(RotaryInputType)
+ break;
+ case VehicleProperty::HW_CUSTOM_INPUT:
+ addSupportedValues(CustomInputType)
+ break;
+ case VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::SEAT_AIRBAGS_DEPLOYED:
+ addSupportedValues(VehicleAirbagLocation)
+ break;
+ case VehicleProperty::SEAT_OCCUPANCY:
+ addSupportedValues(VehicleSeatOccupancyState)
+ break;
+ case VehicleProperty::WINDSHIELD_WIPERS_STATE:
+ addSupportedValues(WindshieldWipersState)
+ break;
+ case VehicleProperty::WINDSHIELD_WIPERS_SWITCH:
+ addSupportedValues(WindshieldWipersSwitch)
+ break;
+ case VehicleProperty::HEADLIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::HIGH_BEAM_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::FOG_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::HAZARD_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::HEADLIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::FOG_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::HAZARD_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::CABIN_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::CABIN_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::READING_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::READING_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::STEERING_WHEEL_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE:
+ addSupportedValues(ElectronicTollCollectionCardType)
+ break;
+ case VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS:
+ addSupportedValues(ElectronicTollCollectionCardStatus)
+ break;
+ case VehicleProperty::FRONT_FOG_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::FRONT_FOG_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::REAR_FOG_LIGHTS_STATE:
+ addSupportedValues(VehicleLightState)
+ break;
+ case VehicleProperty::REAR_FOG_LIGHTS_SWITCH:
+ addSupportedValues(VehicleLightSwitch)
+ break;
+ case VehicleProperty::EV_CHARGE_STATE:
+ addSupportedValues(EvChargeState)
+ break;
+ case VehicleProperty::EV_REGENERATIVE_BRAKING_STATE:
+ addSupportedValues(EvRegenerativeBrakingState)
+ break;
+ case VehicleProperty::TRAILER_PRESENT:
+ addSupportedValues(TrailerState)
+ break;
+ case VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT:
+ addSupportedValues(GsrComplianceRequirementType)
+ break;
+ case VehicleProperty::SHUTDOWN_REQUEST:
+ addSupportedValues(VehicleApPowerStateShutdownParam)
+ break;
+ case VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL:
+ addSupportedValues(VehicleAutonomousState)
+ break;
+ case VehicleProperty::VEHICLE_DRIVING_AUTOMATION_TARGET_LEVEL:
+ addSupportedValues(VehicleAutonomousState)
+ break;
+ case VehicleProperty::CAMERA_SERVICE_CURRENT_STATE:
+ addSupportedValues(CameraServiceState)
+ break;
+ case VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE:
+ addSupportedValues(AutomaticEmergencyBrakingState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::FORWARD_COLLISION_WARNING_STATE:
+ addSupportedValues(ForwardCollisionWarningState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::BLIND_SPOT_WARNING_STATE:
+ addSupportedValues(BlindSpotWarningState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::LANE_DEPARTURE_WARNING_STATE:
+ addSupportedValues(LaneDepartureWarningState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::LANE_KEEP_ASSIST_STATE:
+ addSupportedValues(LaneKeepAssistState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::LANE_CENTERING_ASSIST_COMMAND:
+ addSupportedValues(LaneCenteringAssistCommand)
+ break;
+ case VehicleProperty::LANE_CENTERING_ASSIST_STATE:
+ addSupportedValues(LaneCenteringAssistState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE:
+ addSupportedValues(EmergencyLaneKeepAssistState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::CRUISE_CONTROL_TYPE:
+ addSupportedValues(CruiseControlType)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::CRUISE_CONTROL_STATE:
+ addSupportedValues(CruiseControlState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::CRUISE_CONTROL_COMMAND:
+ addSupportedValues(CruiseControlCommand)
+ break;
+ case VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE:
+ addSupportedValues(HandsOnDetectionDriverState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::HANDS_ON_DETECTION_WARNING:
+ addSupportedValues(HandsOnDetectionWarning)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE:
+ addSupportedValues(DriverDrowsinessAttentionState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING:
+ addSupportedValues(DriverDrowsinessAttentionWarning)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::DRIVER_DISTRACTION_STATE:
+ addSupportedValues(DriverDistractionState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::DRIVER_DISTRACTION_WARNING:
+ addSupportedValues(DriverDistractionWarning)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE:
+ addSupportedValues(LowSpeedCollisionWarningState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE:
+ addSupportedValues(CrossTrafficMonitoringWarningState)
+ addSupportedValues(ErrorState)
+ break;
+ case VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE:
+ addSupportedValues(LowSpeedAutomaticEmergencyBrakingState)
+ addSupportedValues(ErrorState)
+ break;
+
+ default:
+ // Do nothing.
+ break;
+ }
+ return supportedValues;
+}
+} // aidl::android::hardware::automotive::vehicle
diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h
index 5f6e047..ff69759 100644
--- a/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java
index 1a68d4d..8f42a83 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/AnnotationsForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/AnnotationsForVehicleProperty.java
index 1d79180..07f55b1 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/AnnotationsForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/AnnotationsForVehicleProperty.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java
index a0dab66..cf44887 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/EnumForVehicleProperty.java
index 7ab14ec..fe88da8 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/EnumForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/EnumForVehicleProperty.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/generated_lib/4/java/UnitsForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/UnitsForVehicleProperty.java
index b30c8e6..3a35dbb 100644
--- a/automotive/vehicle/aidl/generated_lib/4/java/UnitsForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/4/java/UnitsForVehicleProperty.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
diff --git a/automotive/vehicle/aidl/impl/current/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/current/utils/common/include/VehicleHalTypes.h
index fcc006b..19d2f71 100644
--- a/automotive/vehicle/aidl/impl/current/utils/common/include/VehicleHalTypes.h
+++ b/automotive/vehicle/aidl/impl/current/utils/common/include/VehicleHalTypes.h
@@ -24,6 +24,7 @@
#include <aidl/android/hardware/automotive/vehicle/CruiseControlCommand.h>
#include <aidl/android/hardware/automotive/vehicle/CruiseControlState.h>
#include <aidl/android/hardware/automotive/vehicle/CruiseControlType.h>
+#include <aidl/android/hardware/automotive/vehicle/CustomInputType.h>
#include <aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.h>
#include <aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.h>
#include <aidl/android/hardware/automotive/vehicle/DriverDistractionState.h>
@@ -31,9 +32,13 @@
#include <aidl/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.h>
#include <aidl/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.h>
#include <aidl/android/hardware/automotive/vehicle/ElectronicStabilityControlState.h>
+#include <aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.h>
+#include <aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.h>
#include <aidl/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.h>
#include <aidl/android/hardware/automotive/vehicle/ErrorState.h>
+#include <aidl/android/hardware/automotive/vehicle/EvChargeState.h>
#include <aidl/android/hardware/automotive/vehicle/EvConnectorType.h>
+#include <aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.h>
#include <aidl/android/hardware/automotive/vehicle/EvStoppingMode.h>
#include <aidl/android/hardware/automotive/vehicle/EvsServiceState.h>
#include <aidl/android/hardware/automotive/vehicle/EvsServiceType.h>
@@ -62,6 +67,7 @@
#include <aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.h>
#include <aidl/android/hardware/automotive/vehicle/PortLocationType.h>
+#include <aidl/android/hardware/automotive/vehicle/RotaryInputType.h>
#include <aidl/android/hardware/automotive/vehicle/SetValueRequest.h>
#include <aidl/android/hardware/automotive/vehicle/SetValueResult.h>
#include <aidl/android/hardware/automotive/vehicle/SetValueResults.h>
@@ -69,10 +75,12 @@
#include <aidl/android/hardware/automotive/vehicle/SubscribeOptions.h>
#include <aidl/android/hardware/automotive/vehicle/SupportedValuesListResult.h>
#include <aidl/android/hardware/automotive/vehicle/SupportedValuesListResults.h>
+#include <aidl/android/hardware/automotive/vehicle/TrailerState.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleAirbagLocation.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.h>
+#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleArea.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.h>
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index 200ba4c..2f1b277 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -1317,7 +1317,7 @@
HVAC_FAN_SPEED = 0x0500 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
/**
- * Fan direction setting
+ * The current HVAC fan direction setting
*
* This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
* implement it as VehiclePropertyAccess.READ only.
@@ -1326,6 +1326,9 @@
* property. Caller should not call {@code getSupportedValuesList}, or use
* {@code VehicleAreaConfig#supportedEnumValues}.
*
+ * This property must be supported if {@code HVAC_FAN_DIRECTION_AVAILABLE} is implemented
+ * on the vehicle, and vice versa.
+ *
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
@@ -1770,10 +1773,10 @@
HVAC_POWER_ON = 0x0510 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
/**
- * Fan Positions Available
+ * List of supported fan directions in the vehicle.
*
- * This is a bit mask of fan positions available for the zone. Each
- * available fan direction is denoted by a separate entry in the vector. A
+ * This is a bit mask of the supported fan positions available each area ID. Each
+ * supported fan direction is denoted by a separate entry in the vector. A
* fan direction may have multiple bits from vehicle_hvac_fan_direction set.
* For instance, a typical car may have the following fan positions:
* - FAN_DIRECTION_FACE (0x1)
@@ -1782,6 +1785,9 @@
* - FAN_DIRECTION_DEFROST (0x4)
* - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6)
*
+ * This property must be supported if {@code #HVAC_FAN_DIRECTION} is implemented on the vehicle,
+ * and vice versa.
+ *
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @data_enum VehicleHvacFanDirection
@@ -6150,7 +6156,7 @@
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
/**
- * Indicates the maximum current draw threshold for charging set by the user
+ * The vehicle's selected alternating current (AC) EV charging draw limit in Amperes.
*
* configArray[0] is used to specify the max current draw allowed by the vehicle in Amperes at
* boot time.
diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py
index 5367f3f..44a810e 100755
--- a/automotive/vehicle/tools/generate_annotation_enums.py
+++ b/automotive/vehicle/tools/generate_annotation_enums.py
@@ -42,6 +42,7 @@
ACCESS_CPP_FILE_PATH = GENERATED_LIB + '/cpp/AccessForVehicleProperty.h'
CHANGE_MODE_JAVA_FILE_PATH = GENERATED_LIB + '/java/ChangeModeForVehicleProperty.java'
ACCESS_JAVA_FILE_PATH = GENERATED_LIB + '/java/AccessForVehicleProperty.java'
+ENUM_CPP_FILE_PATH = GENERATED_LIB + '/cpp/EnumForVehicleProperty.h'
ENUM_JAVA_FILE_PATH = GENERATED_LIB + '/java/EnumForVehicleProperty.java'
UNITS_JAVA_FILE_PATH = GENERATED_LIB + '/java/UnitsForVehicleProperty.java'
VERSION_CPP_FILE_PATH = GENERATED_LIB + '/cpp/VersionForVehicleProperty.h'
@@ -84,7 +85,7 @@
]
LICENSE = """/*
- * Copyright (C) 2023 The Android Open Source Project
+ * 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.
@@ -173,6 +174,40 @@
}} // aidl::android::hardware::automotive::vehicle
"""
+ENUM_CPP_FORMATTER = """#pragma once
+
+#define addSupportedValues(EnumType) \\
+{{ \\
+constexpr auto values = ndk::internal::enum_values<EnumType>; \\
+for (size_t i = 0; i < values.size(); i++) {{ \\
+ supportedValues.insert(static_cast<int64_t>(values[i])); \\
+}} \\
+}}
+
+#include <VehicleHalTypes.h>
+#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
+
+#include <unordered_set>
+
+namespace aidl::android::hardware::automotive::vehicle {{
+std::unordered_set<int64_t> getSupportedEnumValuesForProperty(VehicleProperty propertyId) {{
+ std::unordered_set<int64_t> supportedValues;
+ switch (propertyId) {{
+{0}
+ default:
+ // Do nothing.
+ break;
+ }}
+ return supportedValues;
+}}
+}} // aidl::android::hardware::automotive::vehicle
+"""
+
+ENUM_CPP_SWITCH_CASE_FORMATTER = """ case {0}:
+{1}
+ break;
+"""
+
CHANGE_MODE_JAVA_FORMATTER = """package android.hardware.automotive.vehicle;
import java.util.Map;
@@ -403,7 +438,16 @@
elif field == 'enum_types':
if len(config.enum_types) < 1:
continue
- if not cpp:
+ if cpp:
+ switch_case = ''
+ for index, enum_type in enumerate(config.enum_types):
+ if index != 0:
+ switch_case += '\n'
+ switch_case += TAB + TAB + TAB + 'addSupportedValues({0})'.format(enum_type)
+ content += ENUM_CPP_SWITCH_CASE_FORMATTER.format(
+ 'VehicleProperty::' + config.name, switch_case)
+ continue
+ else:
value = "List.of(" + ', '.join([class_name + ".class" for class_name in config.enum_types]) + ")"
elif field == 'unit_type':
if not config.unit_type:
@@ -596,8 +640,10 @@
generated_files.append(access_mode)
enum_types = GeneratedFile('enum_types')
+ enum_types.setCppFilePath(os.path.join(android_top, ENUM_CPP_FILE_PATH))
enum_types.setJavaFilePath(os.path.join(android_top, ENUM_JAVA_FILE_PATH))
enum_types.setJavaFormatter(ENUM_JAVA_FORMATTER)
+ enum_types.setCppFormatter(ENUM_CPP_FORMATTER)
generated_files.append(enum_types)
unit_type = GeneratedFile('unit_type')
diff --git a/automotive/vehicle/vts/Android.bp b/automotive/vehicle/vts/Android.bp
index 219119d..a9e2bf5 100644
--- a/automotive/vehicle/vts/Android.bp
+++ b/automotive/vehicle/vts/Android.bp
@@ -45,7 +45,7 @@
"vhalclient_defaults",
],
header_libs: [
- "IVehicleGeneratedHeaders-V4",
+ "IVehicleGeneratedHeaders",
],
test_suites: [
"general-tests",
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 02a9830..7f5e06d 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -16,12 +16,17 @@
#define LOG_TAG "VtsHalAutomotiveVehicle"
+#include <AccessForVehicleProperty.h>
+#include <AnnotationsForVehicleProperty.h>
+#include <ChangeModeForVehicleProperty.h>
+#include <EnumForVehicleProperty.h>
#include <IVhalClient.h>
#include <VehicleHalTypes.h>
#include <VehicleUtils.h>
#include <VersionForVehicleProperty.h>
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
+#include <aidl/android/hardware/automotive/vehicle/HasSupportedValueInfo.h>
#include <aidl/android/hardware/automotive/vehicle/IVehicle.h>
#include <android-base/stringprintf.h>
#include <android-base/thread_annotations.h>
@@ -42,9 +47,19 @@
#include <unordered_set>
#include <vector>
+using ::aidl::android::hardware::automotive::vehicle::AllowedAccessForVehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::AnnotationsForVehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::ChangeModeForVehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::getSupportedEnumValuesForProperty;
+using ::aidl::android::hardware::automotive::vehicle::HasSupportedValueInfo;
using ::aidl::android::hardware::automotive::vehicle::IVehicle;
+using ::aidl::android::hardware::automotive::vehicle::MinMaxSupportedValueResult;
+using ::aidl::android::hardware::automotive::vehicle::PropIdAreaId;
+using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
+using ::aidl::android::hardware::automotive::vehicle::SupportedValuesListResult;
+using ::aidl::android::hardware::automotive::vehicle::toString;
using ::aidl::android::hardware::automotive::vehicle::VehicleArea;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess;
@@ -76,12 +91,26 @@
constexpr int32_t kInvalidProp = 0x31600207;
// The timeout for retrying getting prop value after setting prop value.
constexpr int64_t kRetryGetPropAfterSetPropTimeoutMillis = 10'000;
+static constexpr char ANNOTATION_REQUIRE_MIN_MAX_VALUE[] = "require_min_max_supported_value";
+static constexpr char ANNOTATION_REQUIRE_SUPPORTED_VALUES[] = "require_supported_values_list";
+static constexpr char ANNOTATION_SUPPORTED_VALUES_IN_CONFIG[] = "legacy_supported_values_in_config";
+static constexpr char ANNOTATIONS_DATA_ENUM[] = "data_enum";
+
+inline VehiclePropertyType getPropertyType(int32_t propId) {
+ return static_cast<VehiclePropertyType>(propId & toInt(VehiclePropertyType::MASK));
+}
struct ServiceDescriptor {
std::string name;
bool isAidlService;
};
+struct PropertyConfigTestParam {
+ VehicleProperty propId;
+ std::vector<VehiclePropertyAccess> accessModes;
+ VehiclePropertyChangeMode changeMode;
+};
+
class VtsVehicleCallback final : public ISubscriptionCallback {
private:
std::mutex mLock;
@@ -145,44 +174,141 @@
}
};
-class VtsHalAutomotiveVehicleTargetTest : public testing::TestWithParam<ServiceDescriptor> {
- protected:
- bool checkIsSupported(int32_t propertyId);
-
- static bool isUnavailable(const VhalClientResult<std::unique_ptr<IHalPropValue>>& result);
- static bool isResultOkayWithValue(
- const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value);
-
+class VtsHalAutomotiveTest : public testing::Test {
public:
- void verifyAccessMode(int actualAccess, int expectedAccess);
+ void verifyAccessMode(int actualAccess, std::vector<VehiclePropertyAccess> expectedAccess);
void verifyGlobalAccessIsMaximalAreaAccessSubset(
int propertyLevelAccess,
const std::vector<std::unique_ptr<IHalAreaConfig>>& areaConfigs) const;
- void verifyProperty(VehicleProperty propId, VehiclePropertyAccess access,
- VehiclePropertyChangeMode changeMode, VehiclePropertyGroup group,
- VehicleArea area, VehiclePropertyType propertyType);
- virtual void SetUp() override {
- auto descriptor = GetParam();
- if (descriptor.isAidlService) {
- mVhalClient = IVhalClient::tryCreateAidlClient(descriptor.name.c_str());
- } else {
- mVhalClient = IVhalClient::tryCreateHidlClient(descriptor.name.c_str());
- }
-
- ASSERT_NE(mVhalClient, nullptr) << "Failed to connect to VHAL";
-
- mCallback = std::make_shared<VtsVehicleCallback>();
- }
+ void verifyProperty(VehicleProperty propId, std::vector<VehiclePropertyAccess> accessModes,
+ VehiclePropertyChangeMode changeMode);
+ void testGetMinMaxSupportedValueForPropIdAreaId(int32_t propId,
+ const IHalAreaConfig& areaConfig,
+ bool minMaxValueRequired);
+ void testGetSupportedValuesListsForPropIdAreaId(int32_t propId,
+ const IHalAreaConfig& areaConfig,
+ bool supportedValuesRequired);
static bool isBooleanGlobalProp(int32_t property) {
- return (property & toInt(VehiclePropertyType::MASK)) ==
- toInt(VehiclePropertyType::BOOLEAN) &&
+ return getPropertyType(property) == VehiclePropertyType::BOOLEAN &&
(property & toInt(VehicleArea::MASK)) == toInt(VehicleArea::GLOBAL);
}
protected:
std::shared_ptr<IVhalClient> mVhalClient;
std::shared_ptr<VtsVehicleCallback> mCallback;
+
+ bool checkIsSupported(int32_t propertyId);
+ void connectToVhal(const ServiceDescriptor& descriptor);
+
+ static bool isUnavailable(const VhalClientResult<std::unique_ptr<IHalPropValue>>& result);
+ static bool isResultOkayWithValue(
+ const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value);
+};
+
+bool VtsHalAutomotiveTest::checkIsSupported(int32_t propertyId) {
+ auto result = mVhalClient->getPropConfigs({propertyId});
+ return result.ok();
+}
+
+void VtsHalAutomotiveTest::connectToVhal(const ServiceDescriptor& descriptor) {
+ if (descriptor.isAidlService) {
+ mVhalClient = IVhalClient::tryCreateAidlClient(descriptor.name.c_str());
+ } else {
+ mVhalClient = IVhalClient::tryCreateHidlClient(descriptor.name.c_str());
+ }
+
+ ASSERT_NE(mVhalClient, nullptr) << "Failed to connect to VHAL";
+
+ mCallback = std::make_shared<VtsVehicleCallback>();
+}
+
+bool VtsHalAutomotiveTest::isResultOkayWithValue(
+ const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value) {
+ return result.ok() && result.value() != nullptr &&
+ result.value()->getStatus() == VehiclePropertyStatus::AVAILABLE &&
+ result.value()->getInt32Values().size() == 1 &&
+ result.value()->getInt32Values()[0] == value;
+}
+
+bool VtsHalAutomotiveTest::isUnavailable(
+ const VhalClientResult<std::unique_ptr<IHalPropValue>>& result) {
+ if (!result.ok()) {
+ return result.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL;
+ }
+ if (result.value() != nullptr &&
+ result.value()->getStatus() == VehiclePropertyStatus::UNAVAILABLE) {
+ return true;
+ }
+
+ return false;
+}
+
+void VtsHalAutomotiveTest::verifyAccessMode(int actualAccess,
+ std::vector<VehiclePropertyAccess> expectedAccess) {
+ if (actualAccess == toInt(VehiclePropertyAccess::NONE)) {
+ return;
+ }
+ EXPECT_THAT(expectedAccess,
+ ::testing::Contains(static_cast<VehiclePropertyAccess>(actualAccess)))
+ << "Invalid property access mode, not one of the allowed access modes";
+}
+
+void VtsHalAutomotiveTest::verifyGlobalAccessIsMaximalAreaAccessSubset(
+ int propertyLevelAccess,
+ const std::vector<std::unique_ptr<IHalAreaConfig>>& areaConfigs) const {
+ bool readOnlyPresent = false;
+ bool writeOnlyPresent = false;
+ bool readWritePresent = false;
+ int maximalAreaAccessSubset = toInt(VehiclePropertyAccess::NONE);
+ for (size_t i = 0; i < areaConfigs.size(); i++) {
+ int access = areaConfigs[i]->getAccess();
+ switch (access) {
+ case toInt(VehiclePropertyAccess::READ):
+ readOnlyPresent = true;
+ break;
+ case toInt(VehiclePropertyAccess::WRITE):
+ writeOnlyPresent = true;
+ break;
+ case toInt(VehiclePropertyAccess::READ_WRITE):
+ readWritePresent = true;
+ break;
+ default:
+ ASSERT_EQ(access, toInt(VehiclePropertyAccess::NONE))
+ << "Area access can be NONE only if global property access is also NONE";
+ return;
+ }
+ }
+
+ if (readOnlyPresent) {
+ ASSERT_FALSE(writeOnlyPresent)
+ << "Found both READ_ONLY and WRITE_ONLY access modes in area configs, which is not "
+ "supported";
+ maximalAreaAccessSubset = toInt(VehiclePropertyAccess::READ);
+ } else if (writeOnlyPresent) {
+ ASSERT_FALSE(readWritePresent) << "Found both WRITE_ONLY and READ_WRITE access modes in "
+ "area configs, which is not "
+ "supported";
+ maximalAreaAccessSubset = toInt(VehiclePropertyAccess::WRITE);
+ } else if (readWritePresent) {
+ maximalAreaAccessSubset = toInt(VehiclePropertyAccess::READ_WRITE);
+ }
+ ASSERT_EQ(propertyLevelAccess, maximalAreaAccessSubset) << StringPrintf(
+ "Expected global access to be equal to maximal area access subset %d, Instead got %d",
+ maximalAreaAccessSubset, propertyLevelAccess);
+}
+
+class VtsHalAutomotiveVehicleTargetTest : public VtsHalAutomotiveTest,
+ public testing::WithParamInterface<ServiceDescriptor> {
+ virtual void SetUp() override { ASSERT_NO_FATAL_FAILURE(connectToVhal(GetParam())); }
+};
+
+class VtsHalAutomotivePropertyConfigTest
+ : public VtsHalAutomotiveTest,
+ public testing::WithParamInterface<std::tuple<PropertyConfigTestParam, ServiceDescriptor>> {
+ virtual void SetUp() override {
+ ASSERT_NO_FATAL_FAILURE(connectToVhal(std::get<1>(GetParam())));
+ }
};
TEST_P(VtsHalAutomotiveVehicleTargetTest, useAidlBackend) {
@@ -319,27 +445,6 @@
"Expect failure to get property for invalid prop: %" PRId32, kInvalidProp);
}
-bool VtsHalAutomotiveVehicleTargetTest::isResultOkayWithValue(
- const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value) {
- return result.ok() && result.value() != nullptr &&
- result.value()->getStatus() == VehiclePropertyStatus::AVAILABLE &&
- result.value()->getInt32Values().size() == 1 &&
- result.value()->getInt32Values()[0] == value;
-}
-
-bool VtsHalAutomotiveVehicleTargetTest::isUnavailable(
- const VhalClientResult<std::unique_ptr<IHalPropValue>>& result) {
- if (!result.ok()) {
- return result.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL;
- }
- if (result.value() != nullptr &&
- result.value()->getStatus() == VehiclePropertyStatus::UNAVAILABLE) {
- return true;
- }
-
- return false;
-}
-
// Test set() on read_write properties.
TEST_P(VtsHalAutomotiveVehicleTargetTest, setProp) {
ALOGD("VtsHalAutomotiveVehicleTargetTest::setProp");
@@ -711,77 +816,390 @@
}
}
-void VtsHalAutomotiveVehicleTargetTest::verifyAccessMode(int actualAccess, int expectedAccess) {
- if (actualAccess == toInt(VehiclePropertyAccess::NONE)) {
- return;
+void verifyRawPropValues(const RawPropValues& rawPropValues, VehiclePropertyType propertyType) {
+ switch (propertyType) {
+ case VehiclePropertyType::INT32:
+ ASSERT_THAT(rawPropValues.int32Values, ::testing::SizeIs(1))
+ << "int32Values field must contain exactly one element for INT32 type";
+ break;
+ case VehiclePropertyType::FLOAT:
+ ASSERT_THAT(rawPropValues.floatValues, ::testing::SizeIs(1))
+ << "floatValues field must contain exactly one element for FLOAT type";
+ break;
+ case VehiclePropertyType::INT64:
+ ASSERT_THAT(rawPropValues.int64Values, ::testing::SizeIs(1))
+ << "int64Values field must contain exactly one element for INT64 type";
+ break;
+ default:
+ // We do not check for other types.
+ break;
}
- if (expectedAccess == toInt(VehiclePropertyAccess::READ_WRITE)) {
- ASSERT_TRUE(actualAccess == expectedAccess ||
- actualAccess == toInt(VehiclePropertyAccess::READ))
- << StringPrintf("Expect to get VehiclePropertyAccess: %i or %i, got %i",
- expectedAccess, toInt(VehiclePropertyAccess::READ), actualAccess);
- return;
- }
- ASSERT_EQ(actualAccess, expectedAccess) << StringPrintf(
- "Expect to get VehiclePropertyAccess: %i, got %i", expectedAccess, actualAccess);
}
-void VtsHalAutomotiveVehicleTargetTest::verifyGlobalAccessIsMaximalAreaAccessSubset(
- int propertyLevelAccess,
- const std::vector<std::unique_ptr<IHalAreaConfig>>& areaConfigs) const {
- bool readOnlyPresent = false;
- bool writeOnlyPresent = false;
- bool readWritePresent = false;
- int maximalAreaAccessSubset = toInt(VehiclePropertyAccess::NONE);
- for (size_t i = 0; i < areaConfigs.size(); i++) {
- int access = areaConfigs[i]->getAccess();
- switch (access) {
- case toInt(VehiclePropertyAccess::READ):
- readOnlyPresent = true;
+void VtsHalAutomotiveTest::testGetMinMaxSupportedValueForPropIdAreaId(
+ int32_t propId, const IHalAreaConfig& areaConfig, bool minMaxValueRequired) {
+ int32_t areaId = areaConfig.getAreaId();
+ VehiclePropertyType propertyType = getPropertyType(propId);
+ std::optional<HasSupportedValueInfo> maybeHasSupportedValueInfo =
+ areaConfig.getHasSupportedValueInfo();
+ if (!maybeHasSupportedValueInfo.has_value()) {
+ return;
+ }
+ if (!maybeHasSupportedValueInfo->hasMinSupportedValue &&
+ !maybeHasSupportedValueInfo->hasMaxSupportedValue) {
+ return;
+ }
+ VhalClientResult<std::vector<MinMaxSupportedValueResult>> result =
+ mVhalClient->getMinMaxSupportedValue({PropIdAreaId{
+ .propId = propId,
+ .areaId = areaId,
+ }});
+ ASSERT_RESULT_OK(result)
+ << "getMinMaxSupportedValue must return okay result if hasMaxSupportedValue "
+ << " or hasMaxSupportedValue is true";
+ ASSERT_THAT(*result, ::testing::SizeIs(1))
+ << "getMinMaxSupportedValue result list size must be 1 for 1 request";
+ const MinMaxSupportedValueResult& individualResult = (*result)[0];
+ if (minMaxValueRequired) {
+ ASSERT_EQ(individualResult.status, StatusCode::OK)
+ << "getMinMaxSupportedValue must return okay status if min/max value is required";
+ }
+ if (individualResult.status != StatusCode::OK) {
+ return;
+ }
+ bool hasMinValue = individualResult.minSupportedValue.has_value();
+ bool hasMaxValue = individualResult.maxSupportedValue.has_value();
+ if (maybeHasSupportedValueInfo->hasMinSupportedValue) {
+ ASSERT_TRUE(hasMinValue)
+ << "minSupportedValue field must not be null if hasMinSupportedValue is true";
+ }
+ if (maybeHasSupportedValueInfo->hasMaxSupportedValue) {
+ ASSERT_TRUE(hasMaxValue)
+ << "minSupportedValue field must not be null if hasMinSupportedValue is true";
+ }
+ if (hasMinValue) {
+ ASSERT_NO_FATAL_FAILURE(
+ verifyRawPropValues(*individualResult.minSupportedValue, propertyType))
+ << "MinMaxSupportedValueResult.minSupportedValue is not a valid RawPropValues for "
+ << "the property type, value: " << (individualResult.minSupportedValue)->toString();
+ }
+ if (hasMaxValue) {
+ ASSERT_NO_FATAL_FAILURE(
+ verifyRawPropValues(*individualResult.maxSupportedValue, propertyType))
+ << "MinMaxSupportedValueResult.maxSupportedValue is not a valid RawPropValues for "
+ << "the property type, value: " << (individualResult.maxSupportedValue)->toString();
+ }
+ if (hasMinValue && hasMaxValue) {
+ int32_t minInt32Value;
+ int32_t maxInt32Value;
+ float minFloatValue;
+ float maxFloatValue;
+ int64_t minInt64Value;
+ int64_t maxInt64Value;
+ switch (propertyType) {
+ case VehiclePropertyType::INT32:
+ minInt32Value = (individualResult.minSupportedValue)->int32Values[0];
+ maxInt32Value = (individualResult.maxSupportedValue)->int32Values[0];
+ ASSERT_LE(minInt32Value, maxInt32Value)
+ << "minSupportedValue must be less or equal to maxSupportedValue";
break;
- case toInt(VehiclePropertyAccess::WRITE):
- writeOnlyPresent = true;
+ case VehiclePropertyType::FLOAT:
+ minFloatValue = (individualResult.minSupportedValue)->floatValues[0];
+ maxFloatValue = (individualResult.maxSupportedValue)->floatValues[0];
+ ASSERT_LE(minFloatValue, maxFloatValue)
+ << "minSupportedValue must be less or equal to maxSupportedValue";
break;
- case toInt(VehiclePropertyAccess::READ_WRITE):
- readWritePresent = true;
+ case VehiclePropertyType::INT64:
+ minInt64Value = (individualResult.minSupportedValue)->int64Values[0];
+ maxInt64Value = (individualResult.maxSupportedValue)->int64Values[0];
+ ASSERT_LE(minInt64Value, maxInt64Value)
+ << "minSupportedValue must be less or equal to maxSupportedValue";
break;
default:
- ASSERT_EQ(access, toInt(VehiclePropertyAccess::NONE)) << StringPrintf(
- "Area access can be NONE only if global property access is also NONE");
- return;
+ // This must not happen since we already checked this condition in
+ // verifyPropertyConfigMinMaxValue
+ FAIL() << "minSupportedValue or maxSupportedValue must only be specified for "
+ "INT32, INT64 or FLOAT type property";
+ break;
}
}
-
- if (readOnlyPresent) {
- ASSERT_FALSE(writeOnlyPresent) << StringPrintf(
- "Found both READ_ONLY and WRITE_ONLY access modes in area configs, which is not "
- "supported");
- maximalAreaAccessSubset = toInt(VehiclePropertyAccess::READ);
- } else if (writeOnlyPresent) {
- ASSERT_FALSE(readWritePresent) << StringPrintf(
- "Found both WRITE_ONLY and READ_WRITE access modes in area configs, which is not "
- "supported");
- maximalAreaAccessSubset = toInt(VehiclePropertyAccess::WRITE);
- } else if (readWritePresent) {
- maximalAreaAccessSubset = toInt(VehiclePropertyAccess::READ_WRITE);
- }
- ASSERT_EQ(propertyLevelAccess, maximalAreaAccessSubset) << StringPrintf(
- "Expected global access to be equal to maximal area access subset %d, Instead got %d",
- maximalAreaAccessSubset, propertyLevelAccess);
}
-// Helper function to compare actual vs expected property config
-void VtsHalAutomotiveVehicleTargetTest::verifyProperty(VehicleProperty propId,
- VehiclePropertyAccess access,
- VehiclePropertyChangeMode changeMode,
- VehiclePropertyGroup group, VehicleArea area,
- VehiclePropertyType propertyType) {
- int expectedPropId = toInt(propId);
- int expectedAccess = toInt(access);
- int expectedChangeMode = toInt(changeMode);
- int expectedGroup = toInt(group);
- int expectedArea = toInt(area);
- int expectedPropertyType = toInt(propertyType);
+// Test the getMinMaxSupportedValue API. We use this one test case to cover all properties that
+// may support this API.
+TEST_P(VtsHalAutomotiveVehicleTargetTest, testGetMinMaxSupportedValue) {
+ if (!mVhalClient->isAidlVhal() || mVhalClient->getRemoteInterfaceVersion() < 4) {
+ GTEST_SKIP() << "Skip checking getMinMaxSupportedValue because the behavior is not "
+ "supported for current VHAL version";
+ }
+
+ auto configsResult = mVhalClient->getAllPropConfigs();
+ ASSERT_TRUE(configsResult.ok())
+ << "Failed to get all property configs, error: " << configsResult.error().message();
+
+ for (const auto& cfgPtr : configsResult.value()) {
+ int32_t propId = cfgPtr->getPropId();
+ bool minMaxValueRequired = false;
+ std::unordered_set<std::string> annotations;
+ auto it = AnnotationsForVehicleProperty.find(static_cast<VehicleProperty>(propId));
+ if (it != AnnotationsForVehicleProperty.end()) {
+ annotations = it->second;
+ }
+ if (annotations.find(ANNOTATION_REQUIRE_MIN_MAX_VALUE) != annotations.end()) {
+ minMaxValueRequired = true;
+ }
+ const std::vector<std::unique_ptr<IHalAreaConfig>>& areaConfigs = cfgPtr->getAreaConfigs();
+ for (const auto& areaCfgPtr : areaConfigs) {
+ EXPECT_NO_FATAL_FAILURE(testGetMinMaxSupportedValueForPropIdAreaId(propId, *areaCfgPtr,
+ minMaxValueRequired))
+ << "test getMinMaxSupportedValue failed for property: "
+ << propIdToString(propId) << ", areaId: " << areaCfgPtr->getAreaId();
+ }
+ }
+}
+
+void VtsHalAutomotiveTest::testGetSupportedValuesListsForPropIdAreaId(
+ int32_t propId, const IHalAreaConfig& areaConfig, bool supportedValuesRequired) {
+ int32_t areaId = areaConfig.getAreaId();
+ VehiclePropertyType propertyType = getPropertyType(propId);
+ std::optional<HasSupportedValueInfo> maybeHasSupportedValueInfo =
+ areaConfig.getHasSupportedValueInfo();
+ if (!maybeHasSupportedValueInfo.has_value()) {
+ return;
+ }
+ if (!maybeHasSupportedValueInfo->hasSupportedValuesList) {
+ return;
+ }
+ VhalClientResult<std::vector<SupportedValuesListResult>> result =
+ mVhalClient->getSupportedValuesLists({PropIdAreaId{
+ .propId = propId,
+ .areaId = areaId,
+ }});
+ ASSERT_RESULT_OK(result)
+ << "getSupportedValuesLists must return okay result if hasSupportedValuesList is true";
+ ASSERT_THAT(*result, ::testing::SizeIs(1))
+ << "getSupportedValuesLists result list size must be 1 for 1 request";
+ const SupportedValuesListResult& individualResult = (*result)[0];
+ if (supportedValuesRequired) {
+ ASSERT_EQ(individualResult.status, StatusCode::OK)
+ << "getSupportedValuesLists must return okay status if supported values are "
+ "required";
+ }
+ if (individualResult.status != StatusCode::OK) {
+ return;
+ }
+ ASSERT_TRUE(individualResult.supportedValuesList.has_value())
+ << "supportedValuesList field must not be null if hasSupportedValuesList is true";
+ const std::vector<std::optional<RawPropValues>>& supportedValuesList =
+ individualResult.supportedValuesList.value();
+ if (supportedValuesRequired) {
+ ASSERT_THAT(supportedValuesList, ::testing::Not(::testing::IsEmpty()))
+ << "supportedValuesList must not be empty if supported values are required";
+ }
+ for (const std::optional<RawPropValues>& supportedValue : supportedValuesList) {
+ ASSERT_TRUE(supportedValue.has_value())
+ << "Each item in supportedValuesList must not be null";
+ ASSERT_NO_FATAL_FAILURE(verifyRawPropValues(*supportedValue, propertyType))
+ << "one of supported value is not a valid RawPropValues for "
+ << "the property type, value: " << supportedValue->toString();
+ }
+}
+
+// Test the getSupportedValues API. We use this one test case to cover all properties that
+// may support this API.
+TEST_P(VtsHalAutomotiveVehicleTargetTest, testGetSupportedValuesLists) {
+ if (!mVhalClient->isAidlVhal() || mVhalClient->getRemoteInterfaceVersion() < 4) {
+ GTEST_SKIP() << "Skip checking getSupportedValuesLists because the behavior is not "
+ "supported for current VHAL version";
+ }
+
+ auto configsResult = mVhalClient->getAllPropConfigs();
+ ASSERT_TRUE(configsResult.ok())
+ << "Failed to get all property configs, error: " << configsResult.error().message();
+
+ for (const auto& cfgPtr : configsResult.value()) {
+ int32_t propId = cfgPtr->getPropId();
+ bool supportedValuesRequired = false;
+ std::unordered_set<std::string> annotations;
+ auto it = AnnotationsForVehicleProperty.find(static_cast<VehicleProperty>(propId));
+ if (it != AnnotationsForVehicleProperty.end()) {
+ annotations = it->second;
+ }
+ if (annotations.find(ANNOTATION_REQUIRE_SUPPORTED_VALUES) != annotations.end()) {
+ supportedValuesRequired = true;
+ }
+ const std::vector<std::unique_ptr<IHalAreaConfig>>& areaConfigs = cfgPtr->getAreaConfigs();
+ for (const auto& areaCfgPtr : areaConfigs) {
+ EXPECT_NO_FATAL_FAILURE(testGetSupportedValuesListsForPropIdAreaId(
+ propId, *areaCfgPtr, supportedValuesRequired))
+ << "test getSupportedValues failed for property: " << propIdToString(propId)
+ << ", areaId: " << areaCfgPtr->getAreaId();
+ }
+ }
+}
+
+void verifyPropertyConfigMinMaxValue(const IHalPropConfig* config,
+ VehiclePropertyType propertyType) {
+ for (const auto& areaConfig : config->getAreaConfigs()) {
+ std::optional<HasSupportedValueInfo> maybeHasSupportedValueInfo =
+ areaConfig->getHasSupportedValueInfo();
+ if (areaConfig->getMinInt32Value() != 0 || areaConfig->getMaxInt32Value() != 0) {
+ EXPECT_EQ(propertyType, VehiclePropertyType::INT32)
+ << "minInt32Value and maxInt32Value must not be specified for INT32 type "
+ "property";
+ EXPECT_THAT(areaConfig->getMinInt32Value(),
+ ::testing::Le(areaConfig->getMaxInt32Value()))
+ << "minInt32Value must be less or equal to maxInt32Value";
+ if (maybeHasSupportedValueInfo.has_value()) {
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasMinSupportedValue)
+ << "HasSupportedValueInfo.hasMinSupportedValue must be true because"
+ "minInt32Value is specified in VehicleAreaConfig";
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasMaxSupportedValue)
+ << "HasSupportedValueInfo.hasMaxSupportedValue must be true because"
+ "maxInt32Value is specified in VehicleAreaConfig";
+ }
+ }
+ if (areaConfig->getMinFloatValue() != 0 || areaConfig->getMaxFloatValue() != 0) {
+ EXPECT_EQ(propertyType, VehiclePropertyType::FLOAT)
+ << "minFloatValue and maxFloatValue must not be specified for FLOAT type "
+ "property";
+ EXPECT_THAT(areaConfig->getMinFloatValue(),
+ ::testing::Le(areaConfig->getMaxFloatValue()))
+ << "minFloatValue must be less or equal to maxFloatValue";
+ if (maybeHasSupportedValueInfo.has_value()) {
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasMinSupportedValue)
+ << "HasSupportedValueInfo.hasMinSupportedValue must be true because"
+ "minFloatValue is specified in VehicleAreaConfig";
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasMaxSupportedValue)
+ << "HasSupportedValueInfo.hasMaxSupportedValue must be true because"
+ "maxFloatValue is specified in VehicleAreaConfig";
+ }
+ }
+ if (areaConfig->getMinInt64Value() != 0 || areaConfig->getMaxInt64Value() != 0) {
+ EXPECT_EQ(propertyType, VehiclePropertyType::INT64)
+ << "minInt64Value and maxInt64Value must not be specified for INT64 type "
+ "property";
+ EXPECT_THAT(areaConfig->getMinInt64Value(),
+ ::testing::Le(areaConfig->getMaxInt64Value()))
+ << "minInt64Value must be less or equal to maxInt64Value";
+ if (maybeHasSupportedValueInfo.has_value()) {
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasMinSupportedValue)
+ << "HasSupportedValueInfo.hasMinSupportedValue must be true because"
+ "minInt64Value is specified in VehicleAreaConfig";
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasMaxSupportedValue)
+ << "HasSupportedValueInfo.hasMaxSupportedValue must be true because"
+ "maxInt64Value is specified in VehicleAreaConfig";
+ }
+ }
+ if (maybeHasSupportedValueInfo.has_value() &&
+ (maybeHasSupportedValueInfo->hasMinSupportedValue ||
+ maybeHasSupportedValueInfo->hasMaxSupportedValue)) {
+ EXPECT_THAT(propertyType,
+ ::testing::AnyOf(VehiclePropertyType::INT32, VehiclePropertyType::INT64,
+ VehiclePropertyType::FLOAT))
+ << "HasSupportedValueInfo.hasMinSupportedValue and "
+ "HasSupportedValueInfo.hasMaxSupportedValue is only allowed to be set to "
+ "true "
+ "for INT32, INT64 or FLOAT type property";
+ }
+ }
+}
+
+void verifyPropertyConfigRequireMinMaxValue(const IHalPropConfig* config,
+ VehiclePropertyType propertyType) {
+ for (const auto& areaConfig : config->getAreaConfigs()) {
+ switch (propertyType) {
+ case VehiclePropertyType::INT32:
+ EXPECT_FALSE(areaConfig->getMinInt32Value() == 0 &&
+ areaConfig->getMaxInt32Value() == 0)
+ << "minInt32Value and maxInt32Value must not both be 0 because "
+ "min and max value is required for this property";
+ break;
+ case VehiclePropertyType::FLOAT:
+ EXPECT_FALSE(areaConfig->getMinFloatValue() == 0 &&
+ areaConfig->getMaxFloatValue() == 0)
+ << "minFloatValue and maxFloatValue must not both be 0 because "
+ "min and max value is required for this property";
+ break;
+ case VehiclePropertyType::INT64:
+ EXPECT_FALSE(areaConfig->getMinInt64Value() == 0 &&
+ areaConfig->getMaxInt64Value() == 0)
+ << "minInt64Value and maxInt64Value must not both be 0 because "
+ "min and max value is required for this property";
+ break;
+ default:
+ // Do nothing.
+ break;
+ }
+
+ std::optional<HasSupportedValueInfo> maybeHasSupportedValueInfo =
+ areaConfig->getHasSupportedValueInfo();
+ if (maybeHasSupportedValueInfo.has_value()) {
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasMinSupportedValue)
+ << "HasSupportedValueInfo.hasMinSupportedValue must be true because"
+ "min and max value is required for this property";
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasMaxSupportedValue)
+ << "HasSupportedValueInfo.hasMaxSupportedValue must be true because"
+ "min and max value is required for this property";
+ }
+ }
+}
+
+void verifyPropertyConfigRequireSupportedValues(
+ const IHalPropConfig* config, const std::unordered_set<std::string>& annotations) {
+ bool supportedValuesInConfig =
+ (annotations.find(ANNOTATION_SUPPORTED_VALUES_IN_CONFIG) != annotations.end());
+ if (supportedValuesInConfig) {
+ const std::vector<int32_t>& configArray = config->getConfigArray();
+ EXPECT_THAT(configArray, Not(::testing::IsEmpty()))
+ << "Config array must not be empty because supported values list must be specified"
+ << " by the config array";
+ }
+
+ for (const auto& areaConfig : config->getAreaConfigs()) {
+ std::optional<HasSupportedValueInfo> maybeHasSupportedValueInfo =
+ areaConfig->getHasSupportedValueInfo();
+ if (maybeHasSupportedValueInfo.has_value()) {
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasSupportedValuesList)
+ << "HasSupportedValueInfo.hasSupportedValuesList must be true because"
+ "supported values list is required for this property";
+ }
+ }
+}
+
+void verifyPropertyConfigDataEnum(const IHalPropConfig* config) {
+ for (const auto& areaConfig : config->getAreaConfigs()) {
+ std::optional<std::vector<int64_t>> maybeSupportedEnumValues =
+ areaConfig->getSupportedEnumValues();
+ if (!maybeSupportedEnumValues.has_value()) {
+ continue;
+ }
+ std::optional<HasSupportedValueInfo> maybeHasSupportedValueInfo =
+ areaConfig->getHasSupportedValueInfo();
+ const std::vector<int64_t>& supportedEnumValues = *maybeSupportedEnumValues;
+ if (!supportedEnumValues.empty() && maybeHasSupportedValueInfo.has_value()) {
+ EXPECT_TRUE(maybeHasSupportedValueInfo->hasSupportedValuesList)
+ << "HasSupportedValueInfo.hasSupportedValuesList must be true because"
+ "supported enum values is not empty";
+ }
+
+ if (!supportedEnumValues.empty()) {
+ std::unordered_set<int64_t> allowedEnumValues = getSupportedEnumValuesForProperty(
+ static_cast<VehicleProperty>(config->getPropId()));
+ EXPECT_THAT(supportedEnumValues, ::testing::IsSubsetOf(allowedEnumValues))
+ << "Supported enum values must be part of defined enum type";
+ }
+ }
+}
+
+/**
+ * Verifies that each property's property config is consistent with the requirement
+ * documented in VehicleProperty.aidl.
+ */
+TEST_P(VtsHalAutomotivePropertyConfigTest, verifyPropertyConfig) {
+ const PropertyConfigTestParam& param = std::get<0>(GetParam());
+ int expectedPropId = toInt(param.propId);
+ int expectedChangeMode = toInt(param.changeMode);
auto result = mVhalClient->getAllPropConfigs();
ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: "
@@ -813,650 +1231,44 @@
const auto& config = result.value().at(0);
int actualPropId = config->getPropId();
int actualChangeMode = config->getChangeMode();
- int actualGroup = actualPropId & toInt(VehiclePropertyGroup::MASK);
- int actualArea = actualPropId & toInt(VehicleArea::MASK);
- int actualPropertyType = actualPropId & toInt(VehiclePropertyType::MASK);
ASSERT_EQ(actualPropId, expectedPropId)
<< StringPrintf("Expect to get property ID: %i, got %i", expectedPropId, actualPropId);
int globalAccess = config->getAccess();
if (config->getAreaConfigSize() == 0) {
- verifyAccessMode(globalAccess, expectedAccess);
+ verifyAccessMode(globalAccess, param.accessModes);
} else {
for (const auto& areaConfig : config->getAreaConfigs()) {
int areaConfigAccess = areaConfig->getAccess();
int actualAccess = (areaConfigAccess != toInt(VehiclePropertyAccess::NONE))
? areaConfigAccess
: globalAccess;
- verifyAccessMode(actualAccess, expectedAccess);
+ verifyAccessMode(actualAccess, param.accessModes);
}
}
- ASSERT_EQ(actualChangeMode, expectedChangeMode)
+ EXPECT_EQ(actualChangeMode, expectedChangeMode)
<< StringPrintf("Expect to get VehiclePropertyChangeMode: %i, got %i",
expectedChangeMode, actualChangeMode);
- ASSERT_EQ(actualGroup, expectedGroup) << StringPrintf(
- "Expect to get VehiclePropertyGroup: %i, got %i", expectedGroup, actualGroup);
- ASSERT_EQ(actualArea, expectedArea)
- << StringPrintf("Expect to get VehicleArea: %i, got %i", expectedArea, actualArea);
- ASSERT_EQ(actualPropertyType, expectedPropertyType)
- << StringPrintf("Expect to get VehiclePropertyType: %i, got %i", expectedPropertyType,
- actualPropertyType);
-}
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLocationCharacterizationConfig) {
- verifyProperty(VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
+ std::unordered_set<std::string> annotations;
+ auto it = AnnotationsForVehicleProperty.find(param.propId);
+ if (it != AnnotationsForVehicleProperty.end()) {
+ annotations = it->second;
+ }
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorPositionConfig) {
- verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
- VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorOrientationConfig) {
- verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
- VehicleArea::VENDOR, VehiclePropertyType::FLOAT_VEC);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorFieldOfViewConfig) {
- verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
- VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorDetectionRangeConfig) {
- verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
- VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorSupportedRangesConfig) {
- verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::STATIC,
- VehiclePropertyGroup::SYSTEM, VehicleArea::VENDOR,
- VehiclePropertyType::INT32_VEC);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorMeasuredDistanceConfig) {
- verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_MEASURED_DISTANCE,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::CONTINUOUS,
- VehiclePropertyGroup::SYSTEM, VehicleArea::VENDOR,
- VehiclePropertyType::INT32_VEC);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) {
- verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistStateConfig) {
- verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlEnabledConfig) {
- verifyProperty(VehicleProperty::CRUISE_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlTypeConfig) {
- verifyProperty(VehicleProperty::CRUISE_CONTROL_TYPE, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlStateConfig) {
- verifyProperty(VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlCommandConfig) {
- verifyProperty(VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyAccess::WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlTargetSpeedConfig) {
- verifyProperty(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::FLOAT);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAdaptiveCruiseControlTargetTimeGapConfig) {
- verifyProperty(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest,
- verifyAdaptiveCruiseControlLeadVehicleMeasuredDistanceConfig) {
- verifyProperty(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::CONTINUOUS,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionEnabledConfig) {
- verifyProperty(VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionDriverStateConfig) {
- verifyProperty(VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionWarningConfig) {
- verifyProperty(VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionSystemEnabledConfig) {
- verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionStateConfig) {
- verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarningEnabledConfig) {
- verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarningConfig) {
- verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionSystemEnabledConfig) {
- verifyProperty(VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionStateConfig) {
- verifyProperty(VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningEnabledConfig) {
- verifyProperty(VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningConfig) {
- verifyProperty(VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) {
- verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvStoppingModeConfig) {
- verifyProperty(VehicleProperty::EV_STOPPING_MODE, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvCurrentBatteryCapacityConfig) {
- verifyProperty(VehicleProperty::EV_CURRENT_BATTERY_CAPACITY, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::FLOAT);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEngineIdleAutoStopEnabledConfig) {
- verifyProperty(VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDoorChildLockEnabledConfig) {
- verifyProperty(VehicleProperty::DOOR_CHILD_LOCK_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::DOOR, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersPeriodConfig) {
- verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_PERIOD, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::WINDOW, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersStateConfig) {
- verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::WINDOW, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyWindshieldWipersSwitchConfig) {
- verifyProperty(VehicleProperty::WINDSHIELD_WIPERS_SWITCH, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::WINDOW, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelDepthPosConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_DEPTH_POS, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelDepthMoveConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_DEPTH_MOVE, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelHeightPosConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_HEIGHT_POS, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelHeightMoveConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_HEIGHT_MOVE, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelTheftLockEnabledConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_THEFT_LOCK_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLockedConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_LOCKED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelEasyAccessEnabledConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_EASY_ACCESS_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLightsStateConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_LIGHTS_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySteeringWheelLightsSwitchConfig) {
- verifyProperty(VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyGloveBoxDoorPosConfig) {
- verifyProperty(VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyGloveBoxLockedConfig) {
- verifyProperty(VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyMirrorAutoFoldEnabledConfig) {
- verifyProperty(VehicleProperty::MIRROR_AUTO_FOLD_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::MIRROR, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyMirrorAutoTiltEnabledConfig) {
- verifyProperty(VehicleProperty::MIRROR_AUTO_TILT_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::MIRROR, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatHeadrestHeightPosV2Config) {
- verifyProperty(VehicleProperty::SEAT_HEADREST_HEIGHT_POS_V2, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatWalkInPosConfig) {
- verifyProperty(VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatFootwellLightsStateConfig) {
- verifyProperty(VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatFootwellLightsSwitchConfig) {
- verifyProperty(VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatEasyAccessEnabledConfig) {
- verifyProperty(VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagEnabledConfig) {
- verifyProperty(VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatCushionSideSupportPosConfig) {
- verifyProperty(VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatCushionSideSupportMoveConfig) {
- verifyProperty(VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatLumbarVerticalPosConfig) {
- verifyProperty(VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatLumbarVerticalMoveConfig) {
- verifyProperty(VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAutomaticEmergencyBrakingEnabledConfig) {
- verifyProperty(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAutomaticEmergencyBrakingStateConfig) {
- verifyProperty(VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyForwardCollisionWarningEnabledConfig) {
- verifyProperty(VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyForwardCollisionWarningStateConfig) {
- verifyProperty(VehicleProperty::FORWARD_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBlindSpotWarningEnabledConfig) {
- verifyProperty(VehicleProperty::BLIND_SPOT_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBlindSpotWarningStateConfig) {
- verifyProperty(VehicleProperty::BLIND_SPOT_WARNING_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::MIRROR, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningEnabledConfig) {
- verifyProperty(VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneDepartureWarningStateConfig) {
- verifyProperty(VehicleProperty::LANE_DEPARTURE_WARNING_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneKeepAssistEnabledConfig) {
- verifyProperty(VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneKeepAssistStateConfig) {
- verifyProperty(VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistEnabledConfig) {
- verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistCommandConfig) {
- verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess::WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistStateConfig) {
- verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyClusterHeartbeatConfig) {
- verifyProperty(VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyAccess::WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::MIXED);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyVehicleDrivingAutomationCurrentLevelConfig) {
- verifyProperty(VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCameraServiceCurrentStateConfig) {
- verifyProperty(VehicleProperty::CAMERA_SERVICE_CURRENT_STATE, VehiclePropertyAccess::WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32_VEC);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagsDeployedConfig) {
- verifyProperty(VehicleProperty::SEAT_AIRBAGS_DEPLOYED, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatBeltPretensionerDeployedConfig) {
- verifyProperty(VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyImpactDetectedConfig) {
- verifyProperty(VehicleProperty::IMPACT_DETECTED, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBatteryAverageTemperatureConfig) {
- verifyProperty(VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::CONTINUOUS, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::FLOAT);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningEnabledConfig) {
- verifyProperty(VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningStateConfig) {
- verifyProperty(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyValetModeEnabledConfig) {
- verifyProperty(VehicleProperty::VALET_MODE_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlEnabledConfig) {
- verifyProperty(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlStateConfig) {
- verifyProperty(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringEnabledConfig) {
- verifyProperty(VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringWarningStateConfig) {
- verifyProperty(VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHeadUpDisplayEnabledConfig) {
- verifyProperty(VehicleProperty::HEAD_UP_DISPLAY_ENABLED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::SEAT, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedAutomaticEmergencyBrakingEnabledConfig) {
- verifyProperty(VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED,
- VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedAutomaticEmergencyBrakingStateConfig) {
- verifyProperty(VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyInfoModelTrimConfig) {
- verifyProperty(VehicleProperty::INFO_MODEL_TRIM, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::STRING);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyInfoVehicleSizeClassConfig) {
- verifyProperty(VehicleProperty::INFO_VEHICLE_SIZE_CLASS, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32_VEC);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyTurnSignalLightStateConfig) {
- verifyProperty(VehicleProperty::TURN_SIGNAL_LIGHT_STATE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyTurnSignalSwitchConfig) {
- verifyProperty(VehicleProperty::TURN_SIGNAL_SWITCH, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyInstantaneousFuelEconomyConfig) {
- verifyProperty(VehicleProperty::INSTANTANEOUS_FUEL_ECONOMY, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::CONTINUOUS, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::FLOAT);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyInstantaneousEvEfficiencyConfig) {
- verifyProperty(VehicleProperty::INSTANTANEOUS_EV_EFFICIENCY, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::CONTINUOUS, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::FLOAT);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyVehicleHornEngagedConfig) {
- verifyProperty(VehicleProperty::VEHICLE_HORN_ENGAGED, VehiclePropertyAccess::READ_WRITE,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyVehicleDrivingAutomationTargetLevelConfig) {
- verifyProperty(VehicleProperty::VEHICLE_DRIVING_AUTOMATION_TARGET_LEVEL,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAcceleratorPedalCompressionPercentageConfig) {
- verifyProperty(VehicleProperty::ACCELERATOR_PEDAL_COMPRESSION_PERCENTAGE,
- VehiclePropertyAccess::READ, VehiclePropertyChangeMode::CONTINUOUS,
- VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::FLOAT);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBrakePedalCompressionPercentageConfig) {
- verifyProperty(VehicleProperty::BRAKE_PEDAL_COMPRESSION_PERCENTAGE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::CONTINUOUS, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::FLOAT);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBrakePadWearPercentageConfig) {
- verifyProperty(VehicleProperty::BRAKE_PAD_WEAR_PERCENTAGE, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::WHEEL, VehiclePropertyType::FLOAT);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyBrakeFluidLevelLowConfig) {
- verifyProperty(VehicleProperty::BRAKE_FLUID_LEVEL_LOW, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
- VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
-}
-
-TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyVehiclePassiveSuspensionHeightConfig) {
- verifyProperty(VehicleProperty::VEHICLE_PASSIVE_SUSPENSION_HEIGHT, VehiclePropertyAccess::READ,
- VehiclePropertyChangeMode::CONTINUOUS, VehiclePropertyGroup::SYSTEM,
- VehicleArea::WHEEL, VehiclePropertyType::INT32);
-}
-
-bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) {
- auto result = mVhalClient->getPropConfigs({propertyId});
- return result.ok();
+ VehiclePropertyType propertyType = getPropertyType(expectedPropId);
+ verifyPropertyConfigMinMaxValue(config.get(), propertyType);
+ if (annotations.find(ANNOTATION_REQUIRE_MIN_MAX_VALUE) != annotations.end()) {
+ verifyPropertyConfigRequireMinMaxValue(config.get(), propertyType);
+ }
+ if (annotations.find(ANNOTATION_REQUIRE_SUPPORTED_VALUES) != annotations.end()) {
+ verifyPropertyConfigRequireSupportedValues(config.get(), annotations);
+ }
+ if (annotations.find(ANNOTATIONS_DATA_ENUM) != annotations.end()) {
+ verifyPropertyConfigDataEnum(config.get());
+ }
}
std::vector<ServiceDescriptor> getDescriptors() {
@@ -1477,7 +1289,20 @@
return descriptors;
}
+std::vector<PropertyConfigTestParam> getPropertyConfigTestParams() {
+ std::vector<PropertyConfigTestParam> testParams;
+ for (const auto& [propId, accessModes] : AllowedAccessForVehicleProperty) {
+ PropertyConfigTestParam param;
+ param.propId = propId;
+ param.accessModes = accessModes;
+ param.changeMode = ChangeModeForVehicleProperty[propId];
+ testParams.push_back(param);
+ }
+ return testParams;
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VtsHalAutomotiveVehicleTargetTest);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VtsHalAutomotivePropertyConfigTest);
INSTANTIATE_TEST_SUITE_P(PerInstance, VtsHalAutomotiveVehicleTargetTest,
testing::ValuesIn(getDescriptors()),
@@ -1492,6 +1317,22 @@
return Sanitize(name);
});
+INSTANTIATE_TEST_SUITE_P(PerInstance, VtsHalAutomotivePropertyConfigTest,
+ testing::Combine(testing::ValuesIn(getPropertyConfigTestParams()),
+ testing::ValuesIn(getDescriptors())),
+ [](const testing::TestParamInfo<
+ std::tuple<PropertyConfigTestParam, ServiceDescriptor>>& info) {
+ std::string name = "";
+ if (std::get<1>(info.param).isAidlService) {
+ name += "aidl_";
+ } else {
+ name += "hidl_";
+ }
+ name += std::get<1>(info.param).name;
+ name += "_" + toString(std::get<0>(info.param).propId);
+ return Sanitize(name);
+ });
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
ABinderProcess_setThreadPoolMaxThreadCount(1);
diff --git a/biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp b/biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp
index 686f61e..9ab141a 100644
--- a/biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp
+++ b/biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp
@@ -157,6 +157,11 @@
};
class Face : public testing::TestWithParam<std::string> {
+ static void HalServiceDied(void* cookie) {
+ auto halDeathPromise = static_cast<std::promise<void>*>(cookie);
+ halDeathPromise->set_value();
+ }
+
protected:
void SetUp() override {
// Prepare the callback.
@@ -176,8 +181,23 @@
ASSERT_NE(binder, nullptr);
mHal = IFace::fromBinder(ndk::SpAIBinder(binder));
+ // Create HAL service death notifier
+ auto halDeathPromise = std::make_shared<std::promise<void>>();
+ mHalDeathRecipient = ndk::ScopedAIBinder_DeathRecipient(
+ AIBinder_DeathRecipient_new(&HalServiceDied));
+ ASSERT_EQ(STATUS_OK, AIBinder_linkToDeath(binder, mHalDeathRecipient.get(),
+ static_cast<void*>(halDeathPromise.get())));
+
// Create a session.
isOk = mHal->createSession(kSensorId, kUserId, mCb, &mSession).isOk();
+ if (!isOk) {
+ // Failed to create session on first attempt, it is likely that the HAL service
+ // is dying or dead. Wait for its death notification signal before next try
+ auto future = halDeathPromise->get_future();
+ auto status = future.wait_for(std::chrono::milliseconds(500));
+ EXPECT_EQ(status, std::future_status::ready);
+ }
+
++retries;
} while (!isOk && retries < 2);
@@ -197,6 +217,7 @@
std::shared_ptr<IFace> mHal;
std::shared_ptr<SessionCallback> mCb;
std::shared_ptr<ISession> mSession;
+ ::ndk::ScopedAIBinder_DeathRecipient mHalDeathRecipient;
};
TEST_P(Face, GetSensorPropsWorksTest) {
diff --git a/biometrics/fingerprint/aidl/default/main.cpp b/biometrics/fingerprint/aidl/default/main.cpp
index 8ca44d6..bf3f38e 100644
--- a/biometrics/fingerprint/aidl/default/main.cpp
+++ b/biometrics/fingerprint/aidl/default/main.cpp
@@ -39,8 +39,6 @@
if (strcmp(argv[1], "default") == 0) {
const std::string instance = std::string(Fingerprint::descriptor) + "/default";
auto binder = hal->asBinder();
- auto binder_ext = hal_vhal->asBinder();
- CHECK(STATUS_OK == AIBinder_setExtension(binder.get(), binder_ext.get()));
binder_status_t status =
AServiceManager_registerLazyService(binder.get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
diff --git a/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp b/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp
index 2cc5e56..951418f 100644
--- a/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp
+++ b/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp
@@ -138,6 +138,11 @@
};
class Fingerprint : public testing::TestWithParam<std::string> {
+ static void HalServiceDied(void* cookie) {
+ auto halDeathPromise = static_cast<std::promise<void>*>(cookie);
+ halDeathPromise->set_value();
+ }
+
protected:
void SetUp() override {
// Prepare the callback.
@@ -157,8 +162,24 @@
ASSERT_NE(binder, nullptr);
mHal = IFingerprint::fromBinder(ndk::SpAIBinder(binder));
+ // Create HAL service death notifier
+ auto halDeathPromise = std::make_shared<std::promise<void>>();
+ mHalDeathRecipient = ndk::ScopedAIBinder_DeathRecipient(
+ AIBinder_DeathRecipient_new(&HalServiceDied));
+ ASSERT_EQ(STATUS_OK, AIBinder_linkToDeath(binder, mHalDeathRecipient.get(),
+ static_cast<void*>(halDeathPromise.get())));
+
// Create a session.
isOk = mHal->createSession(kSensorId, kUserId, mCb, &mSession).isOk();
+
+ if (!isOk) {
+ // Failed to create session on first attempt, it is likely that the HAL service
+ // is dying or dead. Wait for its death notification signal before next try
+ auto future = halDeathPromise->get_future();
+ auto status = future.wait_for(std::chrono::milliseconds(500));
+ EXPECT_EQ(status, std::future_status::ready);
+ }
+
++retries;
} while (!isOk && retries < 2);
@@ -178,6 +199,7 @@
std::shared_ptr<IFingerprint> mHal;
std::shared_ptr<SessionCallback> mCb;
std::shared_ptr<ISession> mSession;
+ ::ndk::ScopedAIBinder_DeathRecipient mHalDeathRecipient;
};
TEST_P(Fingerprint, GetSensorPropsWorksTest) {
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index d0edfad..ff4ce3d 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -534,6 +534,8 @@
// Check the loopback of the ACL packet
ASSERT_TRUE(bluetooth_cb->WaitForCallback(kCallbackNameAclEventReceived)
.no_timeout);
+ ASSERT_FALSE(acl_queue.empty());
+
hidl_vec<uint8_t> acl_loopback = acl_queue.front();
acl_queue.pop();
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
index 3f1f5f6..3d7c376 100644
--- a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
@@ -123,40 +123,6 @@
return (sessionType == session_type_);
}
-std::string getSettingOutputString(
- IBluetoothAudioProvider::LeAudioAseConfigurationSetting& setting) {
- std::stringstream ss;
- std::string name = "";
- if (!setting.sinkAseConfiguration.has_value() &&
- !setting.sourceAseConfiguration.has_value())
- return "";
- std::vector<
- std::optional<LeAudioAseConfigurationSetting::AseDirectionConfiguration>>*
- directionAseConfiguration;
- if (setting.sinkAseConfiguration.has_value() &&
- !setting.sinkAseConfiguration.value().empty())
- directionAseConfiguration = &setting.sinkAseConfiguration.value();
- else
- directionAseConfiguration = &setting.sourceAseConfiguration.value();
- for (auto& aseConfiguration : *directionAseConfiguration) {
- if (aseConfiguration.has_value() &&
- aseConfiguration.value().aseConfiguration.metadata.has_value()) {
- for (auto& meta :
- aseConfiguration.value().aseConfiguration.metadata.value()) {
- if (meta.has_value() &&
- meta.value().getTag() == MetadataLtv::vendorSpecific) {
- auto k = meta.value().get<MetadataLtv::vendorSpecific>().opaqueValue;
- name = std::string(k.begin(), k.end());
- break;
- }
- }
- }
- }
-
- ss << "setting name: " << name << ", setting: " << setting.toString();
- return ss.str();
-}
-
ndk::ScopedAStatus LeAudioOffloadAudioProvider::startSession(
const std::shared_ptr<IBluetoothAudioPort>& host_if,
const AudioConfiguration& audio_config,
@@ -742,9 +708,11 @@
return filtered_setting;
}
-std::optional<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>
+std::optional<std::pair<
+ std::string, IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>
LeAudioOffloadAudioProvider::matchWithRequirement(
- std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>&
+ std::vector<std::pair<
+ std::string, IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>&
matched_ase_configuration_settings,
const IBluetoothAudioProvider::LeAudioConfigurationRequirement& requirement,
bool isMatchContext, bool isExact, bool isMatchFlags) {
@@ -758,14 +726,15 @@
if (!requirement.flags.has_value()) return std::nullopt;
requirement_flags_bitmask = requirement.flags.value().bitmask;
}
- for (auto& setting : matched_ase_configuration_settings) {
+ for (auto& [setting_name, setting] : matched_ase_configuration_settings) {
// Try to match context.
if (isMatchContext) {
if ((setting.audioContext.bitmask & requirement.audioContext.bitmask) !=
requirement.audioContext.bitmask)
continue;
- LOG(DEBUG) << __func__ << ": Setting with matched context: "
- << getSettingOutputString(setting);
+ LOG(DEBUG) << __func__
+ << ": Setting with matched context: name: " << setting_name
+ << ", setting: " << setting.toString();
}
// Try to match configuration flags
@@ -774,19 +743,20 @@
if ((setting.flags.value().bitmask & requirement_flags_bitmask) !=
requirement_flags_bitmask)
continue;
- LOG(DEBUG) << __func__ << ": Setting with matched flags: "
- << getSettingOutputString(setting);
+ LOG(DEBUG) << __func__
+ << ": Setting with matched flags: name: " << setting_name
+ << ", setting: " << setting.toString();
}
auto filtered_ase_configuration_setting =
getRequirementMatchedAseConfigurationSettings(setting, requirement,
isExact);
if (filtered_ase_configuration_setting.has_value()) {
- LOG(INFO) << __func__ << ": Result found: "
- << getSettingOutputString(
- filtered_ase_configuration_setting.value());
+ LOG(INFO) << __func__ << ": Result found: name: " << setting_name
+ << ", setting: "
+ << filtered_ase_configuration_setting.value().toString();
// Found a matched setting, ignore other settings
- return filtered_ase_configuration_setting;
+ return {{setting_name, filtered_ase_configuration_setting.value()}};
}
}
// If cannot satisfy this requirement, return nullopt
@@ -812,7 +782,8 @@
std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>*
_aidl_return) {
// Get all configuration settings
- std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>
+ std::vector<std::pair<
+ std::string, IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>
ase_configuration_settings =
BluetoothAudioCodecs::GetLeAudioAseConfigurationSettings();
@@ -822,15 +793,17 @@
}
// Matched ASE configuration with ignored audio context
- std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>
+ std::vector<std::pair<
+ std::string, IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>
sink_matched_ase_configuration_settings;
- std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>
+ std::vector<std::pair<
+ std::string, IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>
matched_ase_configuration_settings;
// A setting must match both source and sink.
// First filter all setting matched with sink capability
if (in_remoteSinkAudioCapabilities.has_value()) {
- for (auto& setting : ase_configuration_settings) {
+ for (auto& [setting_name, setting] : ase_configuration_settings) {
for (auto& capability : in_remoteSinkAudioCapabilities.value()) {
if (!capability.has_value()) continue;
auto filtered_ase_configuration_setting =
@@ -838,7 +811,7 @@
setting, capability.value(), kLeAudioDirectionSink);
if (filtered_ase_configuration_setting.has_value()) {
sink_matched_ase_configuration_settings.push_back(
- filtered_ase_configuration_setting.value());
+ {setting_name, filtered_ase_configuration_setting.value()});
}
}
}
@@ -848,7 +821,8 @@
// Combine filter every source capability
if (in_remoteSourceAudioCapabilities.has_value()) {
- for (auto& setting : sink_matched_ase_configuration_settings)
+ for (auto& [setting_name, setting] :
+ sink_matched_ase_configuration_settings)
for (auto& capability : in_remoteSourceAudioCapabilities.value()) {
if (!capability.has_value()) continue;
auto filtered_ase_configuration_setting =
@@ -856,7 +830,7 @@
setting, capability.value(), kLeAudioDirectionSource);
if (filtered_ase_configuration_setting.has_value()) {
matched_ase_configuration_settings.push_back(
- filtered_ase_configuration_setting.value());
+ {setting_name, filtered_ase_configuration_setting.value()});
}
}
} else {
@@ -864,7 +838,11 @@
sink_matched_ase_configuration_settings;
}
- std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting> result;
+ std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>
+ result_no_name;
+ std::vector<std::pair<
+ std::string, IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>
+ result;
for (auto& requirement : in_requirements) {
// For each requirement, try to match with a setting.
// If we cannot match, return an empty result.
@@ -896,18 +874,19 @@
if (!found) {
LOG(ERROR) << __func__
<< ": Cannot find any match for this requirement, exitting...";
- result.clear();
- *_aidl_return = result;
+ *_aidl_return = result_no_name;
return ndk::ScopedAStatus::ok();
}
}
LOG(INFO) << __func__
<< ": Found matches for all requirements, chosen settings:";
- for (auto& setting : result) {
- LOG(INFO) << __func__ << ": " << getSettingOutputString(setting);
+ for (auto& [setting_name, setting] : result) {
+ LOG(INFO) << __func__ << ": name: " << setting_name
+ << ", setting: " << setting.toString();
+ result_no_name.push_back(setting);
}
- *_aidl_return = result;
+ *_aidl_return = result_no_name;
return ndk::ScopedAStatus::ok();
};
@@ -937,7 +916,8 @@
uint8_t direction,
const IBluetoothAudioProvider::LeAudioAseQosConfigurationRequirement&
qosRequirement,
- std::vector<LeAudioAseConfigurationSetting>& ase_configuration_settings,
+ std::vector<std::pair<std::string, LeAudioAseConfigurationSetting>>&
+ ase_configuration_settings,
bool isExact, bool isMatchFlags) {
auto requirement_flags_bitmask = 0;
if (isMatchFlags) {
@@ -955,13 +935,14 @@
direction_qos_requirement = qosRequirement.sourceAseQosRequirement.value();
}
- for (auto& setting : ase_configuration_settings) {
+ for (auto& [setting_name, setting] : ase_configuration_settings) {
// Context matching
if ((setting.audioContext.bitmask & qosRequirement.audioContext.bitmask) !=
qosRequirement.audioContext.bitmask)
continue;
- LOG(DEBUG) << __func__ << ": Setting with matched context: "
- << getSettingOutputString(setting);
+ LOG(DEBUG) << __func__
+ << ": Setting with matched context: name: " << setting_name
+ << ", setting: " << setting.toString();
// Match configuration flags
if (isMatchFlags) {
@@ -969,8 +950,9 @@
if ((setting.flags.value().bitmask & requirement_flags_bitmask) !=
requirement_flags_bitmask)
continue;
- LOG(DEBUG) << __func__ << ": Setting with matched flags: "
- << getSettingOutputString(setting);
+ LOG(DEBUG) << __func__
+ << ": Setting with matched flags: name: " << setting_name
+ << ", setting: " << setting.toString();
}
// Get a list of all matched AseDirectionConfiguration
@@ -1041,7 +1023,8 @@
IBluetoothAudioProvider::LeAudioAseQosConfigurationPair result;
// Get all configuration settings
- std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>
+ std::vector<std::pair<
+ std::string, IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>
ase_configuration_settings =
BluetoothAudioCodecs::GetLeAudioAseConfigurationSettings();
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
index 8c4f543..6d402a4 100644
--- a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
+++ b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
@@ -163,15 +163,19 @@
uint8_t direction,
const IBluetoothAudioProvider::LeAudioAseQosConfigurationRequirement&
qosRequirement,
- std::vector<LeAudioAseConfigurationSetting>& ase_configuration_settings,
+ std::vector<std::pair<std::string, LeAudioAseConfigurationSetting>>&
+ ase_configuration_settings,
bool isExact, bool isMatchedFlag);
bool isSubgroupConfigurationMatchedContext(
AudioContext requirement_context,
IBluetoothAudioProvider::BroadcastQuality quality,
LeAudioBroadcastSubgroupConfiguration configuration);
- std::optional<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>
+ std::optional<std::pair<
+ std::string, IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>
matchWithRequirement(
- std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>&
+ std::vector<
+ std::pair<std::string,
+ IBluetoothAudioProvider::LeAudioAseConfigurationSetting>>&
matched_ase_configuration_settings,
const IBluetoothAudioProvider::LeAudioConfigurationRequirement&
requirements,
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
index db2528e..89472e6 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
@@ -452,7 +452,7 @@
return kDefaultOffloadHfpCodecInfo;
}
-std::vector<LeAudioAseConfigurationSetting>
+std::vector<std::pair<std::string, LeAudioAseConfigurationSetting>>
BluetoothAudioCodecs::GetLeAudioAseConfigurationSettings() {
return AudioSetConfigurationProviderJson::
GetLeAudioAseConfigurationSettings();
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h
index 0a1f708..c77de61 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h
@@ -54,7 +54,7 @@
static std::vector<CodecInfo> GetLeAudioOffloadCodecInfo(
const SessionType& session_type);
- static std::vector<LeAudioAseConfigurationSetting>
+ static std::vector<std::pair<std::string, LeAudioAseConfigurationSetting>>
GetLeAudioAseConfigurationSettings();
static std::vector<CodecInfo> GetHfpOffloadCodecInfo();
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
index 3e18de2..feb4cda 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
@@ -65,7 +65,8 @@
ConfigurationFlags>>
configurations_;
-std::vector<LeAudioAseConfigurationSetting> ase_configuration_settings_;
+std::vector<std::pair<std::string, LeAudioAseConfigurationSetting>>
+ ase_configuration_settings_;
constexpr uint8_t kIsoDataPathHci = 0x00;
constexpr uint8_t kIsoDataPathPlatformDefault = 0x01;
@@ -273,7 +274,7 @@
/* Implementation */
-std::vector<LeAudioAseConfigurationSetting>
+std::vector<std::pair<std::string, LeAudioAseConfigurationSetting>>
AudioSetConfigurationProviderJson::GetLeAudioAseConfigurationSettings() {
AudioSetConfigurationProviderJson::LoadAudioSetConfigurationProviderJson();
return ase_configuration_settings_;
@@ -392,9 +393,10 @@
}
void AudioSetConfigurationProviderJson::populateAseConfiguration(
- const std::string& name, LeAudioAseConfiguration& ase,
+ LeAudioAseConfiguration& ase,
const le_audio::AudioSetSubConfiguration* flat_subconfig,
- const le_audio::QosConfiguration* qos_cfg) {
+ const le_audio::QosConfiguration* qos_cfg,
+ ConfigurationFlags& configurationFlags) {
// Target latency
switch (qos_cfg->target_latency()) {
case le_audio::AudioSetConfigurationTargetLatency::
@@ -410,6 +412,7 @@
case le_audio::AudioSetConfigurationTargetLatency::
AudioSetConfigurationTargetLatency_LOW:
ase.targetLatency = LeAudioAseConfiguration::TargetLatency::LOWER;
+ configurationFlags.bitmask |= ConfigurationFlags::LOW_LATENCY;
break;
default:
ase.targetLatency = LeAudioAseConfiguration::TargetLatency::UNDEFINED;
@@ -429,12 +432,6 @@
}
// Codec configuration data
populateConfigurationData(ase, flat_subconfig->codec_configuration());
- // Populate the config name for easier debug
- auto meta = std::vector<std::optional<MetadataLtv>>();
- MetadataLtv::VendorSpecific cfg_name;
- cfg_name.opaqueValue = std::vector<uint8_t>(name.begin(), name.end());
- meta.push_back(cfg_name);
- ase.metadata = meta;
}
void AudioSetConfigurationProviderJson::populateAseQosConfiguration(
@@ -505,9 +502,9 @@
// Parse into AseDirectionConfiguration
AseDirectionConfiguration
AudioSetConfigurationProviderJson::SetConfigurationFromFlatSubconfig(
- const std::string& name,
const le_audio::AudioSetSubConfiguration* flat_subconfig,
- const le_audio::QosConfiguration* qos_cfg, CodecLocation location) {
+ const le_audio::QosConfiguration* qos_cfg, CodecLocation location,
+ ConfigurationFlags& configurationFlags) {
AseDirectionConfiguration direction_conf;
LeAudioAseConfiguration ase;
@@ -515,7 +512,7 @@
LeAudioDataPathConfiguration path;
// Translate into LeAudioAseConfiguration
- populateAseConfiguration(name, ase, flat_subconfig, qos_cfg);
+ populateAseConfiguration(ase, flat_subconfig, qos_cfg, configurationFlags);
// Translate into LeAudioAseQosConfiguration
populateAseQosConfiguration(qos, qos_cfg, ase,
@@ -549,15 +546,14 @@
// Parse into AseDirectionConfiguration and the ConfigurationFlags
// and put them in the given list.
void AudioSetConfigurationProviderJson::processSubconfig(
- const std::string& name,
const le_audio::AudioSetSubConfiguration* subconfig,
const le_audio::QosConfiguration* qos_cfg,
std::vector<std::optional<AseDirectionConfiguration>>&
directionAseConfiguration,
- CodecLocation location) {
+ CodecLocation location, ConfigurationFlags& configurationFlags) {
auto ase_cnt = subconfig->ase_cnt();
- auto config =
- SetConfigurationFromFlatSubconfig(name, subconfig, qos_cfg, location);
+ auto config = SetConfigurationFromFlatSubconfig(subconfig, qos_cfg, location,
+ configurationFlags);
directionAseConfiguration.push_back(config);
// Put the same setting again.
if (ase_cnt == 2) directionAseConfiguration.push_back(config);
@@ -642,11 +638,11 @@
/* Load subconfigurations */
for (auto subconfig : *codec_cfg->subconfigurations()) {
if (subconfig->direction() == kLeAudioDirectionSink) {
- processSubconfig(flat_cfg->name()->str(), subconfig, qos_sink_cfg,
- sinkAseConfiguration, location);
+ processSubconfig(subconfig, qos_sink_cfg, sinkAseConfiguration,
+ location, configurationFlags);
} else {
- processSubconfig(flat_cfg->name()->str(), subconfig, qos_source_cfg,
- sourceAseConfiguration, location);
+ processSubconfig(subconfig, qos_source_cfg, sourceAseConfiguration,
+ location, configurationFlags);
}
}
@@ -856,7 +852,7 @@
setting.flags = flags;
// Add to list of setting
LOG(DEBUG) << "Pushing configuration to list: " << config_name;
- ase_configuration_settings_.push_back(setting);
+ ase_configuration_settings_.push_back({config_name, setting});
}
}
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.h b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.h
index fac6152..f115d61 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.h
@@ -50,7 +50,7 @@
class AudioSetConfigurationProviderJson {
public:
- static std::vector<LeAudioAseConfigurationSetting>
+ static std::vector<std::pair<std::string, LeAudioAseConfigurationSetting>>
GetLeAudioAseConfigurationSettings();
private:
@@ -73,9 +73,10 @@
flat_codec_specific_params);
static void populateAseConfiguration(
- const std::string& name, LeAudioAseConfiguration& ase,
+ LeAudioAseConfiguration& ase,
const le_audio::AudioSetSubConfiguration* flat_subconfig,
- const le_audio::QosConfiguration* qos_cfg);
+ const le_audio::QosConfiguration* qos_cfg,
+ ConfigurationFlags& configurationFlags);
static void populateAseQosConfiguration(
LeAudioAseQosConfiguration& qos,
@@ -83,17 +84,16 @@
uint8_t ase_channel_cnt);
static AseDirectionConfiguration SetConfigurationFromFlatSubconfig(
- const std::string& name,
const le_audio::AudioSetSubConfiguration* flat_subconfig,
- const le_audio::QosConfiguration* qos_cfg, CodecLocation location);
+ const le_audio::QosConfiguration* qos_cfg, CodecLocation location,
+ ConfigurationFlags& configurationFlags);
static void processSubconfig(
- const std::string& name,
const le_audio::AudioSetSubConfiguration* subconfig,
const le_audio::QosConfiguration* qos_cfg,
std::vector<std::optional<AseDirectionConfiguration>>&
directionAseConfiguration,
- CodecLocation location);
+ CodecLocation location, ConfigurationFlags& configurationFlags);
static void PopulateAseConfigurationFromFlat(
const le_audio::AudioSetConfiguration* flat_cfg,
diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp
index e2a8693..4aba874 100644
--- a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp
+++ b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp
@@ -58,7 +58,8 @@
ndk::ScopedAStatus BluetoothChannelSounding::getSupportedCsSecurityLevels(
std::vector<CsSecurityLevel>* _aidl_return) {
- std::vector<CsSecurityLevel> supported_security_levels = {};
+ std::vector<CsSecurityLevel> supported_security_levels = {
+ CsSecurityLevel::NOT_SUPPORTED};
*_aidl_return = supported_security_levels;
return ::ndk::ScopedAStatus::ok();
}
diff --git a/broadcastradio/aidl/OWNERS b/broadcastradio/aidl/OWNERS
index 302fdd7..51a85e4 100644
--- a/broadcastradio/aidl/OWNERS
+++ b/broadcastradio/aidl/OWNERS
@@ -1,4 +1,3 @@
xuweilin@google.com
oscarazu@google.com
ericjeong@google.com
-keunyoung@google.com
diff --git a/broadcastradio/aidl/vts/OWNERS b/broadcastradio/aidl/vts/OWNERS
index 302fdd7..51a85e4 100644
--- a/broadcastradio/aidl/vts/OWNERS
+++ b/broadcastradio/aidl/vts/OWNERS
@@ -1,4 +1,3 @@
xuweilin@google.com
oscarazu@google.com
ericjeong@google.com
-keunyoung@google.com
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/AuxiliaryInformation.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/AuxiliaryInformation.aidl
index f6c6cb9..61b510b 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/AuxiliaryInformation.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/AuxiliaryInformation.aidl
@@ -21,6 +21,8 @@
/**
* Contains parameters to provide additional information dependent on the GNSS constellation.
*
+ * If svid is -1, the AuxiliaryInformation is not available.
+ *
* @hide
*/
@VintfStability
@@ -49,6 +51,8 @@
* - QZSS: 183-206
* - Galileo: 1-36
* - Beidou: 1-63
+ *
+ * If it is -1, the AuxiliaryInformation is not available.
*/
int svid;
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl
index ced8917..65f840c 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl
@@ -18,7 +18,9 @@
/**
* Contains Galileo ionospheric model.
- * This is Defined in Galileo-OS-SIS-ICD-v2.1, 5.1.6.
+ * This is defined in Galileo-OS-SIS-ICD-v2.1, 5.1.6.
+ *
+ * If all coefficients are 0, the GalileoIonosphericModel is not available.
*
* @hide
*/
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
index ebf6c05..25e8c4b 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
@@ -20,6 +20,8 @@
* Contains Glonass almanac data.
* This is defined in Glonass ICD v5.1, section 4.5.
*
+ * If issueDateMs is -1, the GlonassAlmanac is not available.
+ *
* @hide
*/
@VintfStability
@@ -77,7 +79,10 @@
double omega;
}
- /** Almanac issue date in milliseconds (UTC). */
+ /**
+ * Almanac issue date in milliseconds (UTC).
+ * If it is -1, the GlonassAlmanac is not available.
+ */
long issueDateMs;
/** Array of GlonassSatelliteAlmanac. */
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
index f12378b..e03bbf0 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAlmanac.aidl
@@ -24,6 +24,8 @@
* For QZSS, this is defined in IS-QZSS-PNT section 4.1.2.6.
* For Galileo, this is defined in Galileo-OS-SIS-ICD-v2.1 section 5.1.10.
*
+ * If weekNumber is -1, the GnssAlmanac is not available.
+ *
* @hide
*/
@VintfStability
@@ -44,6 +46,7 @@
/**
* Almanac reference week number.
+ * If it is -1, the GnssAlmanac is not available.
*
* For GPS and QZSS, this is GPS week number (modulo 1024).
* For Beidou, this is Baidou week number (modulo 8192).
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl
index e261e97..c1dba78 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl
@@ -20,6 +20,8 @@
* Contains Klobuchar ionospheric model coefficients used by GPS, BDS, QZSS.
* This is defined in IS-GPS-200 20.3.3.5.1.7.
*
+ * If all coefficients are 0, the KlobucharIonosphericModel is not available.
+ *
* @hide
*/
@VintfStability
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl
index 0ebd46d..d05fba8 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl
@@ -20,11 +20,16 @@
* Contains the leap seconds set of parameters needed for GNSS time.
* This is defined in RINEX 3.05 "LEAP SECONDS" in table A2.
*
+ * If leapSeconds is -1, the LeapSecondsModel is not available.
+ *
* @hide
*/
@VintfStability
parcelable LeapSecondsModel {
- /** Time difference due to leap seconds before the event in seconds. */
+ /**
+ * Time difference due to leap seconds before the event in seconds.
+ * If it is -1, the LeapSecondsModel is not available.
+ */
int leapSeconds;
/** Time difference due to leap seconds after the event in seconds. */
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/UtcModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/UtcModel.aidl
index c16a711..2b291f0 100644
--- a/gnss/aidl/android/hardware/gnss/gnss_assistance/UtcModel.aidl
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/UtcModel.aidl
@@ -20,6 +20,8 @@
* Contains parameters to convert from current GNSS time to UTC time.
* This is defined in RINEX 3.05 "TIME SYSTEM CORR" in table A5.
*
+ * If weekNumber is -1, the UtcModel is not available.
+ *
* @hide
*/
@VintfStability
@@ -33,6 +35,6 @@
/** Reference GNSS time of week in seconds. */
int timeOfWeek;
- /** Reference GNSS week number. */
+ /** Reference GNSS week number. If it is -1, the UTC model is not available. */
int weekNumber;
}
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h
index da6001a..2196530 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h
@@ -270,7 +270,7 @@
for (auto& [layerId, luts] : displayLuts.layerLuts) {
if (luts.pfd.get() >= 0) {
data.layerLuts.push_back(
- {layerId, Luts{ndk::ScopedFileDescriptor(dup(luts.pfd.get())), luts.offsets,
+ {layerId, Luts{ndk::ScopedFileDescriptor(luts.pfd.release()), luts.offsets,
luts.lutProperties}});
}
}
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
index 71a04f3..8658921 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
@@ -297,7 +297,8 @@
DisplayCommand& getDisplayCommand(int64_t display) {
if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) {
- LOG_ALWAYS_FATAL_IF(display != mDisplay);
+ LOG_ALWAYS_FATAL_IF(display != mDisplay, "Expected display %" PRId64 ", got %" PRId64,
+ mDisplay, display);
flushLayerCommand();
flushDisplayCommand();
mDisplayCommand.emplace();
diff --git a/graphics/composer/aidl/libhwc_aidl_test/ComposerClientWrapper.cpp b/graphics/composer/aidl/libhwc_aidl_test/ComposerClientWrapper.cpp
index 8af1fc3..2252ce3 100644
--- a/graphics/composer/aidl/libhwc_aidl_test/ComposerClientWrapper.cpp
+++ b/graphics/composer/aidl/libhwc_aidl_test/ComposerClientWrapper.cpp
@@ -62,8 +62,9 @@
return mComposerClient->registerCallback(mComposerCallback);
}
-bool ComposerClientWrapper::tearDown(ComposerClientWriter* writer) {
- return verifyComposerCallbackParams() && destroyAllLayers(writer);
+bool ComposerClientWrapper::tearDown(
+ std::unordered_map<int64_t, ComposerClientWriter*> displayWriters) {
+ return verifyComposerCallbackParams() && destroyAllLayers(displayWriters);
}
std::pair<ScopedAStatus, int32_t> ComposerClientWrapper::getInterfaceVersion() const {
@@ -663,12 +664,16 @@
return interfaceVersion >= 3;
}
-bool ComposerClientWrapper::destroyAllLayers(ComposerClientWriter* writer) {
+bool ComposerClientWrapper::destroyAllLayers(
+ std::unordered_map<int64_t, ComposerClientWriter*> displayWriters) {
std::unordered_map<int64_t, DisplayResource> physicalDisplays;
while (!mDisplayResources.empty()) {
const auto& it = mDisplayResources.begin();
const auto& [display, resource] = *it;
+ ComposerClientWriter* writer =
+ displayWriters.count(display) > 0 ? displayWriters.at(display) : nullptr;
+
while (!resource.layers.empty()) {
auto layer = *resource.layers.begin();
const auto status = destroyLayer(display, layer, writer);
diff --git a/graphics/composer/aidl/libhwc_aidl_test/include/ComposerClientWrapper.h b/graphics/composer/aidl/libhwc_aidl_test/include/ComposerClientWrapper.h
index 22dd888..5ba52bc 100644
--- a/graphics/composer/aidl/libhwc_aidl_test/include/ComposerClientWrapper.h
+++ b/graphics/composer/aidl/libhwc_aidl_test/include/ComposerClientWrapper.h
@@ -60,7 +60,7 @@
ScopedAStatus createClient();
- bool tearDown(ComposerClientWriter*);
+ bool tearDown(std::unordered_map<int64_t, ComposerClientWriter*> displayWriters);
std::pair<ScopedAStatus, int32_t> getInterfaceVersion() const;
@@ -218,7 +218,7 @@
void removeLayerFromDisplayResources(int64_t display, int64_t layer);
- bool destroyAllLayers(ComposerClientWriter*);
+ bool destroyAllLayers(std::unordered_map<int64_t, ComposerClientWriter*> displayWriters);
bool verifyComposerCallbackParams();
@@ -242,7 +242,7 @@
class DisplayWrapper {
public:
- DisplayWrapper(int64_t displayId)
+ explicit DisplayWrapper(int64_t displayId)
: mDisplayId(displayId), mDisplayWidth(0), mDisplayHeight(0) {}
int64_t getDisplayId() const { return mDisplayId; }
diff --git a/graphics/composer/aidl/vts/Android.bp b/graphics/composer/aidl/vts/Android.bp
index cf9c6d7..6ff51bf 100644
--- a/graphics/composer/aidl/vts/Android.bp
+++ b/graphics/composer/aidl/vts/Android.bp
@@ -36,6 +36,7 @@
srcs: [
"VtsHalGraphicsComposer3_TargetTest.cpp",
"VtsHalGraphicsComposer3_ReadbackTest.cpp",
+ "VtsHalGraphicsComposer3_ConnectedDisplays.cpp",
],
shared_libs: [
"libEGL",
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ConnectedDisplays.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ConnectedDisplays.cpp
new file mode 100644
index 0000000..dff1fa5
--- /dev/null
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ConnectedDisplays.cpp
@@ -0,0 +1,140 @@
+/**
+ * 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.
+ */
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/graphics/common/BlendMode.h>
+#include <aidl/android/hardware/graphics/common/BufferUsage.h>
+#include <aidl/android/hardware/graphics/common/FRect.h>
+#include <aidl/android/hardware/graphics/common/PixelFormat.h>
+#include <aidl/android/hardware/graphics/common/Rect.h>
+#include <aidl/android/hardware/graphics/composer3/Composition.h>
+#include <aidl/android/hardware/graphics/composer3/IComposer.h>
+#include <android-base/properties.h>
+#include <android/binder_process.h>
+#include <android/hardware/graphics/composer3/ComposerClientReader.h>
+#include <android/hardware/graphics/composer3/ComposerClientWriter.h>
+#include <binder/ProcessState.h>
+#include <gtest/gtest.h>
+#include <ui/Fence.h>
+#include <ui/GraphicBuffer.h>
+#include <ui/PixelFormat.h>
+#include <string>
+#include <unordered_map>
+#include "ComposerClientWrapper.h"
+
+#undef LOG_TAG
+#define LOG_TAG "VtsHalGraphicsComposer3_ConnectedDisplays"
+
+namespace aidl::android::hardware::graphics::composer3::vts {
+
+using namespace std::chrono_literals;
+using namespace aidl::android::hardware::graphics::composer3::libhwc_aidl_test;
+
+/**
+ * @class ConnectedDisplaysTest
+ * @brief A test suite for validating the HWC (Hardware Composer) API when multiple displays are
+ * present.
+ *
+ * This test suite is part of the VTS (Vendor Test Suite) and is designed to test the interactions
+ * between multiple displays using the HWC API. It ensures that the API behaves correctly when more
+ * than one display are present.
+ *
+ * @note The test requires at least two displays to be found. If only one display is found, the test
+ * will be skipped.
+ */
+class ConnectedDisplaysTest : public ::testing::TestWithParam<std::string> {
+ protected:
+ void SetUp() override {
+ mComposerClient = std::make_unique<ComposerClientWrapper>(GetParam());
+ ASSERT_TRUE(mComposerClient->createClient().isOk());
+
+ const auto& [status, displays] = mComposerClient->getDisplays();
+ ASSERT_TRUE(status.isOk());
+ mDisplays = displays;
+
+ // Skip test if there's only one display
+ if (mDisplays.size() <= 1) {
+ GTEST_SKIP() << "Test requires at least 2 displays, found " << mDisplays.size();
+ }
+
+ // explicitly disable vsync for all displays
+ for (const auto& display : mDisplays) {
+ EXPECT_TRUE(mComposerClient->setVsync(display.getDisplayId(), false).isOk());
+ }
+ mComposerClient->setVsyncAllowed(false);
+ }
+
+ void TearDown() override {
+ ASSERT_TRUE(
+ mComposerClient->tearDown(std::unordered_map<int64_t, ComposerClientWriter*>{}));
+ mComposerClient.reset();
+ }
+
+ std::unique_ptr<ComposerClientWrapper> mComposerClient;
+ std::vector<DisplayWrapper> mDisplays;
+ static constexpr uint32_t kBufferSlotCount = 64;
+};
+
+/**
+ * Test that verifies display configurations can be changed independently without affecting other
+ * displays.
+ */
+TEST_P(ConnectedDisplaysTest, IndependentConfigChange) {
+ // Store initial configs for all displays
+ std::unordered_map<int64_t, int32_t> initialConfigs;
+ for (const auto& display : mDisplays) {
+ const auto& [activeStatus, activeConfig] =
+ mComposerClient->getActiveConfig(display.getDisplayId());
+ ASSERT_TRUE(activeStatus.isOk());
+ initialConfigs[display.getDisplayId()] = activeConfig;
+ }
+
+ for (auto& display : mDisplays) {
+ const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId());
+ ASSERT_TRUE(status.isOk());
+ ASSERT_FALSE(configs.empty());
+
+ // Try to set each config
+ for (const auto& config : configs) {
+ if (config == initialConfigs[display.getDisplayId()]) continue;
+
+ EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config).isOk());
+
+ // Verify other displays' configs remain unchanged
+ for (const auto& otherDisplay : mDisplays) {
+ if (otherDisplay.getDisplayId() != display.getDisplayId()) {
+ const auto& [otherStatus, otherConfig] =
+ mComposerClient->getActiveConfig(otherDisplay.getDisplayId());
+ EXPECT_TRUE(otherStatus.isOk());
+ EXPECT_EQ(otherConfig, initialConfigs[otherDisplay.getDisplayId()]);
+ }
+ }
+ }
+ // Restore original config
+ EXPECT_TRUE(
+ mComposerClient->setActiveConfig(&display, initialConfigs[display.getDisplayId()])
+ .isOk());
+ }
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ConnectedDisplaysTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, ConnectedDisplaysTest,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
+ ::android::PrintInstanceNameToString);
+
+} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
index dff044d..4f2ed2f 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -27,6 +27,8 @@
#include <ui/GraphicBuffer.h>
#include <ui/PixelFormat.h>
#include <ui/Rect.h>
+#include <cstdint>
+#include <unordered_map>
#include "ComposerClientWrapper.h"
#include "GraphicsComposerCallback.h"
#include "Readback.h"
@@ -49,74 +51,122 @@
const auto& [status, displays] = mComposerClient->getDisplays();
ASSERT_TRUE(status.isOk());
- mDisplays = displays;
- mWriter.reset(new ComposerClientWriter(getPrimaryDisplayId()));
+ mAllDisplays = displays;
- setTestColorModes();
+ setUpDisplayProperties();
- // explicitly disable vsync
- for (const auto& display : mDisplays) {
+ for (const auto& display : mAllDisplays) {
+ // explicitly disable vsync
EXPECT_TRUE(mComposerClient->setVsync(display.getDisplayId(), /*enable*/ false).isOk());
+
+ DisplayProperties& displayProperties = mDisplayProperties.at(display.getDisplayId());
+ if (ReadbackHelper::readbackSupported(displayProperties.pixelFormat,
+ displayProperties.dataspace)) {
+ mDisplaysWithReadbackBuffers.push_back(&display);
+ }
}
+
mComposerClient->setVsyncAllowed(/*isAllowed*/ false);
-
- EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
-
- const auto format = getHasReadbackBuffer() ? mPixelFormat : common::PixelFormat::RGBA_8888;
-
- ASSERT_NO_FATAL_FAILURE(
- mTestRenderEngine = std::unique_ptr<TestRenderEngine>(new TestRenderEngine(
- ::android::renderengine::RenderEngineCreationArgs::Builder()
- .setPixelFormat(static_cast<int>(format))
- .setImageCacheSize(TestRenderEngine::sMaxFrameBufferAcquireBuffers)
- .setEnableProtectedContext(false)
- .setPrecacheToneMapperShaderOnly(false)
- .setContextPriority(::android::renderengine::RenderEngine::
- ContextPriority::HIGH)
- .build())));
-
- mClientCompositionDisplaySettings.physicalDisplay =
- Rect(getDisplayWidth(), getDisplayHeight());
- mClientCompositionDisplaySettings.clip = mClientCompositionDisplaySettings.physicalDisplay;
-
- mTestRenderEngine->initGraphicBuffer(
- static_cast<uint32_t>(getDisplayWidth()), static_cast<uint32_t>(getDisplayHeight()),
- /*layerCount*/ 1U,
- static_cast<uint64_t>(
- static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
- static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
- static_cast<uint64_t>(common::BufferUsage::GPU_RENDER_TARGET)));
- mTestRenderEngine->setDisplaySettings(mClientCompositionDisplaySettings);
}
void TearDown() override {
- ASSERT_FALSE(mDisplays.empty());
- ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
- ASSERT_TRUE(mComposerClient->tearDown(mWriter.get()));
+ std::unordered_map<int64_t, ComposerClientWriter*> displayWriters;
+
+ ASSERT_FALSE(mAllDisplays.empty());
+ for (const auto& display : mAllDisplays) {
+ ASSERT_TRUE(
+ mComposerClient->setPowerMode(display.getDisplayId(), PowerMode::OFF).isOk());
+
+ const auto errors = mDisplayProperties.at(display.getDisplayId()).reader.takeErrors();
+ ASSERT_TRUE(mDisplayProperties.at(display.getDisplayId()).reader.takeErrors().empty());
+ ASSERT_TRUE(mDisplayProperties.at(display.getDisplayId())
+ .reader.takeChangedCompositionTypes(display.getDisplayId())
+ .empty());
+ displayWriters[display.getDisplayId()] =
+ &mDisplayProperties.at(display.getDisplayId()).writer;
+ }
+
+ ASSERT_TRUE(mComposerClient->tearDown(displayWriters));
mComposerClient.reset();
- const auto errors = mReader.takeErrors();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
}
- const DisplayWrapper& getPrimaryDisplay() const { return mDisplays[0]; }
+ void setUpDisplayProperties() {
+ for (const auto& display : mAllDisplays) {
+ int64_t displayId = display.getDisplayId();
- int64_t getPrimaryDisplayId() const { return getPrimaryDisplay().getDisplayId(); }
+ // Set testColorModes
+ const auto& [status, modes] = mComposerClient->getColorModes(displayId);
+ ASSERT_TRUE(status.isOk());
+ std::vector<ColorMode> testColorModes;
+ for (ColorMode mode : modes) {
+ if (std::find(ReadbackHelper::colorModes.begin(), ReadbackHelper::colorModes.end(),
+ mode) != ReadbackHelper::colorModes.end()) {
+ testColorModes.push_back(mode);
+ }
+ }
+
+ // Set pixelFormat and dataspace
+ auto [readbackStatus, readBackBufferAttributes] =
+ mComposerClient->getReadbackBufferAttributes(displayId);
+ if (readbackStatus.isOk()) {
+ } else {
+ EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(
+ readbackStatus, IComposerClient::EX_UNSUPPORTED));
+ }
+
+ // Set testRenderEngine and clientCompositionDisplaySettings
+ EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk());
+ const auto format = readbackStatus.isOk() ? readBackBufferAttributes.format
+ : common::PixelFormat::RGBA_8888;
+ std::unique_ptr<TestRenderEngine> testRenderEngine;
+ ASSERT_NO_FATAL_FAILURE(
+ testRenderEngine = std::unique_ptr<TestRenderEngine>(new TestRenderEngine(
+ ::android::renderengine::RenderEngineCreationArgs::Builder()
+ .setPixelFormat(static_cast<int>(format))
+ .setImageCacheSize(
+ TestRenderEngine::sMaxFrameBufferAcquireBuffers)
+ .setEnableProtectedContext(false)
+ .setPrecacheToneMapperShaderOnly(false)
+ .setContextPriority(::android::renderengine::RenderEngine::
+ ContextPriority::HIGH)
+ .build())));
+
+ ::android::renderengine::DisplaySettings clientCompositionDisplaySettings;
+ clientCompositionDisplaySettings.physicalDisplay =
+ Rect(display.getDisplayWidth(), display.getDisplayHeight());
+ clientCompositionDisplaySettings.clip =
+ clientCompositionDisplaySettings.physicalDisplay;
+
+ testRenderEngine->initGraphicBuffer(
+ static_cast<uint32_t>(display.getDisplayWidth()),
+ static_cast<uint32_t>(display.getDisplayHeight()),
+ /*layerCount*/ 1U,
+ static_cast<uint64_t>(
+ static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
+ static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+ static_cast<uint64_t>(common::BufferUsage::GPU_RENDER_TARGET)));
+ testRenderEngine->setDisplaySettings(clientCompositionDisplaySettings);
+
+ DisplayProperties displayProperties(displayId, testColorModes,
+ std::move(testRenderEngine),
+ std::move(clientCompositionDisplaySettings),
+ std::move(readBackBufferAttributes));
+
+ mDisplayProperties.emplace(displayId, std::move(displayProperties));
+ }
+ }
int64_t getInvalidDisplayId() const { return mComposerClient->getInvalidDisplayId(); }
- int32_t getDisplayWidth() const { return getPrimaryDisplay().getDisplayWidth(); }
-
- int32_t getDisplayHeight() const { return getPrimaryDisplay().getDisplayHeight(); }
-
void assertServiceSpecificError(const ScopedAStatus& status, int32_t serviceSpecificError) {
ASSERT_EQ(status.getExceptionCode(), EX_SERVICE_SPECIFIC);
ASSERT_EQ(status.getServiceSpecificError(), serviceSpecificError);
}
- std::pair<bool, ::android::sp<::android::GraphicBuffer>> allocateBuffer(uint32_t usage) {
- const auto width = static_cast<uint32_t>(getDisplayWidth());
- const auto height = static_cast<uint32_t>(getDisplayHeight());
+ std::pair<bool, ::android::sp<::android::GraphicBuffer>> allocateBuffer(
+ const DisplayWrapper& display, uint32_t usage) {
+ const auto width = static_cast<uint32_t>(display.getDisplayWidth());
+ const auto height = static_cast<uint32_t>(display.getDisplayHeight());
const auto& graphicBuffer = ::android::sp<::android::GraphicBuffer>::make(
width, height, ::android::PIXEL_FORMAT_RGBA_8888,
@@ -128,15 +178,15 @@
return {false, graphicBuffer};
}
- void writeLayers(const std::vector<std::shared_ptr<TestLayer>>& layers) {
+ void writeLayers(const std::vector<std::shared_ptr<TestLayer>>& layers, int64_t displayId) {
for (const auto& layer : layers) {
- layer->write(*mWriter);
+ layer->write(mDisplayProperties.at(displayId).writer);
}
- execute();
+ execute(displayId);
}
- void execute() {
- auto commands = mWriter->takePendingCommands();
+ void execute(int64_t displayId) {
+ auto commands = mDisplayProperties.at(displayId).writer.takePendingCommands();
if (commands.empty()) {
return;
}
@@ -144,48 +194,37 @@
auto [status, results] = mComposerClient->executeCommands(commands);
ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
- mReader.parse(std::move(results));
+ mDisplayProperties.at(displayId).reader.parse(std::move(results));
}
- bool getHasReadbackBuffer() {
- auto [status, readBackBufferAttributes] =
- mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId());
- if (status.isOk()) {
- mPixelFormat = readBackBufferAttributes.format;
- mDataspace = readBackBufferAttributes.dataspace;
- return ReadbackHelper::readbackSupported(mPixelFormat, mDataspace);
- }
- EXPECT_NO_FATAL_FAILURE(
- assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED));
- return false;
- }
+ struct DisplayProperties {
+ DisplayProperties(int64_t displayId, std::vector<ColorMode> testColorModes,
+ std::unique_ptr<TestRenderEngine> testRenderEngine,
+ ::android::renderengine::DisplaySettings clientCompositionDisplaySettings,
+ ReadbackBufferAttributes readBackBufferAttributes)
+ : testColorModes(testColorModes),
+ pixelFormat(readBackBufferAttributes.format),
+ dataspace(readBackBufferAttributes.dataspace),
+ testRenderEngine(std::move(testRenderEngine)),
+ clientCompositionDisplaySettings(std::move(clientCompositionDisplaySettings)),
+ writer(displayId),
+ reader(displayId) {}
+
+ std::vector<ColorMode> testColorModes = {};
+ common::PixelFormat pixelFormat = common::PixelFormat::UNSPECIFIED;
+ common::Dataspace dataspace = common::Dataspace::UNKNOWN;
+ std::unique_ptr<TestRenderEngine> testRenderEngine = nullptr;
+ ::android::renderengine::DisplaySettings clientCompositionDisplaySettings = {};
+ ComposerClientWriter writer;
+ ComposerClientReader reader;
+ };
std::shared_ptr<ComposerClientWrapper> mComposerClient;
- std::vector<DisplayWrapper> mDisplays;
- // use the slot count usually set by SF
- std::vector<ColorMode> mTestColorModes;
- std::unique_ptr<ComposerClientWriter> mWriter;
- ComposerClientReader mReader;
- std::unique_ptr<TestRenderEngine> mTestRenderEngine;
- common::PixelFormat mPixelFormat;
- common::Dataspace mDataspace;
- ::android::renderengine::DisplaySettings mClientCompositionDisplaySettings;
+ std::vector<DisplayWrapper> mAllDisplays;
+ std::vector<const DisplayWrapper*> mDisplaysWithReadbackBuffers;
+ std::unordered_map<int64_t, DisplayProperties> mDisplayProperties;
static constexpr uint32_t kClientTargetSlotCount = 64;
-
- private:
- void setTestColorModes() {
- mTestColorModes.clear();
- const auto& [status, modes] = mComposerClient->getColorModes(getPrimaryDisplayId());
- ASSERT_TRUE(status.isOk());
-
- for (ColorMode mode : modes) {
- if (std::find(ReadbackHelper::colorModes.begin(), ReadbackHelper::colorModes.end(),
- mode) != ReadbackHelper::colorModes.end()) {
- mTestColorModes.push_back(mode);
- }
- }
- }
};
class GraphicsCompositionTest : public GraphicsCompositionTestBase,
@@ -195,338 +234,374 @@
};
TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ auto& testColorModes = mDisplayProperties.at(display->getDisplayId()).testColorModes;
+ for (ColorMode mode : testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ auto layer = std::make_shared<TestColorLayer>(
+ mComposerClient, display->getDisplayId(),
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ common::Rect coloredSquare(
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight()});
+ layer->setColor(BLUE);
+ layer->setDisplayFrame(coloredSquare);
+ layer->setZOrder(10);
+
+ std::vector<std::shared_ptr<TestLayer>> layers = {layer};
+
+ // expected color for each pixel
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ coloredSquare, BLUE);
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ // if hwc cannot handle and asks for composition change, just skip the test on this
+ // display->
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- auto layer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
- layer->setColor(BLUE);
- layer->setDisplayFrame(coloredSquare);
- layer->setZOrder(10);
-
- std::vector<std::shared_ptr<TestLayer>> layers = {layer};
-
- // expected color for each pixel
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare, BLUE);
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- // if hwc cannot handle and asks for composition change,
- // just succeed the test
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(layers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetLayerBuffer) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ auto& testColorModes = mDisplayProperties.at(display->getDisplayId()).testColorModes;
+ for (ColorMode mode : testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight() / 4}, RED);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, display->getDisplayHeight() / 4, display->getDisplayWidth(),
+ display->getDisplayHeight() / 2},
+ GREEN);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, display->getDisplayHeight() / 2, display->getDisplayWidth(),
+ display->getDisplayHeight()},
+ BLUE);
+
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), display->getDisplayWidth(),
+ display->getDisplayHeight(), common::PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ layer->setDisplayFrame({0, 0, display->getDisplayWidth(), display->getDisplayHeight()});
+ layer->setZOrder(10);
+ layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
+ ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
+
+ std::vector<std::shared_ptr<TestLayer>> layers = {layer};
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED);
- ReadbackHelper::fillColorsArea(
- expectedColors, getDisplayWidth(),
- {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight() / 2}, GREEN);
- ReadbackHelper::fillColorsArea(
- expectedColors, getDisplayWidth(),
- {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
-
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), common::PixelFormat::RGBA_8888, *mWriter);
- layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
- layer->setZOrder(10);
- layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
- ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
-
- std::vector<std::shared_ptr<TestLayer>> layers = {layer};
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
-
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
-
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(layers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ auto& testColorModes = mDisplayProperties.at(display->getDisplayId()).testColorModes;
+ for (ColorMode mode : testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ auto& writer = mDisplayProperties.at(display->getDisplayId()).writer;
+ auto layer = std::make_shared<TestColorLayer>(mComposerClient, display->getDisplayId(),
+ writer);
+ common::Rect coloredSquare(
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight()});
+ layer->setColor(BLUE);
+ layer->setDisplayFrame(coloredSquare);
+ layer->setZOrder(10);
+ layer->write(mDisplayProperties.at(display->getDisplayId()).writer);
+
+ // This following buffer call should have no effect
+ const auto usage = static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+ static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN);
+ const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(*display, usage);
+ ASSERT_TRUE(graphicBufferStatus);
+ const auto& buffer = graphicBuffer->handle;
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.setLayerBuffer(display->getDisplayId(), layer->getLayer(), /*slot*/ 0,
+ buffer,
+ /*acquireFence*/ -1);
+
+ // expected color for each pixel
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ coloredSquare, BLUE);
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
-
- auto layer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
- layer->setColor(BLUE);
- layer->setDisplayFrame(coloredSquare);
- layer->setZOrder(10);
- layer->write(*mWriter);
-
- // This following buffer call should have no effect
- const auto usage = static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
- static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN);
- const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(usage);
- ASSERT_TRUE(graphicBufferStatus);
- const auto& buffer = graphicBuffer->handle;
- mWriter->setLayerBuffer(getPrimaryDisplayId(), layer->getLayer(), /*slot*/ 0, buffer,
- /*acquireFence*/ -1);
-
- // expected color for each pixel
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare, BLUE);
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
-
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetReadbackBuffer) {
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ ReadbackBuffer readbackBuffer(display->getDisplayId(), mComposerClient,
+ display->getDisplayWidth(), display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
}
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
}
TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) {
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ const auto usage = static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+ static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN);
+ const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(*display, usage);
+ ASSERT_TRUE(graphicBufferStatus);
+ const auto& bufferHandle = graphicBuffer->handle;
+ ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1);
+
+ const auto status =
+ mComposerClient->setReadbackBuffer(getInvalidDisplayId(), bufferHandle, fence);
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_NO_FATAL_FAILURE(
+ assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY));
}
-
- const auto usage = static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
- static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN);
- const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(usage);
- ASSERT_TRUE(graphicBufferStatus);
- const auto& bufferHandle = graphicBuffer->handle;
- ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1);
-
- const auto status =
- mComposerClient->setReadbackBuffer(getInvalidDisplayId(), bufferHandle, fence);
-
- EXPECT_FALSE(status.isOk());
- EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY));
}
TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) {
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ const native_handle_t bufferHandle{};
+ ndk::ScopedFileDescriptor releaseFence = ndk::ScopedFileDescriptor(-1);
+ const auto status = mComposerClient->setReadbackBuffer(display->getDisplayId(),
+ &bufferHandle, releaseFence);
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_NO_FATAL_FAILURE(
+ assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER));
}
-
- const native_handle_t bufferHandle{};
- ndk::ScopedFileDescriptor releaseFence = ndk::ScopedFileDescriptor(-1);
- const auto status =
- mComposerClient->setReadbackBuffer(getPrimaryDisplayId(), &bufferHandle, releaseFence);
-
- EXPECT_FALSE(status.isOk());
- EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER));
}
TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) {
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ const auto& [status, releaseFence] =
+ mComposerClient->getReadbackBufferFence(display->getDisplayId());
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_NO_FATAL_FAILURE(
+ assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED));
+ EXPECT_EQ(-1, releaseFence.get());
}
-
- const auto& [status, releaseFence] =
- mComposerClient->getReadbackBufferFence(getPrimaryDisplayId());
-
- EXPECT_FALSE(status.isOk());
- EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED));
- EXPECT_EQ(-1, releaseFence.get());
}
TEST_P(GraphicsCompositionTest, ClientComposition) {
- EXPECT_TRUE(
- mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kClientTargetSlotCount)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ EXPECT_TRUE(
+ mComposerClient
+ ->setClientTargetSlotCount(display->getDisplayId(), kClientTargetSlotCount)
+ .isOk());
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight() / 4}, RED);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, display->getDisplayHeight() / 4, display->getDisplayWidth(),
+ display->getDisplayHeight() / 2},
+ GREEN);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, display->getDisplayHeight() / 2, display->getDisplayWidth(),
+ display->getDisplayHeight()},
+ BLUE);
+
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), display->getDisplayWidth(),
+ display->getDisplayHeight(), PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ layer->setDisplayFrame({0, 0, display->getDisplayWidth(), display->getDisplayHeight()});
+ layer->setZOrder(10);
+ layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
+
+ std::vector<std::shared_ptr<TestLayer>> layers = {layer};
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+
+ auto changedCompositionTypes =
+ mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId());
+ if (!changedCompositionTypes.empty()) {
+ ASSERT_EQ(1, changedCompositionTypes.size());
+ ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
+
+ PixelFormat clientFormat = PixelFormat::RGBA_8888;
+ auto clientUsage = static_cast<uint32_t>(
+ static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN) |
+ static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+ static_cast<uint32_t>(common::BufferUsage::COMPOSER_CLIENT_TARGET));
+ Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
+ common::Rect damage{0, 0, display->getDisplayWidth(), display->getDisplayHeight()};
+
+ // create client target buffer
+ const auto& [graphicBufferStatus, graphicBuffer] =
+ allocateBuffer(*display, clientUsage);
+ ASSERT_TRUE(graphicBufferStatus);
+ const auto& buffer = graphicBuffer->handle;
+ void* clientBufData;
+ const auto stride = static_cast<uint32_t>(graphicBuffer->stride);
+ int bytesPerPixel = -1;
+ int bytesPerStride = -1;
+ graphicBuffer->lock(clientUsage, layer->getAccessRegion(), &clientBufData,
+ &bytesPerPixel, &bytesPerStride);
+
+ ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(
+ layer->getWidth(), layer->getHeight(), stride, bytesPerPixel, clientBufData,
+ clientFormat, expectedColors));
+ int32_t clientFence;
+ const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence);
+ ASSERT_EQ(::android::OK, unlockStatus);
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.setClientTarget(display->getDisplayId(), /*slot*/ 0, buffer,
+ clientFence, clientDataspace,
+ std::vector<common::Rect>(1, damage), 1.f);
+ layer->setToClientComposition(
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ changedCompositionTypes =
+ mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId());
+ ASSERT_TRUE(changedCompositionTypes.empty());
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED);
- ReadbackHelper::fillColorsArea(
- expectedColors, getDisplayWidth(),
- {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight() / 2}, GREEN);
- ReadbackHelper::fillColorsArea(
- expectedColors, getDisplayWidth(),
- {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
-
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
- layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
- layer->setZOrder(10);
- layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
-
- std::vector<std::shared_ptr<TestLayer>> layers = {layer};
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
-
- auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
- if (!changedCompositionTypes.empty()) {
- ASSERT_EQ(1, changedCompositionTypes.size());
- ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
-
- PixelFormat clientFormat = PixelFormat::RGBA_8888;
- auto clientUsage = static_cast<uint32_t>(
- static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN) |
- static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
- static_cast<uint32_t>(common::BufferUsage::COMPOSER_CLIENT_TARGET));
- Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
- common::Rect damage{0, 0, getDisplayWidth(), getDisplayHeight()};
-
- // create client target buffer
- const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(clientUsage);
- ASSERT_TRUE(graphicBufferStatus);
- const auto& buffer = graphicBuffer->handle;
- void* clientBufData;
- const auto stride = static_cast<uint32_t>(graphicBuffer->stride);
- int bytesPerPixel = -1;
- int bytesPerStride = -1;
- graphicBuffer->lock(clientUsage, layer->getAccessRegion(), &clientBufData,
- &bytesPerPixel, &bytesPerStride);
-
- ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(
- layer->getWidth(), layer->getHeight(), stride, bytesPerPixel, clientBufData,
- clientFormat, expectedColors));
- int32_t clientFence;
- const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence);
- ASSERT_EQ(::android::OK, unlockStatus);
- mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence,
- clientDataspace, std::vector<common::Rect>(1, damage), 1.f);
- layer->setToClientComposition(*mWriter);
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
- ASSERT_TRUE(changedCompositionTypes.empty());
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
-
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
}
@@ -547,626 +622,734 @@
// @VsrTest = 4.4-016
TEST_P(GraphicsCompositionTest, Luts) {
- ASSERT_TRUE(
- mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kClientTargetSlotCount)
- .isOk());
const auto& [status, properties] = mComposerClient->getOverlaySupport();
if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC &&
status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
- GTEST_SKIP() << "getOverlaySupport is not supported";
- return;
+ ALOGI("getOverlaySupport is not supported");
+ GTEST_SKIP();
}
if (!properties.lutProperties) {
- GTEST_SKIP() << "lutProperties is not supported";
- return;
+ ALOGI("lutProperties are not supported");
+ GTEST_SKIP();
}
- for (const auto& lutProperties : *properties.lutProperties) {
- if (!lutProperties) {
- continue;
- }
- auto& l = *lutProperties;
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ ASSERT_TRUE(
+ mComposerClient
+ ->setClientTargetSlotCount(display->getDisplayId(), kClientTargetSlotCount)
+ .isOk());
+ auto& testColorModes = mDisplayProperties.at(display->getDisplayId()).testColorModes;
- for (const auto& key : l.samplingKeys) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode,
- RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const auto& lutProperties : *properties.lutProperties) {
+ if (!lutProperties) {
+ continue;
+ }
+ auto& l = *lutProperties;
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED()
- << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ for (const auto& key : l.samplingKeys) {
+ for (ColorMode mode : testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
+
+ common::Rect coloredSquare(
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight()});
+
+ // expected color for each pixel
+ std::vector<Color> expectedColors(static_cast<size_t>(
+ display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ coloredSquare, WHITE);
+
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), display->getDisplayWidth(),
+ display->getDisplayHeight(), PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ layer->setDisplayFrame(coloredSquare);
+ layer->setZOrder(10);
+ layer->setDataspace(Dataspace::SRGB);
+
+ Luts luts;
+ generateLuts(&luts, l.dimension, l.size, key);
+ layer->setLuts(std::move(luts));
+
+ ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
+
+ std::vector<std::shared_ptr<TestLayer>> layers = {layer};
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId())
+ .reader.takeErrors()
+ .empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+
+ auto changedCompositionTypes =
+ mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId());
+ ASSERT_TRUE(changedCompositionTypes.empty());
+
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId())
+ .reader.takeErrors()
+ .empty());
+
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(), coloredSquare,
+ {188.f / 255.f, 188.f / 255.f, 188.f / 255.f, 1.0f});
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
-
- // expected color for each pixel
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare,
- WHITE);
-
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(),
- getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
- layer->setDisplayFrame(coloredSquare);
- layer->setZOrder(10);
- layer->setDataspace(Dataspace::SRGB);
-
- Luts luts;
- generateLuts(&luts, l.dimension, l.size, key);
- layer->setLuts(std::move(luts));
-
- ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
-
- std::vector<std::shared_ptr<TestLayer>> layers = {layer};
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient,
- getDisplayWidth(), getDisplayHeight(), mPixelFormat,
- mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- // if hwc cannot handle and asks for composition change,
- // just succeed the test
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
-
- auto changedCompositionTypes =
- mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
- ASSERT_TRUE(changedCompositionTypes.empty());
-
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare,
- {188.f / 255.f, 188.f / 255.f, 188.f / 255.f, 1.0f});
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(layers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
}
}
TEST_P(GraphicsCompositionTest, MixedColorSpaces) {
- ASSERT_TRUE(
- mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kClientTargetSlotCount)
- .isOk());
const auto& [status, properties] = mComposerClient->getOverlaySupport();
if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC &&
status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
- GTEST_SUCCEED() << "getOverlaySupport is not supported";
- return;
+ ALOGI("getOverlaySupport is not supported");
+ GTEST_SKIP();
}
if (properties.supportMixedColorSpaces == false) {
- GTEST_SUCCEED() << "supportMixedColorSpaces is not supported";
- return;
+ ALOGI("supportMixedColorSpaces is not supported");
+ GTEST_SKIP();
}
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ ASSERT_TRUE(
+ mComposerClient
+ ->setClientTargetSlotCount(display->getDisplayId(), kClientTargetSlotCount)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
+
+ // sRGB layer
+ auto srgbLayer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), display->getDisplayWidth(),
+ display->getDisplayHeight() / 2, PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ std::vector<Color> sRgbDeviceColors(srgbLayer->getWidth() * srgbLayer->getHeight());
+ ReadbackHelper::fillColorsArea(sRgbDeviceColors, display->getDisplayWidth(),
+ {0, 0, static_cast<int32_t>(srgbLayer->getWidth()),
+ static_cast<int32_t>(srgbLayer->getHeight())},
+ GREEN);
+ srgbLayer->setDisplayFrame({0, 0, static_cast<int32_t>(srgbLayer->getWidth()),
+ static_cast<int32_t>(srgbLayer->getHeight())});
+ srgbLayer->setZOrder(10);
+ srgbLayer->setDataspace(Dataspace::SRGB);
+ ASSERT_NO_FATAL_FAILURE(srgbLayer->setBuffer(sRgbDeviceColors));
+
+ // display P3 layer
+ auto displayP3Layer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), display->getDisplayWidth(),
+ display->getDisplayHeight() / 2, PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ std::vector<Color> displayP3DeviceColors(
+ static_cast<size_t>(displayP3Layer->getWidth() * displayP3Layer->getHeight()));
+ ReadbackHelper::fillColorsArea(displayP3DeviceColors, display->getDisplayWidth(),
+ {0, 0, static_cast<int32_t>(displayP3Layer->getWidth()),
+ static_cast<int32_t>(displayP3Layer->getHeight())},
+ RED);
+ displayP3Layer->setDisplayFrame({0, display->getDisplayHeight() / 2,
+ display->getDisplayWidth(),
+ display->getDisplayHeight()});
+ displayP3Layer->setZOrder(10);
+ displayP3Layer->setDataspace(Dataspace::DISPLAY_P3);
+ ASSERT_NO_FATAL_FAILURE(displayP3Layer->setBuffer(displayP3DeviceColors));
+
+ writeLayers({srgbLayer, displayP3Layer}, display->getDisplayId());
+
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+
+ auto changedCompositionTypes =
+ mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId());
+ ASSERT_TRUE(changedCompositionTypes.empty());
+
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ changedCompositionTypes =
+ mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId());
+ ASSERT_TRUE(changedCompositionTypes.empty());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
}
-
- // sRGB layer
- auto srgbLayer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight() / 2, PixelFormat::RGBA_8888, *mWriter);
- std::vector<Color> sRgbDeviceColors(srgbLayer->getWidth() * srgbLayer->getHeight());
- ReadbackHelper::fillColorsArea(sRgbDeviceColors, getDisplayWidth(),
- {0, 0, static_cast<int32_t>(srgbLayer->getWidth()),
- static_cast<int32_t>(srgbLayer->getHeight())},
- GREEN);
- srgbLayer->setDisplayFrame({0, 0, static_cast<int32_t>(srgbLayer->getWidth()),
- static_cast<int32_t>(srgbLayer->getHeight())});
- srgbLayer->setZOrder(10);
- srgbLayer->setDataspace(Dataspace::SRGB);
- ASSERT_NO_FATAL_FAILURE(srgbLayer->setBuffer(sRgbDeviceColors));
-
- // display P3 layer
- auto displayP3Layer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight() / 2, PixelFormat::RGBA_8888, *mWriter);
- std::vector<Color> displayP3DeviceColors(
- static_cast<size_t>(displayP3Layer->getWidth() * displayP3Layer->getHeight()));
- ReadbackHelper::fillColorsArea(displayP3DeviceColors, getDisplayWidth(),
- {0, 0, static_cast<int32_t>(displayP3Layer->getWidth()),
- static_cast<int32_t>(displayP3Layer->getHeight())},
- RED);
- displayP3Layer->setDisplayFrame(
- {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()});
- displayP3Layer->setZOrder(10);
- displayP3Layer->setDataspace(Dataspace::DISPLAY_P3);
- ASSERT_NO_FATAL_FAILURE(displayP3Layer->setBuffer(displayP3DeviceColors));
-
- writeLayers({srgbLayer, displayP3Layer});
-
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
-
- auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
- ASSERT_TRUE(changedCompositionTypes.empty());
-
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
-
- changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
- ASSERT_TRUE(changedCompositionTypes.empty());
- ASSERT_TRUE(mReader.takeErrors().empty());
}
}
TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) {
- ASSERT_TRUE(
- mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kClientTargetSlotCount)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ ASSERT_TRUE(
+ mComposerClient
+ ->setClientTargetSlotCount(display->getDisplayId(), kClientTargetSlotCount)
+ .isOk());
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight() / 2}, GREEN);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, display->getDisplayHeight() / 2, display->getDisplayWidth(),
+ display->getDisplayHeight()},
+ RED);
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ auto deviceLayer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), display->getDisplayWidth(),
+ display->getDisplayHeight() / 2, PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ std::vector<Color> deviceColors(deviceLayer->getWidth() * deviceLayer->getHeight());
+ ReadbackHelper::fillColorsArea(deviceColors,
+ static_cast<int32_t>(deviceLayer->getWidth()),
+ {0, 0, static_cast<int32_t>(deviceLayer->getWidth()),
+ static_cast<int32_t>(deviceLayer->getHeight())},
+ GREEN);
+ deviceLayer->setDisplayFrame({0, 0, static_cast<int32_t>(deviceLayer->getWidth()),
+ static_cast<int32_t>(deviceLayer->getHeight())});
+ deviceLayer->setZOrder(10);
+ deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
+ ASSERT_NO_FATAL_FAILURE(deviceLayer->setBuffer(deviceColors));
+ deviceLayer->write(mDisplayProperties.at(display->getDisplayId()).writer);
+
+ PixelFormat clientFormat = PixelFormat::RGBA_8888;
+ auto clientUsage = static_cast<uint32_t>(
+ static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
+ static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+ static_cast<uint32_t>(common::BufferUsage::COMPOSER_CLIENT_TARGET));
+ Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
+ int32_t clientWidth = display->getDisplayWidth();
+ int32_t clientHeight = display->getDisplayHeight() / 2;
+
+ auto clientLayer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), clientWidth, clientHeight, PixelFormat::RGBA_FP16,
+ mDisplayProperties.at(display->getDisplayId()).writer, Composition::DEVICE);
+ common::Rect clientFrame = {0, display->getDisplayHeight() / 2,
+ display->getDisplayWidth(), display->getDisplayHeight()};
+ clientLayer->setDisplayFrame(clientFrame);
+ clientLayer->setZOrder(0);
+ clientLayer->write(mDisplayProperties.at(display->getDisplayId()).writer);
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+
+ auto changedCompositionTypes =
+ mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId());
+ if (changedCompositionTypes.size() != 1) {
+ continue;
+ }
+ // create client target buffer
+ ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
+ const auto& [graphicBufferStatus, graphicBuffer] =
+ allocateBuffer(*display, clientUsage);
+ ASSERT_TRUE(graphicBufferStatus);
+ const auto& buffer = graphicBuffer->handle;
+
+ void* clientBufData;
+ int bytesPerPixel = -1;
+ int bytesPerStride = -1;
+ graphicBuffer->lock(clientUsage,
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight()},
+ &clientBufData, &bytesPerPixel, &bytesPerStride);
+
+ std::vector<Color> clientColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(clientColors, display->getDisplayWidth(), clientFrame,
+ RED);
+ ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(
+ static_cast<uint32_t>(display->getDisplayWidth()),
+ static_cast<uint32_t>(display->getDisplayHeight()), graphicBuffer->getStride(),
+ bytesPerPixel, clientBufData, clientFormat, clientColors));
+ int32_t clientFence;
+ const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence);
+ ASSERT_EQ(::android::OK, unlockStatus);
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.setClientTarget(display->getDisplayId(), /*slot*/ 0, buffer,
+ clientFence, clientDataspace,
+ std::vector<common::Rect>(1, clientFrame), 1.f);
+ clientLayer->setToClientComposition(
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ changedCompositionTypes =
+ mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId());
+ ASSERT_TRUE(changedCompositionTypes.empty());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {0, 0, getDisplayWidth(), getDisplayHeight() / 2}, GREEN);
- ReadbackHelper::fillColorsArea(
- expectedColors, getDisplayWidth(),
- {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, RED);
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- auto deviceLayer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight() / 2, PixelFormat::RGBA_8888, *mWriter);
- std::vector<Color> deviceColors(deviceLayer->getWidth() * deviceLayer->getHeight());
- ReadbackHelper::fillColorsArea(deviceColors, static_cast<int32_t>(deviceLayer->getWidth()),
- {0, 0, static_cast<int32_t>(deviceLayer->getWidth()),
- static_cast<int32_t>(deviceLayer->getHeight())},
- GREEN);
- deviceLayer->setDisplayFrame({0, 0, static_cast<int32_t>(deviceLayer->getWidth()),
- static_cast<int32_t>(deviceLayer->getHeight())});
- deviceLayer->setZOrder(10);
- deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
- ASSERT_NO_FATAL_FAILURE(deviceLayer->setBuffer(deviceColors));
- deviceLayer->write(*mWriter);
-
- PixelFormat clientFormat = PixelFormat::RGBA_8888;
- auto clientUsage = static_cast<uint32_t>(
- static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
- static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
- static_cast<uint32_t>(common::BufferUsage::COMPOSER_CLIENT_TARGET));
- Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
- int32_t clientWidth = getDisplayWidth();
- int32_t clientHeight = getDisplayHeight() / 2;
-
- auto clientLayer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), clientWidth,
- clientHeight, PixelFormat::RGBA_FP16, *mWriter, Composition::DEVICE);
- common::Rect clientFrame = {0, getDisplayHeight() / 2, getDisplayWidth(),
- getDisplayHeight()};
- clientLayer->setDisplayFrame(clientFrame);
- clientLayer->setZOrder(0);
- clientLayer->write(*mWriter);
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
-
- auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
- if (changedCompositionTypes.size() != 1) {
- continue;
- }
- // create client target buffer
- ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
- const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(clientUsage);
- ASSERT_TRUE(graphicBufferStatus);
- const auto& buffer = graphicBuffer->handle;
-
- void* clientBufData;
- int bytesPerPixel = -1;
- int bytesPerStride = -1;
- graphicBuffer->lock(clientUsage, {0, 0, getDisplayWidth(), getDisplayHeight()},
- &clientBufData, &bytesPerPixel, &bytesPerStride);
-
- std::vector<Color> clientColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(clientColors, getDisplayWidth(), clientFrame, RED);
- ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(
- static_cast<uint32_t>(getDisplayWidth()), static_cast<uint32_t>(getDisplayHeight()),
- graphicBuffer->getStride(), bytesPerPixel, clientBufData, clientFormat,
- clientColors));
- int32_t clientFence;
- const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence);
- ASSERT_EQ(::android::OK, unlockStatus);
- mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence,
- clientDataspace, std::vector<common::Rect>(1, clientFrame), 1.f);
- clientLayer->setToClientComposition(*mWriter);
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
- ASSERT_TRUE(changedCompositionTypes.empty());
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetLayerDamage) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ common::Rect redRect = {0, 0, display->getDisplayWidth() / 4,
+ display->getDisplayHeight() / 4};
+
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(), redRect,
+ RED);
+
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), display->getDisplayWidth(),
+ display->getDisplayHeight(), PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ layer->setDisplayFrame({0, 0, display->getDisplayWidth(), display->getDisplayHeight()});
+ layer->setZOrder(10);
+ layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
+ ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
+
+ std::vector<std::shared_ptr<TestLayer>> layers = {layer};
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+
+ // update surface damage and recheck
+ redRect = {display->getDisplayWidth() / 4, display->getDisplayHeight() / 4,
+ display->getDisplayWidth() / 2, display->getDisplayHeight() / 2};
+ ReadbackHelper::clearColors(expectedColors, display->getDisplayWidth(),
+ display->getDisplayHeight(), display->getDisplayWidth());
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(), redRect,
+ RED);
+
+ ASSERT_NO_FATAL_FAILURE(layer->fillBuffer(expectedColors));
+ layer->setSurfaceDamage(std::vector<common::Rect>(
+ 1, {0, 0, display->getDisplayWidth() / 2, display->getDisplayWidth() / 2}));
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
-
- common::Rect redRect = {0, 0, getDisplayWidth() / 4, getDisplayHeight() / 4};
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
-
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
- layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
- layer->setZOrder(10);
- layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
- ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
-
- std::vector<std::shared_ptr<TestLayer>> layers = {layer};
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
-
- // update surface damage and recheck
- redRect = {getDisplayWidth() / 4, getDisplayHeight() / 4, getDisplayWidth() / 2,
- getDisplayHeight() / 2};
- ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(),
- getDisplayWidth());
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
-
- ASSERT_NO_FATAL_FAILURE(layer->fillBuffer(expectedColors));
- layer->setSurfaceDamage(
- std::vector<common::Rect>(1, {0, 0, getDisplayWidth() / 2, getDisplayWidth() / 2}));
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ auto layer = std::make_shared<TestColorLayer>(
+ mComposerClient, display->getDisplayId(),
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ layer->setColor(RED);
+ layer->setDisplayFrame({0, 0, display->getDisplayWidth(), display->getDisplayHeight()});
+ layer->setZOrder(10);
+ layer->setAlpha(0);
+ layer->setBlendMode(BlendMode::PREMULTIPLIED);
+
+ std::vector<std::shared_ptr<TestLayer>> layers = {layer};
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- auto layer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- layer->setColor(RED);
- layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
- layer->setZOrder(10);
- layer->setAlpha(0);
- layer->setBlendMode(BlendMode::PREMULTIPLIED);
-
- std::vector<std::shared_ptr<TestLayer>> layers = {layer};
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(layers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight() / 4}, RED);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, display->getDisplayHeight() / 2, display->getDisplayWidth(),
+ display->getDisplayHeight()},
+ BLUE);
+
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display->getDisplayId()).testRenderEngine,
+ display->getDisplayId(), display->getDisplayWidth(),
+ display->getDisplayHeight(), PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ layer->setDisplayFrame({0, 0, display->getDisplayWidth(), display->getDisplayHeight()});
+ layer->setZOrder(10);
+ layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
+ layer->setSourceCrop({0, static_cast<float>(display->getDisplayHeight() / 2),
+ static_cast<float>(display->getDisplayWidth()),
+ static_cast<float>(display->getDisplayHeight())});
+ ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
+
+ std::vector<std::shared_ptr<TestLayer>> layers = {layer};
+
+ // update expected colors to match crop
+ ReadbackHelper::fillColorsArea(
+ expectedColors, display->getDisplayWidth(),
+ {0, 0, display->getDisplayWidth(), display->getDisplayHeight()}, BLUE);
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED);
- ReadbackHelper::fillColorsArea(
- expectedColors, getDisplayWidth(),
- {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
-
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
- layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
- layer->setZOrder(10);
- layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
- layer->setSourceCrop({0, static_cast<float>(getDisplayHeight() / 2),
- static_cast<float>(getDisplayWidth()),
- static_cast<float>(getDisplayHeight())});
- ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
-
- std::vector<std::shared_ptr<TestLayer>> layers = {layer};
-
- // update expected colors to match crop
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {0, 0, getDisplayWidth(), getDisplayHeight()}, BLUE);
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(layers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetLayerZOrder) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ common::Rect redRect = {0, 0, display->getDisplayWidth(),
+ display->getDisplayHeight() / 2};
+ common::Rect blueRect = {0, display->getDisplayHeight() / 4, display->getDisplayWidth(),
+ display->getDisplayHeight()};
+ auto redLayer = std::make_shared<TestColorLayer>(
+ mComposerClient, display->getDisplayId(),
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ redLayer->setColor(RED);
+ redLayer->setDisplayFrame(redRect);
+
+ auto blueLayer = std::make_shared<TestColorLayer>(
+ mComposerClient, display->getDisplayId(),
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ blueLayer->setColor(BLUE);
+ blueLayer->setDisplayFrame(blueRect);
+ blueLayer->setZOrder(5);
+
+ std::vector<std::shared_ptr<TestLayer>> layers = {redLayer, blueLayer};
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+
+ // red in front of blue
+ redLayer->setZOrder(10);
+
+ // fill blue first so that red will overwrite on overlap
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(), blueRect,
+ BLUE);
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(), redRect,
+ RED);
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+
+ redLayer->setZOrder(1);
+ ReadbackHelper::clearColors(expectedColors, display->getDisplayWidth(),
+ display->getDisplayHeight(), display->getDisplayWidth());
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(), redRect,
+ RED);
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(), blueRect,
+ BLUE);
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2};
- common::Rect blueRect = {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight()};
- auto redLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- redLayer->setColor(RED);
- redLayer->setDisplayFrame(redRect);
-
- auto blueLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- blueLayer->setColor(BLUE);
- blueLayer->setDisplayFrame(blueRect);
- blueLayer->setZOrder(5);
-
- std::vector<std::shared_ptr<TestLayer>> layers = {redLayer, blueLayer};
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
-
- // red in front of blue
- redLayer->setZOrder(10);
-
- // fill blue first so that red will overwrite on overlap
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), blueRect, BLUE);
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
-
- redLayer->setZOrder(1);
- ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(),
- getDisplayWidth());
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), blueRect, BLUE);
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(layers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace for "
- "color mode: "
- << toString(mode);
- continue;
+ const common::Rect redRect = {0, 0, display->getDisplayWidth(),
+ display->getDisplayHeight() / 2};
+ const common::Rect dimmerRedRect = {0, display->getDisplayHeight() / 2,
+ display->getDisplayWidth(),
+ display->getDisplayHeight()};
+
+ static constexpr float kMaxBrightnessNits = 300.f;
+
+ const auto redLayer = std::make_shared<TestColorLayer>(
+ mComposerClient, display->getDisplayId(),
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ redLayer->setColor(RED);
+ redLayer->setDisplayFrame(redRect);
+ redLayer->setWhitePointNits(kMaxBrightnessNits);
+ redLayer->setBrightness(1.f);
+
+ const auto dimmerRedLayer = std::make_shared<TestColorLayer>(
+ mComposerClient, display->getDisplayId(),
+ mDisplayProperties.at(display->getDisplayId()).writer);
+ dimmerRedLayer->setColor(RED);
+ dimmerRedLayer->setDisplayFrame(dimmerRedRect);
+ // Intentionally use a small dimming ratio as some implementations may be more likely
+ // to kick into GPU composition to apply dithering when the dimming ratio is high.
+ static constexpr float kDimmingRatio = 0.9f;
+ dimmerRedLayer->setWhitePointNits(kMaxBrightnessNits * kDimmingRatio);
+ dimmerRedLayer->setBrightness(kDimmingRatio);
+
+ const std::vector<std::shared_ptr<TestLayer>> layers = {redLayer, dimmerRedLayer};
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(), redRect,
+ RED);
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ dimmerRedRect, DIM_RED);
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ ALOGI(" Readback verification not supported for GPU composition for color mode %d",
+ mode);
+ continue;
+ }
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
- const common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2};
- const common::Rect dimmerRedRect = {0, getDisplayHeight() / 2, getDisplayWidth(),
- getDisplayHeight()};
-
- static constexpr float kMaxBrightnessNits = 300.f;
-
- const auto redLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- redLayer->setColor(RED);
- redLayer->setDisplayFrame(redRect);
- redLayer->setWhitePointNits(kMaxBrightnessNits);
- redLayer->setBrightness(1.f);
-
- const auto dimmerRedLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- dimmerRedLayer->setColor(RED);
- dimmerRedLayer->setDisplayFrame(dimmerRedRect);
- // Intentionally use a small dimming ratio as some implementations may be more likely to
- // kick into GPU composition to apply dithering when the dimming ratio is high.
- static constexpr float kDimmingRatio = 0.9f;
- dimmerRedLayer->setWhitePointNits(kMaxBrightnessNits * kDimmingRatio);
- dimmerRedLayer->setBrightness(kDimmingRatio);
-
- const std::vector<std::shared_ptr<TestLayer>> layers = {redLayer, dimmerRedLayer};
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
-
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), dimmerRedRect, DIM_RED);
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- writeLayers(layers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED()
- << "Readback verification not supported for GPU composition for color mode: "
- << toString(mode);
- continue;
- }
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(layers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
@@ -1176,38 +1359,49 @@
public:
void SetUp() override {
SetUpBase(std::get<0>(GetParam()));
- // TODO(b/219590743) we should remove the below SRGB color mode
- // once we have the BlendMode test fix for all the versions of the ColorMode
- mTestColorModes.erase(
- std::remove_if(mTestColorModes.begin(), mTestColorModes.end(),
- [](ColorMode mode) { return mode != ColorMode::SRGB; }),
- mTestColorModes.end());
- mBackgroundColor = BLACK;
- mTopLayerColor = RED;
+ for (const DisplayWrapper& display : mAllDisplays) {
+ // TODO(b/219590743) we should remove the below SRGB color mode
+ // once we have the BlendMode test fix for all the versions of the ColorMode
+ auto& testColorModes = mDisplayProperties.at(display.getDisplayId()).testColorModes;
+ testColorModes.erase(
+ std::remove_if(testColorModes.begin(), testColorModes.end(),
+ [](ColorMode mode) { return mode != ColorMode::SRGB; }),
+ testColorModes.end());
+ }
}
- void setBackgroundColor(Color color) { mBackgroundColor = color; }
+ void setBackgroundColor(int64_t displayId, Color color) {
+ mDisplayGfx[displayId].backgroundColor = color;
+ }
- void setTopLayerColor(Color color) { mTopLayerColor = color; }
+ void setTopLayerColor(int64_t displayId, Color color) {
+ mDisplayGfx[displayId].topLayerColor = color;
+ }
- void setUpLayers(BlendMode blendMode) {
- mLayers.clear();
+ void setUpLayers(const DisplayWrapper& display, BlendMode blendMode) {
+ auto& layers = mDisplayGfx[display.getDisplayId()].layers;
+ layers.clear();
+
std::vector<Color> topLayerPixelColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(topLayerPixelColors, getDisplayWidth(),
- {0, 0, getDisplayWidth(), getDisplayHeight()},
- mTopLayerColor);
+ static_cast<size_t>(display.getDisplayWidth() * display.getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(
+ topLayerPixelColors, display.getDisplayWidth(),
+ {0, 0, display.getDisplayWidth(), display.getDisplayHeight()},
+ mDisplayGfx[display.getDisplayId()].topLayerColor);
- auto backgroundLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
+ auto backgroundLayer = std::make_shared<TestColorLayer>(
+ mComposerClient, display.getDisplayId(),
+ mDisplayProperties.at(display.getDisplayId()).writer);
+ backgroundLayer->setDisplayFrame(
+ {0, 0, display.getDisplayWidth(), display.getDisplayHeight()});
backgroundLayer->setZOrder(0);
- backgroundLayer->setColor(mBackgroundColor);
+ backgroundLayer->setColor(mDisplayGfx[display.getDisplayId()].backgroundColor);
auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
- layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
+ mComposerClient, *mDisplayProperties.at(display.getDisplayId()).testRenderEngine,
+ display.getDisplayId(), display.getDisplayWidth(), display.getDisplayHeight(),
+ PixelFormat::RGBA_8888, mDisplayProperties.at(display.getDisplayId()).writer);
+ layer->setDisplayFrame({0, 0, display.getDisplayWidth(), display.getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(Dataspace::UNKNOWN);
ASSERT_NO_FATAL_FAILURE(layer->setBuffer(topLayerPixelColors));
@@ -1215,179 +1409,202 @@
layer->setBlendMode(blendMode);
layer->setAlpha(std::stof(std::get<1>(GetParam())));
- mLayers.push_back(backgroundLayer);
- mLayers.push_back(layer);
+ layers.push_back(backgroundLayer);
+ layers.push_back(layer);
}
- void setExpectedColors(std::vector<Color>& expectedColors) {
- ASSERT_EQ(2, mLayers.size());
- ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(),
- getDisplayWidth());
+ void setExpectedColors(const DisplayWrapper& display, std::vector<Color>& expectedColors) {
+ auto& layers = mDisplayGfx[display.getDisplayId()].layers;
+ ASSERT_EQ(2, layers.size());
+ ReadbackHelper::clearColors(expectedColors, display.getDisplayWidth(),
+ display.getDisplayHeight(), display.getDisplayWidth());
- auto layer = mLayers[1];
+ auto layer = layers[1];
BlendMode blendMode = layer->getBlendMode();
- float alpha = mTopLayerColor.a * layer->getAlpha();
+ auto& topLayerColor = mDisplayGfx[display.getDisplayId()].topLayerColor;
+ auto& backgroundColor = mDisplayGfx[display.getDisplayId()].backgroundColor;
+ float alpha = topLayerColor.a * layer->getAlpha();
if (blendMode == BlendMode::NONE) {
for (auto& expectedColor : expectedColors) {
- expectedColor.r = mTopLayerColor.r * layer->getAlpha();
- expectedColor.g = mTopLayerColor.g * layer->getAlpha();
- expectedColor.b = mTopLayerColor.b * layer->getAlpha();
+ expectedColor.r = topLayerColor.r * layer->getAlpha();
+ expectedColor.g = topLayerColor.g * layer->getAlpha();
+ expectedColor.b = topLayerColor.b * layer->getAlpha();
expectedColor.a = alpha;
}
} else if (blendMode == BlendMode::PREMULTIPLIED) {
for (auto& expectedColor : expectedColors) {
expectedColor.r =
- mTopLayerColor.r * layer->getAlpha() + mBackgroundColor.r * (1.0f - alpha);
+ topLayerColor.r * layer->getAlpha() + backgroundColor.r * (1.0f - alpha);
expectedColor.g =
- mTopLayerColor.g * layer->getAlpha() + mBackgroundColor.g * (1.0f - alpha);
+ topLayerColor.g * layer->getAlpha() + backgroundColor.g * (1.0f - alpha);
expectedColor.b =
- mTopLayerColor.b * layer->getAlpha() + mBackgroundColor.b * (1.0f - alpha);
- expectedColor.a = alpha + mBackgroundColor.a * (1.0f - alpha);
+ topLayerColor.b * layer->getAlpha() + backgroundColor.b * (1.0f - alpha);
+ expectedColor.a = alpha + backgroundColor.a * (1.0f - alpha);
}
} else if (blendMode == BlendMode::COVERAGE) {
for (auto& expectedColor : expectedColors) {
- expectedColor.r = mTopLayerColor.r * alpha + mBackgroundColor.r * (1.0f - alpha);
- expectedColor.g = mTopLayerColor.g * alpha + mBackgroundColor.g * (1.0f - alpha);
- expectedColor.b = mTopLayerColor.b * alpha + mBackgroundColor.b * (1.0f - alpha);
- expectedColor.a = mTopLayerColor.a * alpha + mBackgroundColor.a * (1.0f - alpha);
+ expectedColor.r = topLayerColor.r * alpha + backgroundColor.r * (1.0f - alpha);
+ expectedColor.g = topLayerColor.g * alpha + backgroundColor.g * (1.0f - alpha);
+ expectedColor.b = topLayerColor.b * alpha + backgroundColor.b * (1.0f - alpha);
+ expectedColor.a = topLayerColor.a * alpha + backgroundColor.a * (1.0f - alpha);
}
}
}
protected:
- std::vector<std::shared_ptr<TestLayer>> mLayers;
- Color mBackgroundColor;
- Color mTopLayerColor;
+ struct DisplayGraphics {
+ std::vector<std::shared_ptr<TestLayer>> layers;
+ Color backgroundColor = BLACK;
+ Color topLayerColor = RED;
+ };
+
+ std::unordered_map<int64_t, struct DisplayGraphics> mDisplayGfx;
};
TEST_P(GraphicsBlendModeCompositionTest, None) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+
+ setBackgroundColor(display->getDisplayId(), BLACK);
+ setTopLayerColor(display->getDisplayId(), TRANSLUCENT_RED);
+ setUpLayers(*display, BlendMode::NONE);
+ setExpectedColors(*display, expectedColors);
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+ auto& layers = mDisplayGfx[display->getDisplayId()].layers;
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
-
- setBackgroundColor(BLACK);
- setTopLayerColor(TRANSLUCENT_RED);
- setUpLayers(BlendMode::NONE);
- setExpectedColors(expectedColors);
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- writeLayers(mLayers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(mLayers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
TEST_P(GraphicsBlendModeCompositionTest, Coverage) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+
+ setBackgroundColor(display->getDisplayId(), BLACK);
+ setTopLayerColor(display->getDisplayId(), TRANSLUCENT_RED);
+
+ setUpLayers(*display, BlendMode::COVERAGE);
+ setExpectedColors(*display, expectedColors);
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+ auto& layers = mDisplayGfx[display->getDisplayId()].layers;
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
-
- setBackgroundColor(BLACK);
- setTopLayerColor(TRANSLUCENT_RED);
-
- setUpLayers(BlendMode::COVERAGE);
- setExpectedColors(expectedColors);
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- writeLayers(mLayers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
}
TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+
+ setBackgroundColor(display->getDisplayId(), BLACK);
+ setTopLayerColor(display->getDisplayId(), TRANSLUCENT_RED);
+ setUpLayers(*display, BlendMode::PREMULTIPLIED);
+ setExpectedColors(*display, expectedColors);
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+ auto& layers = mDisplayGfx[display->getDisplayId()].layers;
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
-
- setBackgroundColor(BLACK);
- setTopLayerColor(TRANSLUCENT_RED);
- setUpLayers(BlendMode::PREMULTIPLIED);
- setExpectedColors(expectedColors);
-
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- writeLayers(mLayers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(mLayers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
@@ -1396,177 +1613,219 @@
void SetUp() override {
GraphicsCompositionTest::SetUp();
- auto backgroundLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
- backgroundLayer->setColor({0.0f, 0.0f, 0.0f, 0.0f});
- backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
- backgroundLayer->setZOrder(0);
+ for (const DisplayWrapper& display : mAllDisplays) {
+ auto backgroundLayer = std::make_shared<TestColorLayer>(
+ mComposerClient, display.getDisplayId(),
+ mDisplayProperties.at(display.getDisplayId()).writer);
+ backgroundLayer->setColor({0.0f, 0.0f, 0.0f, 0.0f});
+ backgroundLayer->setDisplayFrame(
+ {0, 0, display.getDisplayWidth(), display.getDisplayHeight()});
+ backgroundLayer->setZOrder(0);
- mSideLength =
- getDisplayWidth() < getDisplayHeight() ? getDisplayWidth() : getDisplayHeight();
- common::Rect redRect = {0, 0, mSideLength / 2, mSideLength / 2};
- common::Rect blueRect = {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength};
+ int& sideLength = mDisplayGfx[display.getDisplayId()].sideLength;
+ sideLength = display.getDisplayWidth() < display.getDisplayHeight()
+ ? display.getDisplayWidth()
+ : display.getDisplayHeight();
+ common::Rect redRect = {0, 0, sideLength / 2, sideLength / 2};
+ common::Rect blueRect = {sideLength / 2, sideLength / 2, sideLength, sideLength};
- mLayer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), mSideLength, mSideLength,
- PixelFormat::RGBA_8888, *mWriter);
- mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength});
- mLayer->setZOrder(10);
+ auto& bufferLayer = mDisplayGfx[display.getDisplayId()].bufferLayer;
+ bufferLayer = std::make_shared<TestBufferLayer>(
+ mComposerClient,
+ *mDisplayProperties.at(display.getDisplayId()).testRenderEngine,
+ display.getDisplayId(), static_cast<uint32_t>(sideLength),
+ static_cast<uint32_t>(sideLength), PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display.getDisplayId()).writer);
+ bufferLayer->setDisplayFrame({0, 0, sideLength, sideLength});
+ bufferLayer->setZOrder(10);
- std::vector<Color> baseColors(static_cast<size_t>(mSideLength * mSideLength));
- ReadbackHelper::fillColorsArea(baseColors, mSideLength, redRect, RED);
- ReadbackHelper::fillColorsArea(baseColors, mSideLength, blueRect, BLUE);
- ASSERT_NO_FATAL_FAILURE(mLayer->setBuffer(baseColors));
- mLayers = {backgroundLayer, mLayer};
+ std::vector<Color> baseColors(static_cast<size_t>(sideLength * sideLength));
+ ReadbackHelper::fillColorsArea(baseColors, sideLength, redRect, RED);
+ ReadbackHelper::fillColorsArea(baseColors, sideLength, blueRect, BLUE);
+ ASSERT_NO_FATAL_FAILURE(bufferLayer->setBuffer(baseColors));
+ mDisplayGfx[display.getDisplayId()].layers = {backgroundLayer, bufferLayer};
+ }
}
protected:
- std::shared_ptr<TestBufferLayer> mLayer;
- std::vector<std::shared_ptr<TestLayer>> mLayers;
- int mSideLength;
+ struct DisplayGraphics {
+ std::shared_ptr<TestBufferLayer> bufferLayer;
+ std::vector<std::shared_ptr<TestLayer>> layers;
+ int sideLength;
+ };
+
+ std::unordered_map<int64_t, struct DisplayGraphics> mDisplayGfx;
};
TEST_P(GraphicsTransformCompositionTest, FLIP_H) {
- for (ColorMode mode : mTestColorModes) {
- auto status = mComposerClient->setColorMode(getPrimaryDisplayId(), mode,
- RenderIntent::COLORIMETRIC);
- if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC &&
- (status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED ||
- status.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) {
- SUCCEED() << "ColorMode not supported, skip test";
- return;
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ auto status = mComposerClient->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC);
+ if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC &&
+ (status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED ||
+ status.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) {
+ ALOGI("ColorMode not supported on Display %" PRId64 " for ColorMode %d",
+ display->getDisplayId(), mode);
+ continue;
+ }
+
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+ auto& bufferLayer = mDisplayGfx[display->getDisplayId()].bufferLayer;
+ bufferLayer->setTransform(Transform::FLIP_H);
+ bufferLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
+
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ int& sideLength = mDisplayGfx[display->getDisplayId()].sideLength;
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ {sideLength / 2, 0, sideLength, sideLength / 2}, RED);
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ {0, sideLength / 2, sideLength / 2, sideLength}, BLUE);
+
+ auto& layers = mDisplayGfx[display->getDisplayId()].layers;
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
-
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
- }
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- mLayer->setTransform(Transform::FLIP_H);
- mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {mSideLength / 2, 0, mSideLength, mSideLength / 2}, RED);
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {0, mSideLength / 2, mSideLength / 2, mSideLength}, BLUE);
-
- writeLayers(mLayers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(mLayers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
TEST_P(GraphicsTransformCompositionTest, FLIP_V) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ auto& bufferLayer = mDisplayGfx[display->getDisplayId()].bufferLayer;
+ bufferLayer->setTransform(Transform::FLIP_V);
+ bufferLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
+
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ int& sideLength = mDisplayGfx[display->getDisplayId()].sideLength;
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ {0, sideLength / 2, sideLength / 2, sideLength}, RED);
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ {sideLength / 2, 0, sideLength, sideLength / 2}, BLUE);
+
+ auto& layers = mDisplayGfx[display->getDisplayId()].layers;
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- mLayer->setTransform(Transform::FLIP_V);
- mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {0, mSideLength / 2, mSideLength / 2, mSideLength}, RED);
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {mSideLength / 2, 0, mSideLength, mSideLength / 2}, BLUE);
-
- writeLayers(mLayers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(mLayers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
TEST_P(GraphicsTransformCompositionTest, ROT_180) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+
+ auto& bufferLayer = mDisplayGfx[display->getDisplayId()].bufferLayer;
+ bufferLayer->setTransform(Transform::ROT_180);
+ bufferLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
+
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(display->getDisplayWidth() * display->getDisplayHeight()));
+ int& sideLength = mDisplayGfx[display->getDisplayId()].sideLength;
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ {sideLength / 2, sideLength / 2, sideLength, sideLength},
+ RED);
+ ReadbackHelper::fillColorsArea(expectedColors, display->getDisplayWidth(),
+ {0, 0, sideLength / 2, sideLength / 2}, BLUE);
+
+ auto& layers = mDisplayGfx[display->getDisplayId()].layers;
+ writeLayers(layers, display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers(layers);
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->checkColorBuffer(expectedColors));
}
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
-
- mLayer->setTransform(Transform::ROT_180);
- mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
-
- std::vector<Color> expectedColors(
- static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength},
- RED);
- ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
- {0, 0, mSideLength / 2, mSideLength / 2}, BLUE);
-
- writeLayers(mLayers);
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- GTEST_SUCCEED();
- return;
- }
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
- mTestRenderEngine->setRenderLayers(mLayers);
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors));
}
}
@@ -1576,92 +1835,117 @@
public:
void SetUp() override {
SetUpBase(std::get<0>(GetParam()));
- // for some reason only sRGB reliably works
- mTestColorModes.erase(
- std::remove_if(mTestColorModes.begin(), mTestColorModes.end(),
- [](ColorMode mode) { return mode != ColorMode::SRGB; }),
- mTestColorModes.end());
- auto standard = std::get<1>(GetParam());
- auto transfer = std::get<2>(GetParam());
- auto range = std::get<3>(GetParam());
+ for (const DisplayWrapper& display : mAllDisplays) {
+ // for some reason only sRGB reliably works
+ auto& testColorModes = mDisplayProperties.at(display.getDisplayId()).testColorModes;
+ testColorModes.erase(
+ std::remove_if(testColorModes.begin(), testColorModes.end(),
+ [](ColorMode mode) { return mode != ColorMode::SRGB; }),
+ testColorModes.end());
+ auto standard = std::get<1>(GetParam());
+ auto transfer = std::get<2>(GetParam());
+ auto range = std::get<3>(GetParam());
- mLayerDataspace = static_cast<Dataspace>(static_cast<int32_t>(standard) |
- static_cast<int32_t>(transfer) |
- static_cast<int32_t>(range));
- ALOGD("Invoking test for dataspace: {%s, %s, %s}", toString(standard).c_str(),
- toString(transfer).c_str(), toString(range).c_str());
+ mDisplayGfx[display.getDisplayId()].layerDataspace = static_cast<Dataspace>(
+ static_cast<int32_t>(standard) | static_cast<int32_t>(transfer) |
+ static_cast<int32_t>(range));
+ ALOGD("Invoking test for dataspace: {%s, %s, %s}", toString(standard).c_str(),
+ toString(transfer).c_str(), toString(range).c_str());
+ }
}
- void makeLayer() {
- mLayer = std::make_shared<TestBufferLayer>(
- mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), common::PixelFormat::RGBA_8888, *mWriter);
- mLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
- mLayer->setZOrder(10);
- mLayer->setAlpha(1.f);
- mLayer->setDataspace(mLayerDataspace);
+ void makeLayer(const DisplayWrapper& display) {
+ auto& layer = mDisplayGfx[display.getDisplayId()].layer;
+ layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mDisplayProperties.at(display.getDisplayId()).testRenderEngine,
+ display.getDisplayId(), display.getDisplayWidth(), display.getDisplayHeight(),
+ common::PixelFormat::RGBA_8888,
+ mDisplayProperties.at(display.getDisplayId()).writer);
+ layer->setDisplayFrame({0, 0, display.getDisplayWidth(), display.getDisplayHeight()});
+ layer->setZOrder(10);
+ layer->setAlpha(1.f);
+ layer->setDataspace(mDisplayGfx[display.getDisplayId()].layerDataspace);
}
- void fillColor(Color color) {
- std::vector<Color> baseColors(static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(baseColors, getDisplayWidth(),
+ void fillColor(const DisplayWrapper& display, Color color) {
+ std::vector<Color> baseColors(
+ static_cast<size_t>(display.getDisplayWidth() * display.getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(baseColors, display.getDisplayWidth(),
common::Rect{.left = 0,
.top = 0,
- .right = getDisplayWidth(),
- .bottom = getDisplayHeight()},
+ .right = display.getDisplayWidth(),
+ .bottom = display.getDisplayHeight()},
color);
- ASSERT_NO_FATAL_FAILURE(mLayer->setBuffer(baseColors));
+ ASSERT_NO_FATAL_FAILURE(mDisplayGfx[display.getDisplayId()].layer->setBuffer(baseColors));
}
- Dataspace mLayerDataspace;
- std::shared_ptr<TestBufferLayer> mLayer;
+ struct DisplayGraphics {
+ Dataspace layerDataspace;
+ std::shared_ptr<TestBufferLayer> layer;
+ };
+ std::unordered_map<int64_t, struct DisplayGraphics> mDisplayGfx;
};
// @VsrTest = 4.4-015
TEST_P(GraphicsColorManagementCompositionTest, ColorConversion) {
- for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient
- ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
- .isOk());
+ for (const DisplayWrapper* display : mDisplaysWithReadbackBuffers) {
+ for (ColorMode mode : mDisplayProperties.at(display->getDisplayId()).testColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display->getDisplayId(), mode,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- bool isSupported;
- ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
- if (!isSupported) {
- GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
- return;
- }
+ auto& clientCompositionDisplaySettings =
+ mDisplayProperties.at(display->getDisplayId()).clientCompositionDisplaySettings;
+ clientCompositionDisplaySettings.outputDataspace =
+ static_cast<::android::ui::Dataspace>(
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ mDisplayProperties.at(display->getDisplayId())
+ .testRenderEngine->setDisplaySettings(clientCompositionDisplaySettings);
- mClientCompositionDisplaySettings.outputDataspace =
- static_cast<::android::ui::Dataspace>(mDataspace);
- mTestRenderEngine->setDisplaySettings(mClientCompositionDisplaySettings);
+ makeLayer(*display);
+ for (auto color : {LIGHT_RED, LIGHT_GREEN, LIGHT_BLUE}) {
+ ALOGD("Testing color: %f, %f, %f, %f with color mode: %d", color.r, color.g,
+ color.b, color.a, mode);
+ ReadbackBuffer readbackBuffer(
+ display->getDisplayId(), mComposerClient, display->getDisplayWidth(),
+ display->getDisplayHeight(),
+ mDisplayProperties.at(display->getDisplayId()).pixelFormat,
+ mDisplayProperties.at(display->getDisplayId()).dataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+ fillColor(*display, color);
+ auto& layer = mDisplayGfx[display->getDisplayId()].layer;
+ writeLayers({layer}, display->getDisplayId());
+ EXPECT_TRUE(mComposerClient->setPowerMode(display->getDisplayId(), PowerMode::ON)
+ .isOk());
- makeLayer();
- for (auto color : {LIGHT_RED, LIGHT_GREEN, LIGHT_BLUE}) {
- ALOGD("Testing color: %f, %f, %f, %f with color mode: %d", color.r, color.g, color.b,
- color.a, mode);
- ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
- getDisplayHeight(), mPixelFormat, mDataspace);
- ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- fillColor(color);
- writeLayers({mLayer});
- EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
+ ASSERT_TRUE(
+ mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.validateDisplay(display->getDisplayId(),
+ ComposerClientWriter::kNoTimestamp,
+ ComposerClientWrapper::kNoFrameIntervalNs);
+ execute(display->getDisplayId());
+ if (!mDisplayProperties.at(display->getDisplayId())
+ .reader.takeChangedCompositionTypes(display->getDisplayId())
+ .empty()) {
+ continue;
+ }
+ ASSERT_TRUE(
+ mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
+ mDisplayProperties.at(display->getDisplayId())
+ .writer.presentDisplay(display->getDisplayId());
+ execute(display->getDisplayId());
+ ASSERT_TRUE(
+ mDisplayProperties.at(display->getDisplayId()).reader.takeErrors().empty());
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
- ComposerClientWrapper::kNoFrameIntervalNs);
- execute();
- if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
- continue;
+ auto& testRenderEngine =
+ mDisplayProperties.at(display->getDisplayId()).testRenderEngine;
+ testRenderEngine->setRenderLayers({layer});
+ ASSERT_NO_FATAL_FAILURE(testRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(
+ testRenderEngine->checkColorBuffer(readbackBuffer.getBuffer()));
}
- ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay(getPrimaryDisplayId());
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- mTestRenderEngine->setRenderLayers({mLayer});
- ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
- ASSERT_NO_FATAL_FAILURE(
- mTestRenderEngine->checkColorBuffer(readbackBuffer.getBuffer()));
}
}
}
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 88e5cb5..6c58b4c 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -75,7 +75,8 @@
}
void TearDown() override {
- ASSERT_TRUE(mComposerClient->tearDown(nullptr));
+ ASSERT_TRUE(
+ mComposerClient->tearDown(std::unordered_map<int64_t, ComposerClientWriter*>{}));
mComposerClient.reset();
}
@@ -1481,21 +1482,24 @@
protected:
void TearDown() override {
ASSERT_FALSE(mDisplays.empty());
- ASSERT_TRUE(mReader.takeErrors().empty());
+ std::unordered_map<int64_t, ComposerClientWriter*> displayWriters;
for (const auto& display : mDisplays) {
- ASSERT_TRUE(mReader.takeChangedCompositionTypes(display.getDisplayId()).empty());
- ASSERT_TRUE(mComposerClient->tearDown(&getWriter(display.getDisplayId())));
+ auto& reader = getReader(display.getDisplayId());
+ ASSERT_TRUE(reader.takeErrors().empty());
+ ASSERT_TRUE(reader.takeChangedCompositionTypes(display.getDisplayId()).empty());
+ displayWriters.emplace(display.getDisplayId(), &getWriter(display.getDisplayId()));
}
+ ASSERT_TRUE(mComposerClient->tearDown(displayWriters));
ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown());
}
void execute() {
- std::vector<CommandResultPayload> payloads;
- for (auto& [_, writer] : mWriters) {
+ for (auto& [displayId, writer] : mWriters) {
+ std::vector<CommandResultPayload> payloads;
executeInternal(writer, payloads);
+ getReader(displayId).parse(std::move(payloads));
}
- mReader.parse(std::move(payloads));
}
void execute(ComposerClientWriter& writer, ComposerClientReader& reader) {
@@ -1545,21 +1549,18 @@
});
}
- sp<GraphicBuffer> allocate(uint32_t width, uint32_t height,
+ sp<GraphicBuffer> allocate(int32_t displayWidth, int32_t displayHeight,
::android::PixelFormat pixelFormat) {
return sp<GraphicBuffer>::make(
- width, height, pixelFormat, /*layerCount*/ 1U,
+ static_cast<uint32_t>(displayWidth), static_cast<uint32_t>(displayHeight),
+ pixelFormat,
+ /*layerCount*/ 1U,
static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
static_cast<uint64_t>(common::BufferUsage::COMPOSER_OVERLAY),
"VtsHalGraphicsComposer3_TargetTest");
}
- sp<GraphicBuffer> allocate(::android::PixelFormat pixelFormat, const DisplayWrapper& display) {
- return allocate(static_cast<uint32_t>(display.getDisplayWidth()),
- static_cast<uint32_t>(display.getDisplayHeight()), pixelFormat);
- }
-
void sendRefreshFrame(const DisplayWrapper& display,
const VsyncPeriodChangeTimeline* timeline) {
if (timeline != nullptr) {
@@ -1580,7 +1581,8 @@
mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(status.isOk());
{
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer);
ASSERT_EQ(::android::OK, buffer->initCheck());
ASSERT_NE(nullptr, buffer->handle);
@@ -1594,15 +1596,16 @@
writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
ComposerClientWrapper::kNoFrameIntervalNs);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.presentDisplay(display.getDisplayId());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
{
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer->handle);
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle,
@@ -1612,7 +1615,7 @@
writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
ComposerClientWrapper::kNoFrameIntervalNs);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.presentDisplay(display.getDisplayId());
execute();
@@ -1627,13 +1630,13 @@
auto& writer = getWriter(displayId);
writer.validateDisplay(displayId, expectedPresentTime, frameIntervalNs);
execute();
- EXPECT_TRUE(mReader.takeErrors().empty());
+ EXPECT_TRUE(getReader(displayId).takeErrors().empty());
writer.presentDisplay(displayId);
execute();
- EXPECT_TRUE(mReader.takeErrors().empty());
+ EXPECT_TRUE(getReader(displayId).takeErrors().empty());
- auto presentFence = mReader.takePresentFence(displayId);
+ auto presentFence = getReader(displayId).takePresentFence(displayId);
// take ownership
const int fenceOwner = presentFence.get();
*presentFence.getR() = -1;
@@ -1665,8 +1668,10 @@
return layer;
}
- void sendBufferUpdate(int64_t layer, int64_t displayId) {
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ void sendBufferUpdate(int64_t layer, int64_t displayId, int32_t displayWidth,
+ int32_t displayHeight) {
+ const auto buffer =
+ allocate(displayWidth, displayHeight, ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer->handle);
auto& writer = getWriter(displayId);
@@ -1776,8 +1781,10 @@
const auto vsyncPeriod = getVsyncPeriod(display.getDisplayId());
- const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
- const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer1 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
+ const auto buffer2 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer1);
ASSERT_NE(nullptr, buffer2);
@@ -1874,12 +1881,16 @@
// clang-format on
ComposerClientWriter& getWriter(int64_t display) {
- std::lock_guard guard{mWritersMutex};
+ std::lock_guard guard{mReadersWritersMutex};
auto [it, _] = mWriters.try_emplace(display, display);
return it->second;
}
- ComposerClientReader mReader;
+ ComposerClientReader& getReader(int64_t display) {
+ std::lock_guard guard{mReadersWritersMutex};
+ auto [it, _] = mReaders.try_emplace(display, display);
+ return it->second;
+ }
private:
void executeInternal(ComposerClientWriter& writer,
@@ -1901,8 +1912,9 @@
// - modify the same writer from multiple threads
// - insert a new writer into the map during concurrent access, which would invalidate
// references from other threads
- std::mutex mWritersMutex;
- std::unordered_map<int64_t, ComposerClientWriter> mWriters GUARDED_BY(mWritersMutex);
+ std::mutex mReadersWritersMutex;
+ std::unordered_map<int64_t, ComposerClientWriter> mWriters GUARDED_BY(mReadersWritersMutex);
+ std::unordered_map<int64_t, ComposerClientReader> mReaders GUARDED_BY(mReadersWritersMutex);
};
TEST_P(GraphicsComposerAidlCommandTest, SetColorTransform) {
@@ -1922,9 +1934,10 @@
writer.setLayerColorTransform(display.getDisplayId(), layer, kIdentity.data());
execute();
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
if (errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_UNSUPPORTED) {
- GTEST_SUCCEED() << "setLayerColorTransform is not supported";
+ ALOGI("setLayerColorTransform is not supported on display %" PRId64,
+ display.getDisplayId());
continue;
}
}
@@ -1932,6 +1945,7 @@
TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) {
for (const auto& display : mDisplays) {
+ EXPECT_TRUE(mComposerClient->setPowerMode(display.getDisplayId(), PowerMode::ON).isOk());
const auto& [status, capabilities] =
mComposerClient->getDisplayCapabilities(display.getDisplayId());
ASSERT_TRUE(status.isOk());
@@ -1941,33 +1955,34 @@
if (!brightnessSupport) {
writer.setDisplayBrightness(display.getDisplayId(), /*brightness*/ 0.5f, -1.f);
execute();
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
ASSERT_EQ(1, errors.size());
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errors[0].errorCode);
- GTEST_SUCCEED() << "SetDisplayBrightness is not supported";
+ ALOGI("SetDisplayBrightness is not supported on display %" PRId64,
+ display.getDisplayId());
continue;
}
writer.setDisplayBrightness(display.getDisplayId(), /*brightness*/ 0.0f, -1.f);
execute();
- EXPECT_TRUE(mReader.takeErrors().empty());
+ EXPECT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setDisplayBrightness(display.getDisplayId(), /*brightness*/ 0.5f, -1.f);
execute();
- EXPECT_TRUE(mReader.takeErrors().empty());
+ EXPECT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setDisplayBrightness(display.getDisplayId(), /*brightness*/ 1.0f, -1.f);
execute();
- EXPECT_TRUE(mReader.takeErrors().empty());
+ EXPECT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setDisplayBrightness(display.getDisplayId(), /*brightness*/ -1.0f, -1.f);
execute();
- EXPECT_TRUE(mReader.takeErrors().empty());
+ EXPECT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setDisplayBrightness(display.getDisplayId(), /*brightness*/ 2.0f, -1.f);
execute();
{
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
ASSERT_EQ(1, errors.size());
EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode);
}
@@ -1975,7 +1990,7 @@
writer.setDisplayBrightness(display.getDisplayId(), /*brightness*/ 2.0f, -1.f);
execute();
{
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
ASSERT_EQ(1, errors.size());
EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode);
}
@@ -2011,7 +2026,8 @@
// Use dimensions from the primary display
const DisplayWrapper& primary = mDisplays[0];
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, primary);
+ const auto buffer = allocate(primary.getDisplayWidth(), primary.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
const auto handle = buffer->handle;
auto& writer = getWriter(display.display);
writer.setOutputBuffer(display.display, /*slot*/ 0, handle,
@@ -2068,7 +2084,8 @@
mComposerClient->setColorMode(display.getDisplayId(), ColorMode::NATIVE, intent)
.isOk());
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
@@ -2086,17 +2103,20 @@
writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
ComposerClientWrapper::kNoFrameIntervalNs);
execute();
- if (!mReader.takeChangedCompositionTypes(display.getDisplayId()).empty()) {
+ if (!getReader(display.getDisplayId())
+ .takeChangedCompositionTypes(display.getDisplayId())
+ .empty()) {
GTEST_SUCCEED() << "Composition change requested, skipping test";
return;
}
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.presentDisplay(display.getDisplayId());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
- const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer2 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
const auto handle2 = buffer2->handle;
ASSERT_NE(nullptr, handle2);
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, handle2,
@@ -2116,7 +2136,8 @@
mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
@@ -2132,11 +2153,13 @@
execute();
- if (!mReader.takeChangedCompositionTypes(display.getDisplayId()).empty()) {
+ if (!getReader(display.getDisplayId())
+ .takeChangedCompositionTypes(display.getDisplayId())
+ .empty()) {
continue; // Skip this display if composition change requested
}
writer.presentDisplay(display.getDisplayId());
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerCursorPosition(display.getDisplayId(), layer, /*x*/ 1, /*y*/ 1);
execute();
@@ -2150,7 +2173,8 @@
TEST_P(GraphicsComposerAidlCommandTest, SetLayerBuffer) {
for (const auto& display : mDisplays) {
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
@@ -2177,29 +2201,32 @@
// This is used on HALs that don't support setLayerBufferSlotsToClear (version <= 3.1).
- const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer1 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer1);
const auto handle1 = buffer1->handle;
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, handle1,
/*acquireFence*/ -1);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
- const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer2 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer2);
const auto handle2 = buffer2->handle;
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 1, handle2,
/*acquireFence*/ -1);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
- const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer3 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer3);
const auto handle3 = buffer3->handle;
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 2, handle3,
/*acquireFence*/ -1);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
// Older versions of the HAL clear all but the active buffer slot with a placeholder buffer,
// and then restoring the current active buffer at the end
@@ -2216,7 +2243,7 @@
writer.setLayerBufferWithNewCommand(display.getDisplayId(), layer, /*slot*/ 2, nullptr,
/*acquireFence*/ -1);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2232,15 +2259,15 @@
writer.setLayerSurfaceDamage(display.getDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerSurfaceDamage(display.getDisplayId(), layer, std::vector<Rect>(1, unit));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerSurfaceDamage(display.getDisplayId(), layer, std::vector<Rect>());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2256,15 +2283,15 @@
writer.setLayerBlockingRegion(display.getDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerBlockingRegion(display.getDisplayId(), layer, std::vector<Rect>(1, unit));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerBlockingRegion(display.getDisplayId(), layer, std::vector<Rect>());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2277,15 +2304,15 @@
writer.setLayerBlendMode(display.getDisplayId(), layer, BlendMode::NONE);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerBlendMode(display.getDisplayId(), layer, BlendMode::PREMULTIPLIED);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerBlendMode(display.getDisplayId(), layer, BlendMode::COVERAGE);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2298,11 +2325,11 @@
writer.setLayerColor(display.getDisplayId(), layer, Color{1.0f, 1.0f, 1.0f, 1.0f});
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerColor(display.getDisplayId(), layer, Color{0.0f, 0.0f, 0.0f, 0.0f});
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2315,15 +2342,15 @@
writer.setLayerCompositionType(display.getDisplayId(), layer, Composition::CLIENT);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerCompositionType(display.getDisplayId(), layer, Composition::DEVICE);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerCompositionType(display.getDisplayId(), layer, Composition::SOLID_COLOR);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerCompositionType(display.getDisplayId(), layer, Composition::CURSOR);
execute();
@@ -2342,7 +2369,8 @@
const auto format = (error.isOk() && support) ? support->format
: aidl::android::hardware::graphics::common::PixelFormat::RGBA_8888;
- const auto decorBuffer = allocate(static_cast<::android::PixelFormat>(format), display);
+ const auto decorBuffer = allocate(display.getDisplayHeight(), display.getDisplayWidth(),
+ static_cast<::android::PixelFormat>(format));
ASSERT_NE(nullptr, decorBuffer);
if (::android::OK != decorBuffer->initCheck()) {
if (support) {
@@ -2364,9 +2392,9 @@
ComposerClientWrapper::kNoFrameIntervalNs);
execute();
if (support) {
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
} else {
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
ASSERT_EQ(1, errors.size());
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errors[0].errorCode);
}
@@ -2405,11 +2433,11 @@
writer.setLayerPlaneAlpha(display.getDisplayId(), layer, /*alpha*/ 0.0f);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerPlaneAlpha(display.getDisplayId(), layer, /*alpha*/ 1.0f);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2420,7 +2448,8 @@
}
for (const auto& display : mDisplays) {
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
@@ -2455,39 +2484,39 @@
writer.setLayerTransform(display.getDisplayId(), layer, static_cast<Transform>(0));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerTransform(display.getDisplayId(), layer, Transform::FLIP_H);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerTransform(display.getDisplayId(), layer, Transform::FLIP_V);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerTransform(display.getDisplayId(), layer, Transform::ROT_90);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerTransform(display.getDisplayId(), layer, Transform::ROT_180);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerTransform(display.getDisplayId(), layer, Transform::ROT_270);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerTransform(display.getDisplayId(), layer,
static_cast<Transform>(static_cast<int>(Transform::FLIP_H) |
static_cast<int>(Transform::ROT_90)));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerTransform(display.getDisplayId(), layer,
static_cast<Transform>(static_cast<int>(Transform::FLIP_V) |
static_cast<int>(Transform::ROT_90)));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2503,15 +2532,15 @@
writer.setLayerVisibleRegion(display.getDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerVisibleRegion(display.getDisplayId(), layer, std::vector<Rect>(1, unit));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerVisibleRegion(display.getDisplayId(), layer, std::vector<Rect>());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2525,11 +2554,11 @@
writer.setLayerZOrder(display.getDisplayId(), layer, /*z*/ 10);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerZOrder(display.getDisplayId(), layer, /*z*/ 0);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2568,7 +2597,7 @@
writer.setLayerPerFrameMetadata(display.getDisplayId(), layer, aidlMetadata);
execute();
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
if (errors.size() == 1 && errors[0].errorCode == EX_UNSUPPORTED_OPERATION) {
GTEST_SUCCEED() << "SetLayerPerFrameMetadata is not supported";
EXPECT_TRUE(
@@ -2589,20 +2618,20 @@
writer.setLayerBrightness(display.getDisplayId(), layer, 0.2f);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerBrightness(display.getDisplayId(), layer, 1.f);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerBrightness(display.getDisplayId(), layer, 0.f);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
writer.setLayerBrightness(display.getDisplayId(), layer, -1.f);
execute();
{
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
ASSERT_EQ(1, errors.size());
EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode);
}
@@ -2610,7 +2639,7 @@
writer.setLayerBrightness(display.getDisplayId(), layer, std::nanf(""));
execute();
{
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
ASSERT_EQ(1, errors.size());
EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode);
}
@@ -2777,7 +2806,8 @@
EXPECT_TRUE(
mComposerClient->setIdleTimerEnabled(display.getDisplayId(), /*timeout*/ 0).isOk());
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, display);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer->handle);
const auto layer = createOnScreenLayer(display);
@@ -2837,36 +2867,39 @@
// setup 3 buffers in the buffer cache, with the last buffer being active
// then emulate the Android platform code that clears all 3 buffer slots
- const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display.getDisplayId());
+ const auto buffer1 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer1);
const auto handle1 = buffer1->handle;
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, handle1,
/*acquireFence*/ -1);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
- const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display.getDisplayId());
+ const auto buffer2 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer2);
const auto handle2 = buffer2->handle;
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 1, handle2,
/*acquireFence*/ -1);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
- const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888, display.getDisplayId());
+ const auto buffer3 = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer3);
const auto handle3 = buffer3->handle;
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 2, handle3,
/*acquireFence*/ -1);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
// Ensure we can clear all 3 buffer slots, even the active buffer - it is assumed the
// current active buffer's slot will be cleared, but still remain the active buffer and no
// errors will occur.
writer.setLayerBufferSlotsToClear(display.getDisplayId(), layer, {0, 1, 2});
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -2976,8 +3009,9 @@
}
// Send the REFRESH_RATE_INDICATOR update
- ASSERT_NO_FATAL_FAILURE(sendBufferUpdate(
- createOnScreenLayer(display, Composition::REFRESH_RATE_INDICATOR), displayId));
+ ASSERT_NO_FATAL_FAILURE(
+ sendBufferUpdate(createOnScreenLayer(display, Composition::REFRESH_RATE_INDICATOR),
+ displayId, display.getDisplayWidth(), display.getDisplayHeight()));
std::this_thread::sleep_for(1s);
EXPECT_FALSE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter))
<< "A callback should not be received for REFRESH_RATE_INDICATOR";
@@ -3100,7 +3134,8 @@
const auto& [status, layer] =
mComposerClient->createLayer(displayId, kBufferSlotCount, &writer);
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ const auto buffer = allocate(display->getDisplayWidth(), display->getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer);
ASSERT_EQ(::android::OK, buffer->initCheck());
ASSERT_NE(nullptr, buffer->handle);
@@ -3181,7 +3216,7 @@
mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(status.isOk());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -3190,14 +3225,16 @@
GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
return;
}
- auto& writer = getWriter(getInvalidDisplayId());
+
+ int64_t invalidDisplayId = getInvalidDisplayId();
+ auto& writer = getWriter(invalidDisplayId);
int64_t layer = 5;
- writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
+ writer.setLayerLifecycleBatchCommandType(invalidDisplayId, layer,
LayerLifecycleBatchCommandType::CREATE);
- writer.setNewBufferSlotCount(getInvalidDisplayId(), layer, 1);
+ writer.setNewBufferSlotCount(invalidDisplayId, layer, 1);
execute();
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(invalidDisplayId).takeErrors();
ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
}
@@ -3213,10 +3250,10 @@
mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(status.isOk());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
EXPECT_TRUE(mComposerClient->destroyLayer(display.getDisplayId(), layer, &writer).isOk());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -3233,13 +3270,13 @@
EXPECT_TRUE(status.isOk());
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
auto& invalid_writer = getWriter(getInvalidDisplayId());
invalid_writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
LayerLifecycleBatchCommandType::DESTROY);
execute();
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(getInvalidDisplayId()).takeErrors();
ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
}
}
@@ -3256,7 +3293,7 @@
writer.setLayerLifecycleBatchCommandType(display.getDisplayId(), layer,
LayerLifecycleBatchCommandType::DESTROY);
execute();
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_LAYER);
}
}
@@ -3272,7 +3309,8 @@
auto minFrameIntervalNs = config.vrrConfig->minFrameIntervalNs;
const auto timeoutNs = config.vrrConfig->notifyExpectedPresentConfig->timeoutNs;
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer);
const auto layer = createOnScreenLayer(display);
auto& writer = getWriter(displayId);
@@ -3309,7 +3347,8 @@
forEachNotifyExpectedPresentConfig([&](DisplayWrapper& display,
const DisplayConfiguration& config) {
const auto displayId = display.getDisplayId();
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer);
const auto layer = createOnScreenLayer(display);
auto& writer = getWriter(displayId);
@@ -3356,7 +3395,8 @@
forEachNotifyExpectedPresentConfig([&](DisplayWrapper& display,
const DisplayConfiguration& config) {
const auto displayId = display.getDisplayId();
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer);
const auto layer = createOnScreenLayer(display);
auto& writer = getWriter(displayId);
@@ -3442,14 +3482,15 @@
auto& writer = getWriter(displayId);
const auto layer = createOnScreenLayer(display);
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer->handle);
// TODO(b/337330263): Lookup profile IDs from MediaQualityManager
writer.setDisplayPictureProfileId(displayId, PictureProfileId(1));
writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle,
/*acquireFence*/ -1);
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -3467,14 +3508,15 @@
auto& writer = getWriter(displayId);
const auto layer = createOnScreenLayer(display);
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer->handle);
writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle,
/*acquireFence*/ -1);
// TODO(b/337330263): Lookup profile IDs from MediaQualityManager
writer.setLayerPictureProfileId(displayId, layer, PictureProfileId(1));
execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(getReader(display.getDisplayId()).takeErrors().empty());
}
}
@@ -3493,7 +3535,8 @@
auto& writer = getWriter(displayId);
for (int profileId = 1; profileId <= maxProfiles + 1; ++profileId) {
const auto layer = createOnScreenLayer(display);
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer->handle);
writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle,
/*acquireFence*/ -1);
@@ -3501,7 +3544,7 @@
writer.setLayerPictureProfileId(displayId, layer, PictureProfileId(profileId));
}
execute();
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
ASSERT_TRUE(errors.size() == 1 &&
errors[0].errorCode == IComposerClient::EX_PICTURE_PROFILE_MAX_EXCEEDED);
}
@@ -3513,7 +3556,8 @@
int64_t displayId = display.getDisplayId();
auto& writer = getWriter(displayId);
const auto layer = createOnScreenLayer(display);
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, displayId);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer->handle);
writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle,
/*acquireFence*/ -1);
@@ -3556,8 +3600,9 @@
{LutProperties::Dimension::ONE_D, size, {LutProperties::SamplingKey::RGB}}};
luts.pfd = ndk::ScopedFileDescriptor(fd);
- const auto layer = createOnScreenLayer(display.getDisplayId());
- const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888, display.getDisplayId());
+ const auto layer = createOnScreenLayer(display);
+ const auto buffer = allocate(display.getDisplayWidth(), display.getDisplayHeight(),
+ ::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer->handle);
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle,
/*acquireFence*/ -1);
@@ -3565,13 +3610,15 @@
writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
ComposerClientWrapper::kNoFrameIntervalNs);
execute();
- const auto errors = mReader.takeErrors();
+ const auto errors = getReader(display.getDisplayId()).takeErrors();
if (errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_UNSUPPORTED) {
GTEST_SUCCEED() << "setLayerLuts is not supported";
return;
}
// change to client composition
- ASSERT_FALSE(mReader.takeChangedCompositionTypes(display.getDisplayId()).empty());
+ ASSERT_FALSE(getReader(display.getDisplayId())
+ .takeChangedCompositionTypes(display.getDisplayId())
+ .empty());
}
}
}
diff --git a/nfc/OWNERS b/nfc/OWNERS
index f46dccd..47f209f 100644
--- a/nfc/OWNERS
+++ b/nfc/OWNERS
@@ -1,2 +1,2 @@
# Bug component: 48448
-include platform/packages/apps/Nfc:/OWNERS
\ No newline at end of file
+include platform/packages/modules/Nfc:/OWNERS
\ No newline at end of file
diff --git a/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp b/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
index 6db7e14..9c44c3a 100644
--- a/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
+++ b/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
@@ -349,44 +349,18 @@
}
/*
- * SetPassiveObserverTech_individualTechnologies:
- * Verifies per-technology observe mode is supported as a capability. Then sets observe mode
- * for each individual technology and verifies the command succeeds.
- *
- * @VsrTest = GMS-VSR-3.2.8-002
+ * SetPassiveObserverTech_getCaps:
+ * Verifies GET_CAPS returns get correct value for observe mode capabilities.
*/
-TEST_P(NfcBehaviorChanges, SetPassiveObserverTech_individualTechnologies) {
+TEST_P(NfcBehaviorChanges, SetPassiveObserverTech_getCaps) {
if (get_vsr_api_level() < 202504) {
GTEST_SKIP() << "Skipping test for board API level < 202504";
}
tNFC_STATUS status = nfaGetCaps();
+
ASSERT_EQ(status, NFC_STATUS_OK);
ASSERT_EQ(getCapsPassiveObserverModeValue(), 0x2);
-
- status = nfaSetPassiveObserverTech(NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE_A);
- ASSERT_EQ(status, NFA_STATUS_OK);
- status = nfaQueryObserveModeState();
- ASSERT_EQ(status, NFA_STATUS_OK);
- ASSERT_EQ(sObserveModeState, NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE_A);
-
- status = nfaSetPassiveObserverTech(NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE_B);
- ASSERT_EQ(status, NFA_STATUS_OK);
- status = nfaQueryObserveModeState();
- ASSERT_EQ(status, NFA_STATUS_OK);
- ASSERT_EQ(sObserveModeState, NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE_B);
-
- status = nfaSetPassiveObserverTech(NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE_V);
- ASSERT_EQ(status, NFA_STATUS_OK);
- status = nfaQueryObserveModeState();
- ASSERT_EQ(status, NFA_STATUS_OK);
- ASSERT_EQ(sObserveModeState, NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE_V);
-
- status = nfaSetPassiveObserverTech(NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE_F);
- ASSERT_EQ(status, NFA_STATUS_OK);
- status = nfaQueryObserveModeState();
- ASSERT_EQ(status, NFA_STATUS_OK);
- ASSERT_EQ(sObserveModeState, NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE_F);
}
/*
diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp
index 87797ae..93b7c38 100644
--- a/power/aidl/vts/VtsHalPowerTargetTest.cpp
+++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp
@@ -317,6 +317,9 @@
}
ASSERT_TRUE(ret.isOk());
ASSERT_GE(mSupportInfo->headroom.cpuMinIntervalMillis, 0);
+ ASSERT_LE(mSupportInfo->headroom.cpuMinCalculationWindowMillis, 50);
+ ASSERT_GE(mSupportInfo->headroom.cpuMaxCalculationWindowMillis, 10000);
+ ASSERT_GE(mSupportInfo->headroom.cpuMaxTidCount, 5);
ASSERT_EQ(headroom.getTag(), CpuHeadroomResult::globalHeadroom);
ASSERT_GE(headroom.get<CpuHeadroomResult::globalHeadroom>(), 0.0f);
ASSERT_LE(headroom.get<CpuHeadroomResult::globalHeadroom>(), 100.00f);
@@ -335,6 +338,8 @@
}
ASSERT_TRUE(ret.isOk());
ASSERT_GE(mSupportInfo->headroom.gpuMinIntervalMillis, 0);
+ ASSERT_LE(mSupportInfo->headroom.gpuMinCalculationWindowMillis, 50);
+ ASSERT_GE(mSupportInfo->headroom.gpuMaxCalculationWindowMillis, 10000);
ASSERT_EQ(headroom.getTag(), GpuHeadroomResult::globalHeadroom);
ASSERT_GE(headroom.get<GpuHeadroomResult::globalHeadroom>(), 0.0f);
ASSERT_LE(headroom.get<GpuHeadroomResult::globalHeadroom>(), 100.00f);
diff --git a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
index 9588ed9..7cde897 100644
--- a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
+++ b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
@@ -52,7 +52,7 @@
/** @deprecated use LTE instead. */
LTE_CA = 1 << RadioTechnology.LTE_CA,
/**
- * 5G NR. This is only use in 5G Standalone mode.
+ * 5G NR. This is only used in 5G Standalone mode.
*/
NR = 1 << RadioTechnology.NR,
}
diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl
index 6a28893..aa53df3 100644
--- a/radio/aidl/android/hardware/radio/RadioError.aidl
+++ b/radio/aidl/android/hardware/radio/RadioError.aidl
@@ -73,7 +73,7 @@
*/
MODE_NOT_SUPPORTED = 13,
/**
- * Command failed becausee recipient is not on FDN list
+ * Command failed because recipient is not on FDN list
*/
FDN_CHECK_FAILURE = 14,
/**
@@ -133,7 +133,7 @@
*/
LCE_NOT_SUPPORTED = 36,
/**
- * Not sufficieent memory to process the request
+ * Not sufficient memory to process the request
*/
NO_MEMORY = 37,
/**
@@ -218,7 +218,7 @@
*/
ENCODING_ERR = 57,
/**
- * SMSC addrss specified is invalid
+ * SMSC address specified is invalid
*/
INVALID_SMSC_ADDRESS = 58,
/**
@@ -279,7 +279,7 @@
OEM_ERROR_24 = 524,
OEM_ERROR_25 = 525,
/**
- * 1X voice and SMS are not allowed simulteneously.
+ * 1X voice and SMS are not allowed simultaneously.
*/
SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED = 67,
/**
@@ -293,8 +293,8 @@
BLOCKED_DUE_TO_CALL = 69,
/**
* Returned from setRadioPowerResponse when detecting RF HW issues. Some RF Front-End (RFFE)
- * components like antenna are considered critical for modem to provide telephony service.
- * This RadioError is used when modem detect such RFFE problem.
+ * components like antennas are considered critical for modem to provide telephony service.
+ * This RadioError is used when modem detects such RFFE problems.
*/
RF_HARDWARE_ISSUE = 70,
/**
diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
index 592fde6..733eae8 100644
--- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
@@ -143,7 +143,7 @@
*/
DATA_REGISTRATION_FAIL = -2,
/**
- * Network/modem disonnect
+ * Network/modem disconnect
*/
SIGNAL_LOST = -3,
/**
@@ -172,7 +172,7 @@
ACTIVATION_REJECTED_BCM_VIOLATION = 0x30,
/**
* Network has already initiated the activation, modification, or deactivation of bearer
- * resources that was requested by the UE.
+ * resources that were requested by the UE.
*/
COLLISION_WITH_NETWORK_INITIATED_REQUEST = 0x38,
/**
@@ -182,7 +182,7 @@
*/
ONLY_IPV4V6_ALLOWED = 0x39,
/**
- * Network supports non-IP PDP type only. IPv4, IPv6 and IPv4v6 is not allowed. In LTE mode of
+ * Network supports non-IP PDP type only. IPv4, IPv6 and IPv4v6 are not allowed. In LTE mode of
* operation, this is a PDN throttling cause code, meaning the UE can throttle further requests
* to the same APN.
*/
diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
index f067fb4..501cbce 100644
--- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
@@ -40,7 +40,7 @@
const int TYPE_3GPP2 = 2;
/**
- * Innfrastructure type unknown. This is only for initializing.
+ * Infrastructure type unknown. This is only for initializing.
*/
const int INFRASTRUCTURE_UNKNOWN = 0;
diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
index 538b90a..7624606 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
@@ -29,7 +29,7 @@
oneway interface IRadioDataResponse {
/**
* Acknowledge the receipt of radio request sent to the vendor. This must be sent only for
- * radio request which take long time to respond. For more details, refer
+ * radio requests which take a long time to respond. For more details, refer
* https://source.android.com/devices/tech/connect/ril.html
*
* @param serial Serial no. of the request whose acknowledgement is sent.
@@ -199,7 +199,7 @@
* RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL
* RadioError:INVALID_ARGUMENTS
* RadioError:INTERNAL_ERR
- * RadioError:NO_RESOURCES if the vendor is unable handle due to resources are full.
+ * RadioError:NO_RESOURCES if the vendor is unable to handle due to resources being full.
* RadioError:SIM_ABSENT
*/
void setupDataCallResponse(in RadioResponseInfo info, in SetupDataCallResult dcResponse);
diff --git a/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl
index 90c4454..115e47e 100644
--- a/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl
+++ b/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl
@@ -58,7 +58,7 @@
int maxKeepaliveIntervalMillis;
/**
* Context ID, returned in setupDataCallResponse that uniquely identifies the data call to which
- * this keepalive must applied.
+ * this keepalive must be applied.
*/
int cid;
}
diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
index 498f228..fc9a4e1 100644
--- a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
+++ b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
@@ -30,7 +30,7 @@
oneway interface IRadioModemResponse {
/**
* Acknowledge the receipt of radio request sent to the vendor. This must be sent only for
- * radio request which take long time to respond. For more details, refer
+ * radio requests which take a long time to respond. For more details, refer
* https://source.android.com/devices/tech/connect/ril.html
*
* @param serial Serial no. of the request whose acknowledgement is sent.
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
index dce9865..13d9a9a 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
@@ -495,7 +495,7 @@
* Requests that network personalization be deactivated
*
* @param serial Serial number of request.
- * @param netPin Network depersonlization code
+ * @param netPin Network depersonalization code
*
* Response function is IRadioNetworkResponse.supplyNetworkDepersonalizationResponse()
*
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
index 295061b..d7d351c 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
@@ -137,7 +137,7 @@
* the framework
* @param ageMs time in milliseconds indicating how long NITZ was cached in RIL and modem.
* This must track true age and therefore must be calculated using clocks that
- * include the time spend in sleep / low power states. If it can not be guaranteed,
+ * include the time spent in sleep / low power states. If it can not be guaranteed,
* there must not be any caching done at the modem and should fill in 0 for ageMs
*/
void nitzTimeReceived(
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
index fd332fc..9a89181 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -39,7 +39,7 @@
oneway interface IRadioNetworkResponse {
/**
* Acknowledge the receipt of radio request sent to the vendor. This must be sent only for
- * radio request which take long time to respond. For more details, refer
+ * radio requests which take a long time to respond. For more details, refer
* https://source.android.com/devices/tech/connect/ril.html
*
* @param serial Serial no. of the request whose acknowledgement is sent.
diff --git a/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl
index 0aea27c..795237b 100644
--- a/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl
+++ b/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl
@@ -25,7 +25,7 @@
* capacity of both primary and secondary. This bandwidth estimate shall be the estimated
* maximum sustainable link bandwidth (as would be measured at the Upper PDCP or SNDCP SAP).
* If the DL Aggregate Maximum Bit Rate is known, this value shall not exceed the DL-AMBR for
- * the Internet PDN connection. This must be filled with 0 if network is not connected.
+ * the Internet PDN connection. This must be filled with 0 if the network is not connected.
*/
int downlinkCapacityKbps;
/**
@@ -33,14 +33,14 @@
* capacity of both primary and secondary. This bandwidth estimate shall be the estimated
* maximum sustainable link bandwidth (as would be measured at the Upper PDCP or SNDCP SAP).
* If the UL Aggregate Maximum Bit Rate is known, this value shall not exceed the UL-AMBR for
- * the Internet PDN connection. This must be filled with 0 if network is not connected.
+ * the Internet PDN connection. This must be filled with 0 if the network is not connected.
*/
int uplinkCapacityKbps;
/**
* Estimated downlink capacity of secondary carrier in a dual connected NR mode in kbps. This
* bandwidth estimate shall be the estimated maximum sustainable link bandwidth (as would be
* measured at the Upper PDCP or SNDCP SAP). This is valid only in if device is connected to
- * both primary and secodary in dual connected mode. This must be filled with 0 if secondary is
+ * both primary and secondary in dual connected mode. This must be filled with 0 if secondary is
* not connected or if modem does not support this feature.
*/
int secondaryDownlinkCapacityKbps;
@@ -48,7 +48,7 @@
* Estimated uplink capacity secondary carrier in a dual connected NR mode in kbps. This
* bandwidth estimate shall be the estimated maximum sustainable link bandwidth (as would be
* measured at the Upper PDCP or SNDCP SAP). This is valid only in if device is connected to
- * both primary and secodary in dual connected mode.This must be filled with 0 if secondary is
+ * both primary and secondary in dual connected mode.This must be filled with 0 if secondary is
* not connected or if modem does not support this feature.
*/
int secondaryUplinkCapacityKbps;
diff --git a/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl
index a320acb..c2aa3b5 100644
--- a/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl
@@ -25,19 +25,19 @@
@JavaDerive(toString=true)
parcelable LteVopsInfo {
/**
- * This indicates if camped network support VoLTE services. This information is received from
+ * This indicates if the camped network supports VoLTE services. This information is received from
* LTE network during LTE NAS registration procedure through LTE ATTACH ACCEPT/TAU ACCEPT.
* Refer 3GPP 24.301 EPS network feature support -> IMS VoPS
*/
boolean isVopsSupported;
/**
- * This indicates if camped network support VoLTE emergency bearers. This information is
+ * This indicates if the camped network supports VoLTE emergency bearers. This information is
* received from LTE network through two sources:
* a. During LTE NAS registration procedure through LTE ATTACH ACCEPT/TAU ACCEPT. Refer
* 3GPP 24.301 EPS network feature support -> EMC BS
- * b. In case device is not registered on network. Refer 3GPP 25.331 LTE RRC
+ * b. In case the device is not registered on network. Refer 3GPP 25.331 LTE RRC
* SIB1 : ims-EmergencySupport-r9
- * If device is registered on LTE, then this field indicates (a).
+ * If the device is registered on LTE, then this field indicates (a).
* In case of limited service on LTE this field indicates (b).
*/
boolean isEmcBearerSupported;
diff --git a/radio/aidl/android/hardware/radio/network/RegState.aidl b/radio/aidl/android/hardware/radio/network/RegState.aidl
index 15e7160..1cfa2c1 100644
--- a/radio/aidl/android/hardware/radio/network/RegState.aidl
+++ b/radio/aidl/android/hardware/radio/network/RegState.aidl
@@ -56,7 +56,7 @@
*/
NOT_REG_MT_NOT_SEARCHING_OP_EM = 10,
/**
- * Same as NOT_REG_MT_SEARCHING_OP but indicatees that emergency calls are enabled
+ * Same as NOT_REG_MT_SEARCHING_OP but indicates that emergency calls are enabled
*/
NOT_REG_MT_SEARCHING_OP_EM = 12,
/**
diff --git a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
index 7321b36..0deb70d 100644
--- a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
@@ -26,7 +26,7 @@
@JavaDerive(toString=true)
parcelable CardStatus {
/*
- * Card is physically absent from device. (Some old modems use STATE_ABSENT when the SIM
+ * Card is physically absent from the device. (Some old modems use STATE_ABSENT when the SIM
* is powered off. This is no longer correct, however the platform will still support this
* legacy behavior.)
*/
@@ -75,7 +75,7 @@
*/
String atr;
/**
- * Integrated Circuit Card IDentifier (ICCID) is Unique Identifier of the SIM CARD. File is
+ * Integrated Circuit Card IDentifier (ICCID) is the Unique Identifier of the SIM CARD. File is
* located in the SIM card at EFiccid (0x2FE2) as per ETSI 102.221. The ICCID is defined by
* the ITU-T recommendation E.118 ISO/IEC 7816.
*
diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
index 16573f4..7ad8c77 100644
--- a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
@@ -389,7 +389,7 @@
/**
* Provide Carrier specific information to the modem that must be used to encrypt the IMSI and
- * IMPI. Sent by the framework during boot, carrier switch and everytime the framework receives
+ * IMPI. Sent by the framework during boot, carrier switch and every time the framework receives
* a new certificate.
*
* @param serial Serial number of request.
@@ -583,7 +583,7 @@
* Close a previously opened logical channel. This command reflects TS 27.007
* "close logical channel" operation (+CCHC).
*
- * Per spec SGP.22 V3.0, ES10 commands needs to be sent over command port of MEP-A. In order
+ * Per spec SGP.22 V3.0, ES10 commands need to be sent over command port of MEP-A. In order
* to close proper logical channel, should pass information about whether the logical channel
* was opened for sending ES10 commands or not.
*
diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl
index d9735d3..7967b6b 100644
--- a/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl
@@ -30,7 +30,7 @@
oneway interface IRadioSimIndication {
/**
* Indicates that the modem requires the Carrier info for IMSI/IMPI encryption. This might
- * happen when the modem restarts or for some reason it's cache has been invalidated.
+ * happen when the modem restarts or for some reason its cache has been invalidated.
*
* @param type Type of radio indication
*/
@@ -85,7 +85,7 @@
void simStatusChanged(in RadioIndicationType type);
/**
- * Indicates when SIM notifies applcations some event happens.
+ * Indicates when SIM notifies applications some event happens.
*
* @param type Type of radio indication
* @param cmd SAT/USAT commands or responses sent by ME to SIM or commands handled by ME,
diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
index 62fa674..5c31bd2 100644
--- a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
@@ -33,7 +33,7 @@
oneway interface IRadioSimResponse {
/**
* Acknowledge the receipt of radio request sent to the vendor. This must be sent only for
- * radio request which take long time to respond. For more details, refer
+ * radio requests which take a long time to respond. For more details, refer
* https://source.android.com/devices/tech/connect/ril.html
*
* @param serial Serial no. of the request whose acknowledgement is sent.
@@ -629,7 +629,7 @@
/**
* @param info Response info struct containing response type, serial no. and error
* @param persoType SIM Personalization type
- * @param remainingRetries postiive values indicates number of retries remaining, must be equal
+ * @param remainingRetries positive values indicates number of retries remaining, must be equal
* to -1 if number of retries is infinite.
*
* Valid errors returned:
diff --git a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
index 618ac32..88c4552 100644
--- a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
@@ -45,9 +45,9 @@
/**
* AID (application ID) of the card application. See ETSI 102.221 8.1 and 101.220 4.
* For TYPE_SIM_FILE_UPDATE result, it must be set to AID of application in which updated EF
- * resides or it must be empty string if EF is outside of an application. For TYPE_SIM_INIT
+ * resides or it must be an empty string if EF is outside of an application. For TYPE_SIM_INIT
* result, this field is set to AID of application that caused REFRESH. For TYPE_SIM_RESET
- * result, it is empty string.
+ * result, it is an empty string.
*/
String aid;
}
diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h
index aea5cee..d9c7311 100644
--- a/radio/aidl/vts/radio_aidl_hal_utils.h
+++ b/radio/aidl/vts/radio_aidl_hal_utils.h
@@ -65,8 +65,6 @@
static constexpr const char* FEATURE_TELEPHONY = "android.hardware.telephony";
-static constexpr const char* FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm";
-
static constexpr const char* FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma";
static constexpr const char* FEATURE_TELEPHONY_IMS = "android.hardware.telephony.ims";
diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp
index 6a9996b..98ea0d2 100644
--- a/radio/aidl/vts/radio_modem_test.cpp
+++ b/radio/aidl/vts/radio_modem_test.cpp
@@ -55,6 +55,15 @@
ASSERT_NE(nullptr, radio_config.get());
}
+bool RadioModemTest::shouldTestCdma() {
+ int32_t aidl_version = 0;
+ ndk::ScopedAStatus aidl_status = radio_modem->getInterfaceVersion(&aidl_version);
+ EXPECT_TRUE(aidl_status.isOk());
+ if (aidl_version < 2) return true; // < RADIO_HAL_VERSION_2_1
+
+ return !telephony_flags::cleanup_cdma();
+}
+
/*
* Test IRadioModem.setRadioPower() for the response returned.
*/
@@ -220,13 +229,6 @@
* Test IRadioModem.getImei() for the response returned.
*/
TEST_P(RadioModemTest, getImei) {
- if (telephony_flags::enforce_telephony_feature_mapping()) {
- if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) {
- GTEST_SKIP() << "Skipping getImei "
- "due to undefined FEATURE_TELEPHONY_GSM";
- }
- }
-
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_modem->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -251,6 +253,10 @@
* Test IRadioModem.nvReadItem() for the response returned.
*/
TEST_P(RadioModemTest, nvReadItem) {
+ if (!shouldTestCdma()) {
+ GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+ }
+
serial = GetRandomSerialNumber();
radio_modem->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25);
@@ -268,6 +274,10 @@
* Test IRadioModem.nvWriteItem() for the response returned.
*/
TEST_P(RadioModemTest, nvWriteItem) {
+ if (!shouldTestCdma()) {
+ GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+ }
+
serial = GetRandomSerialNumber();
NvWriteItem item;
memset(&item, 0, sizeof(item));
diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h
index aa99ea3..21481bd 100644
--- a/radio/aidl/vts/radio_modem_utils.h
+++ b/radio/aidl/vts/radio_modem_utils.h
@@ -119,6 +119,8 @@
public:
void SetUp() override;
+ bool shouldTestCdma();
+
/* radio modem service handle */
std::shared_ptr<IRadioModem> radio_modem;
/* radio modem response handle */
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 2b4dc42..439d268 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -78,6 +78,15 @@
ASSERT_NE(nullptr, radio_config.get());
}
+bool RadioNetworkTest::shouldTestCdma() {
+ int32_t aidl_version = 0;
+ ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+ EXPECT_TRUE(aidl_status.isOk());
+ if (aidl_version < 4) return true; // < RADIO_HAL_VERSION_2_3
+
+ return !telephony_flags::cleanup_cdma();
+}
+
void RadioNetworkTest::stopNetworkScan() {
serial = GetRandomSerialNumber();
radio_network->stopNetworkScan(serial);
@@ -1065,7 +1074,7 @@
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::SIM_ABSENT}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM) && isLteConnected()) {
+ if (isLteConnected()) {
// Modems support 3GPP RAT family need to
// support scanning requests combined with some parameters.
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
@@ -1775,6 +1784,9 @@
* Test IRadioNetwork.getAvailableBandModes() for the response returned.
*/
TEST_P(RadioNetworkTest, getAvailableBandModes) {
+ if (!shouldTestCdma()) {
+ GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+ }
if (telephony_flags::enforce_telephony_feature_mapping()) {
if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
GTEST_SKIP() << "Skipping getAvailableBandModes "
@@ -2019,6 +2031,9 @@
* Test IRadioNetwork.setBandMode() for the response returned.
*/
TEST_P(RadioNetworkTest, setBandMode) {
+ if (!shouldTestCdma()) {
+ GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+ }
if (telephony_flags::enforce_telephony_feature_mapping()) {
if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
GTEST_SKIP() << "Skipping setBandMode "
@@ -2043,6 +2058,10 @@
* Test IRadioNetwork.setLocationUpdates() for the response returned.
*/
TEST_P(RadioNetworkTest, setLocationUpdates) {
+ // While setLocationUpdates is not CDMA-related, it's guarded by the same release flag.
+ if (!shouldTestCdma()) {
+ GTEST_SKIP() << "Skipping testing of deprecated setLocationUpdates method";
+ }
if (telephony_flags::enforce_telephony_feature_mapping()) {
if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
GTEST_SKIP() << "Skipping setLocationUpdates "
@@ -2552,28 +2571,28 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
+ if (radioRsp_network->rspInfo.error != RadioError::NONE) return;
+ // Assert the value has changed
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_network->isCellularIdentifierTransparencyEnabled(serial);
+
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
if (radioRsp_network->rspInfo.error == RadioError::NONE) {
- // Assert the value has changed
- serial = GetRandomSerialNumber();
- ndk::ScopedAStatus res = radio_network->isCellularIdentifierTransparencyEnabled(serial);
-
- ASSERT_OK(res);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
- EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
- RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
EXPECT_EQ(valueToSet, radioRsp_network->isCellularIdentifierTransparencyEnabled);
-
- // Reset original state
- radio_network->setCellularIdentifierTransparencyEnabled(serial,
- originalTransparencySetting);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
- EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
}
+
+ // Reset original state
+ radio_network->setCellularIdentifierTransparencyEnabled(serial, originalTransparencySetting);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
}
/*
diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h
index 17c0896..3387dec 100644
--- a/radio/aidl/vts/radio_network_utils.h
+++ b/radio/aidl/vts/radio_network_utils.h
@@ -263,6 +263,8 @@
public:
void SetUp() override;
+ bool shouldTestCdma();
+
/* radio network service handle */
std::shared_ptr<IRadioNetwork> radio_network;
/* radio network response handle */
diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp
index 2823977..aaccb21 100644
--- a/radio/aidl/vts/radio_sim_test.cpp
+++ b/radio/aidl/vts/radio_sim_test.cpp
@@ -52,6 +52,15 @@
ASSERT_NE(nullptr, radio_config.get());
}
+bool RadioSimTest::shouldTestCdma() {
+ int32_t aidl_version = 0;
+ ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
+ EXPECT_TRUE(aidl_status.isOk());
+ if (aidl_version < 4) return true; // < RADIO_HAL_VERSION_2_3
+
+ return !telephony_flags::cleanup_cdma();
+}
+
void RadioSimTest::updateSimCardStatus() {
serial = GetRandomSerialNumber();
radio_sim->getIccCardStatus(serial);
@@ -935,6 +944,13 @@
* Test IRadioSim.iccCloseLogicalChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccCloseLogicalChannel) {
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version >= 2) { // >= RADIO_HAL_VERSION_2_1
+ GTEST_SKIP() << "Skipping iccCloseLogicalChannel (deprecated)";
+ }
+
if (telephony_flags::enforce_telephony_feature_mapping()) {
if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
GTEST_SKIP() << "Skipping iccCloseLogicalChannel "
@@ -1176,6 +1192,9 @@
* Test IRadioSim.setUiccSubscription() for the response returned.
*/
TEST_P(RadioSimTest, setUiccSubscription) {
+ if (!shouldTestCdma()) {
+ GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
+ }
if (telephony_flags::enforce_telephony_feature_mapping()) {
if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
GTEST_SKIP() << "Skipping setUiccSubscription "
diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h
index 7cbcc58..eb3efb2 100644
--- a/radio/aidl/vts/radio_sim_utils.h
+++ b/radio/aidl/vts/radio_sim_utils.h
@@ -198,6 +198,8 @@
public:
void SetUp() override;
+ bool shouldTestCdma();
+
/* Override updateSimCardStatus in RadioServiceTest to not call setResponseFunctions */
void updateSimCardStatus();
diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp
index 6c68fd5..3b07378 100644
--- a/radio/aidl/vts/radio_voice_test.cpp
+++ b/radio/aidl/vts/radio_voice_test.cpp
@@ -102,10 +102,6 @@
if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
ALOGI("Skipping emergencyDial because voice call is not supported in device");
return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
} else {
ALOGI("Running emergencyDial because voice call is supported in device");
}
@@ -163,10 +159,6 @@
if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
ALOGI("Skipping emergencyDial because voice call is not supported in device");
return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
} else {
ALOGI("Running emergencyDial because voice call is supported in device");
}
@@ -224,10 +216,6 @@
if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
ALOGI("Skipping emergencyDial because voice call is not supported in device");
return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
} else {
ALOGI("Running emergencyDial because voice call is supported in device");
}
diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
index fc703e9..1908d05 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
@@ -479,8 +479,8 @@
* structure.
*
* @param unwrappingParams must contain any parameters needed to perform the unwrapping
- * operation. For example, if the wrapping key is an AES key the block and padding modes
- * must be specified in this argument.
+ * operation. For example, the padding mode for the RSA wrapping key must be specified
+ * in this argument.
*
* @param passwordSid specifies the password secure ID (SID) of the user that owns the key being
* installed. If the authorization list in wrappedKeyData contains a
diff --git a/security/keymint/aidl/default/Android.bp b/security/keymint/aidl/default/Android.bp
index 0197141..0d03651 100644
--- a/security/keymint/aidl/default/Android.bp
+++ b/security/keymint/aidl/default/Android.bp
@@ -192,7 +192,6 @@
],
prebuilts: [
"keymint_aidl_nonsecure_init_rc",
- "keymint_aidl_nonsecure_vintf",
"android.hardware.hardware_keystore.xml", // permissions
],
}
@@ -210,14 +209,3 @@
out: ["android.hardware.security.keymint-service.nonsecure.apex.rc"],
cmd: "sed -E 's%/vendor/bin/%/apex/com.android.hardware.keymint/bin/%' $(in) > $(out)",
}
-
-prebuilt_etc {
- name: "keymint_aidl_nonsecure_vintf",
- sub_dir: "vintf",
- vendor: true,
- srcs: [
- "android.hardware.security.keymint-service.xml",
- "android.hardware.security.sharedsecret-service.xml",
- "android.hardware.security.secureclock-service.xml",
- ],
-}
diff --git a/security/keymint/support/authorization_set.cpp b/security/keymint/support/authorization_set.cpp
index c1b5d48..5944908 100644
--- a/security/keymint/support/authorization_set.cpp
+++ b/security/keymint/support/authorization_set.cpp
@@ -22,6 +22,8 @@
#include <aidl/android/hardware/security/keymint/KeyParameter.h>
#include <aidl/android/hardware/security/keymint/KeyPurpose.h>
+#include <algorithm>
+
namespace aidl::android::hardware::security::keymint {
void AuthorizationSet::Sort() {
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 65e93c6..0696ada 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -405,7 +405,7 @@
* is non-normal.
*/
TEST(NonParameterizedTests, unlockedBootloaderStatesImpliesNonNormalKeyMintInAVmDiceChain) {
- if (::android::base::GetBoolProperty("trusty.security_vm.keymint.enabled", false)) {
+ if (!::android::base::GetBoolProperty("trusty.security_vm.keymint.enabled", false)) {
GTEST_SKIP() << "The KeyMint (" << DEFAULT_INSTANCE_NAME
<< ") instance is not inside a VM.";
}
diff --git a/security/secretkeeper/aidl/vts/Android.bp b/security/secretkeeper/aidl/vts/Android.bp
index c84afae..4353ca5 100644
--- a/security/secretkeeper/aidl/vts/Android.bp
+++ b/security/secretkeeper/aidl/vts/Android.bp
@@ -27,6 +27,7 @@
"libciborium",
"libcoset",
"libdiced_open_dice",
+ "libexplicitkeydice",
"libhex",
"liblog_rust",
"libsecretkeeper_client",
@@ -54,6 +55,7 @@
"libciborium",
"libcoset",
"libdice_policy_builder",
+ "libexplicitkeydice",
"liblog_rust",
"libsecretkeeper_client",
"libsecretkeeper_comm_nostd",
@@ -77,6 +79,7 @@
"libclap",
"libcoset",
"libdice_policy_builder",
+ "libexplicitkeydice",
"libhex",
"liblog_rust",
"libsecretkeeper_client",
diff --git a/security/secretkeeper/aidl/vts/dice_sample.rs b/security/secretkeeper/aidl/vts/dice_sample.rs
index d6379e5..f504445 100644
--- a/security/secretkeeper/aidl/vts/dice_sample.rs
+++ b/security/secretkeeper/aidl/vts/dice_sample.rs
@@ -34,8 +34,8 @@
retry_bcc_main_flow, retry_dice_main_flow, Config, DiceArtifacts, DiceConfigValues, DiceError,
DiceMode, InputValues, OwnedDiceArtifacts, HASH_SIZE, HIDDEN_SIZE,
};
+use explicitkeydice::OwnedDiceArtifactsWithExplicitKey;
use log::error;
-use secretkeeper_client::dice::OwnedDiceArtifactsWithExplicitKey;
/// Sample UDS used to perform the root DICE flow by `make_sample_bcc_and_cdis`.
const UDS: &[u8; CDI_SIZE] = &[
diff --git a/security/secretkeeper/aidl/vts/secretkeeper_cli.rs b/security/secretkeeper/aidl/vts/secretkeeper_cli.rs
index 9fbfb45..6a743a8 100644
--- a/security/secretkeeper/aidl/vts/secretkeeper_cli.rs
+++ b/security/secretkeeper/aidl/vts/secretkeeper_cli.rs
@@ -29,7 +29,8 @@
WILDCARD_FULL_ARRAY,
};
-use secretkeeper_client::{dice::OwnedDiceArtifactsWithExplicitKey, SkSession};
+use explicitkeydice::OwnedDiceArtifactsWithExplicitKey;
+use secretkeeper_client::SkSession;
use secretkeeper_comm::data_types::{
error::SecretkeeperError,
packet::{ResponsePacket, ResponseType},
diff --git a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
index b944865..453ff8f 100644
--- a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
+++ b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
@@ -22,8 +22,8 @@
use authgraph_core::key;
use coset::{CborOrdering, CborSerializable, CoseEncrypt0, CoseKey};
use dice_policy_builder::{TargetEntry, ConstraintSpec, ConstraintType, MissingAction, WILDCARD_FULL_ARRAY, policy_for_dice_chain};
+use explicitkeydice::OwnedDiceArtifactsWithExplicitKey;
use rdroidtest::{ignore_if, rdroidtest};
-use secretkeeper_client::dice::OwnedDiceArtifactsWithExplicitKey;
use secretkeeper_client::{SkSession, Error as SkClientError};
use secretkeeper_core::cipher;
use secretkeeper_comm::data_types::error::SecretkeeperError;
diff --git a/security/see/authmgr/aidl/README.md b/security/see/authmgr/aidl/README.md
new file mode 100644
index 0000000..97b2b1d
--- /dev/null
+++ b/security/see/authmgr/aidl/README.md
@@ -0,0 +1,21 @@
+# AuthMgr
+
+The AuthMgr protocol authenticates and authorizes clients before they can
+access trusted HALs, AIDL-defined services in trusted execution environments.
+Version 1 was designed to allow applications running in a protected virtual
+machine (pVM) to access services running in a TEE in ARM TrustZone. An
+implementation of `IAuthMgrAuthorization` is referred to as an AuthMgr Backend.
+An implementation of a client of the AuthMgr Backend is referred to as an
+AuthMgr Frontend.
+
+
+## Additional Requirements by Android Version
+
+The comments on `IAuthMgrAuthorization` describe the requirements for implementing
+an AuthMgr Backend (implementor of the interface) itself. There are some additional
+requirements that are specific to Android release versions.
+
+### Android 16
+If implementing `IAuthMgrAuthorization` in Android 16 only one AuthMgr Backend is
+supported and dynamic service discovery is not supported. The AuthMgr Backend
+service must be exposed on secure partition ID 0x8001 over VSOCK port 1.
\ No newline at end of file
diff --git a/sensors/aidl/default/Sensors.cpp b/sensors/aidl/default/Sensors.cpp
index 65dd304..853045d 100644
--- a/sensors/aidl/default/Sensors.cpp
+++ b/sensors/aidl/default/Sensors.cpp
@@ -82,11 +82,9 @@
const MQDescriptor<int32_t, SynchronizedReadWrite>& in_wakeLockDescriptor,
const std::shared_ptr<::aidl::android::hardware::sensors::ISensorsCallback>&
in_sensorsCallback) {
+ ALOGI("Sensors initializing");
ScopedAStatus result = ScopedAStatus::ok();
- mEventQueue = std::make_unique<AidlMessageQueue<Event, SynchronizedReadWrite>>(
- in_eventQueueDescriptor, true /* resetPointers */);
-
// Ensure that all sensors are disabled.
for (auto sensor : mSensors) {
sensor.second->activate(false);
@@ -101,22 +99,30 @@
// Save a reference to the callback
mCallback = in_sensorsCallback;
- // Ensure that any existing EventFlag is properly deleted
- deleteEventFlag();
+ {
+ // Hold the lock to ensure that re-creation of event flag is atomic
+ std::lock_guard<std::mutex> lock(mWriteLock);
- // Create the EventFlag that is used to signal to the framework that sensor events have been
- // written to the Event FMQ
- if (EventFlag::createEventFlag(mEventQueue->getEventFlagWord(), &mEventQueueFlag) != OK) {
- result = ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
- }
+ mEventQueue = std::make_unique<AidlMessageQueue<Event, SynchronizedReadWrite>>(
+ in_eventQueueDescriptor, true /* resetPointers */);
- // Create the Wake Lock FMQ that is used by the framework to communicate whenever WAKE_UP
- // events have been successfully read and handled by the framework.
- mWakeLockQueue = std::make_unique<AidlMessageQueue<int32_t, SynchronizedReadWrite>>(
- in_wakeLockDescriptor, true /* resetPointers */);
+ // Ensure that any existing EventFlag is properly deleted
+ deleteEventFlagLocked();
- if (!mCallback || !mEventQueue || !mWakeLockQueue || mEventQueueFlag == nullptr) {
- result = ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ // Create the EventFlag that is used to signal to the framework that sensor events have been
+ // written to the Event FMQ
+ if (EventFlag::createEventFlag(mEventQueue->getEventFlagWord(), &mEventQueueFlag) != OK) {
+ result = ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+
+ // Create the Wake Lock FMQ that is used by the framework to communicate whenever WAKE_UP
+ // events have been successfully read and handled by the framework.
+ mWakeLockQueue = std::make_unique<AidlMessageQueue<int32_t, SynchronizedReadWrite>>(
+ in_wakeLockDescriptor, true /* resetPointers */);
+
+ if (!mCallback || !mEventQueue || !mWakeLockQueue || mEventQueueFlag == nullptr) {
+ result = ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
}
// Start the thread to read events from the Wake Lock FMQ
diff --git a/sensors/aidl/default/include/sensors-impl/Sensors.h b/sensors/aidl/default/include/sensors-impl/Sensors.h
index c90db69..8336429 100644
--- a/sensors/aidl/default/include/sensors-impl/Sensors.h
+++ b/sensors/aidl/default/include/sensors-impl/Sensors.h
@@ -23,6 +23,8 @@
#include <map>
#include "Sensor.h"
+#include <android-base/thread_annotations.h>
+
namespace aidl {
namespace android {
namespace hardware {
@@ -125,6 +127,11 @@
void deleteEventFlag() {
// Hold the lock to ensure we don't delete the flag while it's being used in postEvents()
std::lock_guard<std::mutex> lock(mWriteLock);
+ deleteEventFlagLocked();
+ }
+
+ // Expects mWriteLock to be locked prior to invocation
+ void deleteEventFlagLocked() {
if (mEventQueueFlag != nullptr) {
status_t status = EventFlag::deleteEventFlag(&mEventQueueFlag);
if (status != OK) {
@@ -193,7 +200,7 @@
// The Wake Lock FMQ that is read to determine when the framework has handled WAKE_UP events
std::unique_ptr<AidlMessageQueue<int32_t, SynchronizedReadWrite>> mWakeLockQueue;
// Event Flag to signal to the framework when sensor events are available to be read
- EventFlag* mEventQueueFlag;
+ EventFlag* mEventQueueFlag GUARDED_BY(mWriteLock);
// Callback for asynchronous events, such as dynamic sensor connections.
std::shared_ptr<::aidl::android::hardware::sensors::ISensorsCallback> mCallback;
// A map of the available sensors.
diff --git a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
index 17653b4..9dd5153 100644
--- a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
+++ b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
@@ -38,6 +38,7 @@
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <android/binder_status.h>
+#include <cutils/properties.h>
#include <gtest/gtest.h>
#include <unistd.h>
@@ -179,6 +180,34 @@
ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
}
}
+
+ bool isEmulator() {
+ if (property_get_bool("ro.boot.qemu", false)) {
+ return true;
+ }
+ char device[PROP_VALUE_MAX];
+ char model[PROP_VALUE_MAX];
+ char name[PROP_VALUE_MAX];
+ char hardware[PROP_VALUE_MAX];
+
+ property_get("ro.product.device", device, "");
+ property_get("ro.product.model", model, "");
+ property_get("ro.product.name", name, "");
+ property_get("ro.hardware", hardware, "");
+
+ std::string deviceStr(device);
+ std::string modelStr(model);
+ std::string nameStr(name);
+ std::string hardwareStr(hardware);
+
+ return deviceStr.rfind("vsoc_", 0) == 0 || modelStr.rfind("Cuttlefish ", 0) == 0 ||
+ nameStr.rfind("cf_", 0) == 0 || nameStr.rfind("aosp_cf_", 0) == 0 ||
+ hardwareStr.find("goldfish") != std::string::npos ||
+ hardwareStr.find("ranchu") != std::string::npos ||
+ hardwareStr.find("cutf_cvm") != std::string::npos ||
+ hardwareStr.find("starfish") != std::string::npos;
+ }
+
// Stores thermal version
int32_t thermal_version;
@@ -359,6 +388,9 @@
if (apiLevel < 202404) {
GTEST_SKIP() << "Skipping test as the vendor level is below 202404: " << apiLevel;
}
+ if (isEmulator()) {
+ GTEST_SKIP() << "Skipping test on emulator";
+ }
for (const auto& feature : kNonHandheldFeatures) {
if (::testing::deviceSupportsFeature(feature.c_str())) {
GTEST_SKIP() << "Skipping test as the device has feature: " << feature;
diff --git a/tv/mediaquality/aidl/Android.bp b/tv/mediaquality/aidl/Android.bp
index 49cfd80..f817836 100644
--- a/tv/mediaquality/aidl/Android.bp
+++ b/tv/mediaquality/aidl/Android.bp
@@ -10,7 +10,6 @@
aidl_interface {
name: "android.hardware.tv.mediaquality",
vendor_available: true,
- owner: "haofanw",
srcs: [
"android/hardware/tv/mediaquality/*.aidl",
],
@@ -35,5 +34,12 @@
enabled: false,
},
},
- frozen: false,
+ frozen: true,
+ versions_with_info: [
+ {
+ version: "1",
+ imports: ["android.hardware.graphics.common-V5"],
+ },
+ ],
+
}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/.hash b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/.hash
new file mode 100644
index 0000000..a3e4a55
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/.hash
@@ -0,0 +1 @@
+ac19fd80413145bec55462874afb34c24a47a12b
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightColorFormat.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightColorFormat.aidl
new file mode 100644
index 0000000..9ee9dcc
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightColorFormat.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+union AmbientBacklightColorFormat {
+ int RGB888;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightCompressAlgorithm.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightCompressAlgorithm.aidl
new file mode 100644
index 0000000..d441370
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightCompressAlgorithm.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum AmbientBacklightCompressAlgorithm {
+ NONE = 0,
+ RLE = 1,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightEvent.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightEvent.aidl
new file mode 100644
index 0000000..2fc2cc6
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightEvent.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+union AmbientBacklightEvent {
+ boolean enabled;
+ android.hardware.tv.mediaquality.AmbientBacklightMetadata metadata;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightMetadata.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightMetadata.aidl
new file mode 100644
index 0000000..2ea3198
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightMetadata.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable AmbientBacklightMetadata {
+ android.hardware.tv.mediaquality.AmbientBacklightSettings settings;
+ android.hardware.tv.mediaquality.AmbientBacklightCompressAlgorithm compressAlgorithm;
+ android.hardware.tv.mediaquality.AmbientBacklightColorFormat[] zonesColors;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightSettings.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightSettings.aidl
new file mode 100644
index 0000000..7770e18
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightSettings.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable AmbientBacklightSettings {
+ int uid;
+ android.hardware.tv.mediaquality.AmbientBacklightSource source;
+ int maxFramerate;
+ android.hardware.graphics.common.PixelFormat colorFormat;
+ int hZonesNumber;
+ int vZonesNumber;
+ boolean hasLetterbox;
+ int colorThreshold;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightSource.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightSource.aidl
new file mode 100644
index 0000000..22912f4
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/AmbientBacklightSource.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum AmbientBacklightSource {
+ NONE = 0,
+ AUDIO = 1,
+ VIDEO = 2,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorRange.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorRange.aidl
new file mode 100644
index 0000000..c08c6cc
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorRange.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum ColorRange {
+ AUTO,
+ LIMITED,
+ FULL,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorSpace.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorSpace.aidl
new file mode 100644
index 0000000..9bcddcb
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorSpace.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum ColorSpace {
+ AUTO,
+ S_RGB_BT_709,
+ DCI,
+ ADOBE_RGB,
+ BT2020,
+ ON,
+ OFF,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorTemperature.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorTemperature.aidl
new file mode 100644
index 0000000..2d26aca
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ColorTemperature.aidl
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum ColorTemperature {
+ USER,
+ COOL,
+ STANDARD,
+ WARM,
+ USER_HDR10PLUS,
+ COOL_HDR10PLUS,
+ STANDARD_HDR10PLUS,
+ WARM_HDR10PLUS,
+ FMMSDR,
+ FMMHDR,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DigitalOutput.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DigitalOutput.aidl
new file mode 100644
index 0000000..dad0e96
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DigitalOutput.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum DigitalOutput {
+ AUTO,
+ BYPASS,
+ PCM,
+ DolbyDigitalPlus,
+ DolbyDigital,
+ DolbyMat,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl
new file mode 100644
index 0000000..f21243c
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable DolbyAudioProcessing {
+ android.hardware.tv.mediaquality.DolbyAudioProcessing.SoundMode soundMode;
+ boolean volumeLeveler;
+ boolean surroundVirtualizer;
+ boolean dolbyAtmos;
+ enum SoundMode {
+ GAME,
+ MOVIE,
+ MUSIC,
+ NEWS,
+ STADIUM,
+ STANDARD,
+ USER,
+ }
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DownmixMode.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DownmixMode.aidl
new file mode 100644
index 0000000..ecb7db2
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DownmixMode.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum DownmixMode {
+ STEREO,
+ SURROUND,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DtsVirtualX.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DtsVirtualX.aidl
new file mode 100644
index 0000000..d136dd9
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/DtsVirtualX.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable DtsVirtualX {
+ boolean tbHdx;
+ boolean limiter;
+ boolean truSurroundX;
+ boolean truVolumeHd;
+ boolean dialogClarity;
+ boolean definition;
+ boolean height;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/EqualizerDetail.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/EqualizerDetail.aidl
new file mode 100644
index 0000000..99543e9
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/EqualizerDetail.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable EqualizerDetail {
+ int band120Hz;
+ int band500Hz;
+ int band1_5kHz;
+ int band5kHz;
+ int band10kHz;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/Gamma.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/Gamma.aidl
new file mode 100644
index 0000000..89bb808
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/Gamma.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum Gamma {
+ DARK,
+ MIDDLE,
+ BRIGHT,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IMediaQuality.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IMediaQuality.aidl
new file mode 100644
index 0000000..26df461
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IMediaQuality.aidl
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+interface IMediaQuality {
+ void setAmbientBacklightCallback(in android.hardware.tv.mediaquality.IMediaQualityCallback callback);
+ void setAmbientBacklightDetector(in android.hardware.tv.mediaquality.AmbientBacklightSettings settings);
+ void setAmbientBacklightDetectionEnabled(in boolean enabled);
+ boolean getAmbientBacklightDetectionEnabled();
+ boolean isAutoPqSupported();
+ boolean getAutoPqEnabled();
+ void setAutoPqEnabled(boolean enable);
+ boolean isAutoSrSupported();
+ boolean getAutoSrEnabled();
+ void setAutoSrEnabled(boolean enable);
+ boolean isAutoAqSupported();
+ boolean getAutoAqEnabled();
+ void setAutoAqEnabled(boolean enable);
+ android.hardware.tv.mediaquality.IPictureProfileChangedListener getPictureProfileListener();
+ void setPictureProfileAdjustmentListener(android.hardware.tv.mediaquality.IPictureProfileAdjustmentListener listener);
+ void sendDefaultPictureParameters(in android.hardware.tv.mediaquality.PictureParameters pictureParameters);
+ android.hardware.tv.mediaquality.ISoundProfileChangedListener getSoundProfileListener();
+ void setSoundProfileAdjustmentListener(android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener listener);
+ void sendDefaultSoundParameters(in android.hardware.tv.mediaquality.SoundParameters soundParameters);
+ void getParamCaps(in android.hardware.tv.mediaquality.ParameterName[] paramNames, out android.hardware.tv.mediaquality.ParamCapability[] caps);
+ void getVendorParamCaps(in android.hardware.tv.mediaquality.VendorParameterIdentifier[] names, out android.hardware.tv.mediaquality.VendorParamCapability[] caps);
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IMediaQualityCallback.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IMediaQualityCallback.aidl
new file mode 100644
index 0000000..014bf58
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IMediaQualityCallback.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+interface IMediaQualityCallback {
+ oneway void notifyAmbientBacklightEvent(in android.hardware.tv.mediaquality.AmbientBacklightEvent event);
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
new file mode 100644
index 0000000..1923043
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+interface IPictureProfileAdjustmentListener {
+ oneway void onPictureProfileAdjusted(in android.hardware.tv.mediaquality.PictureProfile pictureProfile);
+ oneway void onParamCapabilityChanged(long pictureProfileId, in android.hardware.tv.mediaquality.ParamCapability[] caps);
+ oneway void onVendorParamCapabilityChanged(long pictureProfileId, in android.hardware.tv.mediaquality.VendorParamCapability[] caps);
+ oneway void requestPictureParameters(long pictureProfileId);
+ oneway void onStreamStatusChanged(long pictureProfileId, android.hardware.tv.mediaquality.StreamStatus status);
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IPictureProfileChangedListener.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IPictureProfileChangedListener.aidl
new file mode 100644
index 0000000..c1bfc36
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/IPictureProfileChangedListener.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+interface IPictureProfileChangedListener {
+ oneway void onPictureProfileChanged(in android.hardware.tv.mediaquality.PictureProfile pictureProfile);
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
new file mode 100644
index 0000000..d976cf7
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+interface ISoundProfileAdjustmentListener {
+ oneway void onSoundProfileAdjusted(in android.hardware.tv.mediaquality.SoundProfile soundProfile);
+ oneway void onParamCapabilityChanged(long soundProfileId, in android.hardware.tv.mediaquality.ParamCapability[] caps);
+ oneway void onVendorParamCapabilityChanged(long soundProfileId, in android.hardware.tv.mediaquality.VendorParamCapability[] caps);
+ oneway void requestSoundParameters(long SoundProfileId);
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ISoundProfileChangedListener.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ISoundProfileChangedListener.aidl
new file mode 100644
index 0000000..d07abe7
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ISoundProfileChangedListener.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+interface ISoundProfileChangedListener {
+ oneway void onSoundProfileChanged(in android.hardware.tv.mediaquality.SoundProfile soundProfile);
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/NumberRange.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/NumberRange.aidl
new file mode 100644
index 0000000..9fc9d0d
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/NumberRange.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+union NumberRange {
+ @nullable int[2] intMinMax;
+ @nullable long[2] longMinMax;
+ @nullable double[2] doubleMinMax;
+ @nullable int[] intValuesSupported;
+ @nullable long[] longValuesSupported;
+ @nullable double[] doubleValuesSupported;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParamCapability.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParamCapability.aidl
new file mode 100644
index 0000000..c60f1d1
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParamCapability.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable ParamCapability {
+ android.hardware.tv.mediaquality.ParameterName name;
+ boolean isSupported;
+ @nullable android.hardware.tv.mediaquality.ParameterDefaultValue defaultValue;
+ @nullable android.hardware.tv.mediaquality.ParameterRange range;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl
new file mode 100644
index 0000000..14e5ff4
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterDefaultValue.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+union ParameterDefaultValue {
+ int intDefault;
+ long longDefault;
+ double doubleDefault;
+ String stringDefault;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterName.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterName.aidl
new file mode 100644
index 0000000..522b8e6
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterName.aidl
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum ParameterName {
+ BRIGHTNESS,
+ CONTRAST,
+ SHARPNESS,
+ SATURATION,
+ HUE,
+ COLOR_TUNER_BRIGHTNESS,
+ COLOR_TUNER_SATURATION,
+ COLOR_TUNER_HUE,
+ COLOR_TUNER_RED_OFFSET,
+ COLOR_TUNER_GREEN_OFFSET,
+ COLOR_TUNER_BLUE_OFFSET,
+ COLOR_TUNER_RED_GAIN,
+ COLOR_TUNER_GREEN_GAIN,
+ COLOR_TUNER_BLUE_GAIN,
+ NOISE_REDUCTION,
+ MPEG_NOISE_REDUCTION,
+ FLASH_TONE,
+ DE_CONTOUR,
+ DYNAMIC_LUMA_CONTROL,
+ FILM_MODE,
+ BLACK_STRETCH,
+ BLUE_STRETCH,
+ COLOR_TUNE,
+ COLOR_TEMPERATURE,
+ GLOBE_DIMMING,
+ AUTO_PICTUREQUALITY_ENABLED,
+ AUTO_SUPER_RESOLUTION_ENABLED,
+ LEVEL_RANGE,
+ GAMUT_MAPPING,
+ PC_MODE,
+ LOW_LATENCY,
+ VRR,
+ CVRR,
+ HDMI_RGB_RANGE,
+ COLOR_SPACE,
+ PANEL_INIT_MAX_LUMINCE_VALID,
+ GAMMA,
+ COLOR_TEMPERATURE_RED_GAIN,
+ COLOR_TEMPERATURE_GREEN_GAIN,
+ COLOR_TEMPERATURE_BLUE_GAIN,
+ COLOR_TEMPERATURE_RED_OFFSET,
+ COLOR_TEMPERATURE_GREEN_OFFSET,
+ COLOR_TEMPERATURE_BLUE_OFFSET,
+ ELEVEN_POINT_RED,
+ ELEVEN_POINT_GREEN,
+ ELEVEN_POINT_BLUE,
+ LOW_BLUE_LIGHT,
+ LD_MODE,
+ OSD_RED_GAIN,
+ OSD_GREEN_GAIN,
+ OSD_BLUE_GAIN,
+ OSD_RED_OFFSET,
+ OSD_GREEN_OFFSET,
+ OSD_BLUE_OFFSET,
+ OSD_HUE,
+ OSD_SATURATION,
+ OSD_CONTRAST,
+ COLOR_TUNER_SWITCH,
+ COLOR_TUNER_HUE_RED,
+ COLOR_TUNER_HUE_GREEN,
+ COLOR_TUNER_HUE_BLUE,
+ COLOR_TUNER_HUE_CYAN,
+ COLOR_TUNER_HUE_MAGENTA,
+ COLOR_TUNER_HUE_YELLOW,
+ COLOR_TUNER_HUE_FLESH,
+ COLOR_TUNER_SATURATION_RED,
+ COLOR_TUNER_SATURATION_GREEN,
+ COLOR_TUNER_SATURATION_BLUE,
+ COLOR_TUNER_SATURATION_CYAN,
+ COLOR_TUNER_SATURATION_MAGENTA,
+ COLOR_TUNER_SATURATION_YELLOW,
+ COLOR_TUNER_SATURATION_FLESH,
+ COLOR_TUNER_LUMINANCE_RED,
+ COLOR_TUNER_LUMINANCE_GREEN,
+ COLOR_TUNER_LUMINANCE_BLUE,
+ COLOR_TUNER_LUMINANCE_CYAN,
+ COLOR_TUNER_LUMINANCE_MAGENTA,
+ COLOR_TUNER_LUMINANCE_YELLOW,
+ COLOR_TUNER_LUMINANCE_FLESH,
+ BALANCE,
+ BASS,
+ TREBLE,
+ SURROUND_SOUND_ENABLED,
+ EQUALIZER_DETAIL,
+ SPEAKERS_ENABLED,
+ SPEAKERS_DELAY_MS,
+ ENHANCED_AUDIO_RETURN_CHANNEL_ENABLED,
+ AUTO_VOLUME_CONTROL,
+ DOWNMIX_MODE,
+ DTS_DRC,
+ DOLBY_AUDIO_PROCESSING,
+ DOLBY_DIALOGUE_ENHANCER,
+ DTS_VIRTUAL_X,
+ DIGITAL_OUTPUT,
+ DIGITAL_OUTPUT_DELAY_MS,
+ SOUND_STYLE,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterRange.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterRange.aidl
new file mode 100644
index 0000000..66bc405
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/ParameterRange.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable ParameterRange {
+ android.hardware.tv.mediaquality.NumberRange numRange;
+ ParcelableHolder vendorDefinedValues;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureParameter.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureParameter.aidl
new file mode 100644
index 0000000..3a9e4e4
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureParameter.aidl
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+union PictureParameter {
+ float brightness;
+ int contrast;
+ int sharpness;
+ int saturation;
+ int hue;
+ int colorTunerBrightness;
+ int colorTunerSaturation;
+ int colorTunerHue;
+ int colorTunerRedOffset;
+ int colorTunerGreenOffset;
+ int colorTunerBlueOffset;
+ int colorTunerRedGain;
+ int colorTunerGreenGain;
+ int colorTunerBlueGain;
+ android.hardware.tv.mediaquality.QualityLevel noiseReduction;
+ android.hardware.tv.mediaquality.QualityLevel mpegNoiseReduction;
+ android.hardware.tv.mediaquality.QualityLevel fleshTone;
+ android.hardware.tv.mediaquality.QualityLevel deContour;
+ android.hardware.tv.mediaquality.QualityLevel dynamicLumaControl;
+ boolean filmMode;
+ boolean blueStretch;
+ boolean colorTune;
+ android.hardware.tv.mediaquality.ColorTemperature colorTemperature;
+ boolean globeDimming;
+ boolean autoPictureQualityEnabled;
+ boolean autoSuperResolutionEnabled;
+ android.hardware.tv.mediaquality.ColorRange levelRange;
+ boolean gamutMapping;
+ boolean pcMode;
+ boolean lowLatency;
+ boolean vrr;
+ boolean cvrr;
+ android.hardware.tv.mediaquality.ColorRange hdmiRgbRange;
+ android.hardware.tv.mediaquality.ColorSpace colorSpace;
+ int panelInitMaxLuminceNits;
+ boolean panelInitMaxLuminceValid;
+ android.hardware.tv.mediaquality.Gamma gamma;
+ int colorTemperatureRedGain;
+ int colorTemperatureGreenGain;
+ int colorTemperatureBlueGain;
+ int colorTemperatureRedOffset;
+ int colorTemperatureGreenOffset;
+ int colorTemperatureBlueOffset;
+ int[11] elevenPointRed;
+ int[11] elevenPointGreen;
+ int[11] elevenPointBlue;
+ android.hardware.tv.mediaquality.QualityLevel lowBlueLight;
+ android.hardware.tv.mediaquality.QualityLevel LdMode;
+ int osdRedGain;
+ int osdGreenGain;
+ int osdBlueGain;
+ int osdRedOffset;
+ int osdGreenOffset;
+ int osdBlueOffset;
+ int osdHue;
+ int osdSaturation;
+ int osdContrast;
+ boolean colorTunerSwitch;
+ int colorTunerHueRed;
+ int colorTunerHueGreen;
+ int colorTunerHueBlue;
+ int colorTunerHueCyan;
+ int colorTunerHueMagenta;
+ int colorTunerHueYellow;
+ int colorTunerHueFlesh;
+ int colorTunerSaturationRed;
+ int colorTunerSaturationGreen;
+ int colorTunerSaturationBlue;
+ int colorTunerSaturationCyan;
+ int colorTunerSaturationMagenta;
+ int colorTunerSaturationYellow;
+ int colorTunerSaturationFlesh;
+ int colorTunerLuminanceRed;
+ int colorTunerLuminanceGreen;
+ int colorTunerLuminanceBlue;
+ int colorTunerLuminanceCyan;
+ int colorTunerLuminanceMagenta;
+ int colorTunerLuminanceYellow;
+ int colorTunerLuminanceFlesh;
+ boolean activeProfile;
+ android.hardware.tv.mediaquality.PictureQualityEventType pictureQualityEventType;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureParameters.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureParameters.aidl
new file mode 100644
index 0000000..627369d
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureParameters.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable PictureParameters {
+ android.hardware.tv.mediaquality.PictureParameter[] pictureParameters;
+ ParcelableHolder vendorPictureParameters;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureProfile.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureProfile.aidl
new file mode 100644
index 0000000..ec2f9ff
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureProfile.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable PictureProfile {
+ long pictureProfileId;
+ android.hardware.tv.mediaquality.PictureParameters parameters;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureQualityEventType.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureQualityEventType.aidl
new file mode 100644
index 0000000..11001f6
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/PictureQualityEventType.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum PictureQualityEventType {
+ NONE,
+ BBD_RESULT,
+ VIDEO_DELAY_CHANGE,
+ CAPTUREPOINT_INFO_CHANGE,
+ VIDEOPATH_CHANGE,
+ EXTRA_FRAME_CHANGE,
+ DOLBY_IQ_CHANGE,
+ DOLBY_APO_CHANGE,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/QualityLevel.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/QualityLevel.aidl
new file mode 100644
index 0000000..a7f130f
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/QualityLevel.aidl
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum QualityLevel {
+ OFF,
+ LOW,
+ MEDIUM,
+ HIGH,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundParameter.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundParameter.aidl
new file mode 100644
index 0000000..8c0eaaf
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundParameter.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+union SoundParameter {
+ int balance;
+ int bass;
+ int treble;
+ boolean surroundSoundEnabled;
+ android.hardware.tv.mediaquality.EqualizerDetail equalizerDetail;
+ boolean speakersEnabled;
+ int speakersDelayMs;
+ boolean enhancedAudioReturnChannelEnabled;
+ boolean autoVolumeControl;
+ android.hardware.tv.mediaquality.DownmixMode downmixMode;
+ boolean dtsDrc;
+ @nullable android.hardware.tv.mediaquality.DolbyAudioProcessing dolbyAudioProcessing;
+ android.hardware.tv.mediaquality.QualityLevel dolbyDialogueEnhancer;
+ @nullable android.hardware.tv.mediaquality.DtsVirtualX dtsVirtualX;
+ android.hardware.tv.mediaquality.DigitalOutput digitalOutput;
+ int digitalOutputDelayMs;
+ boolean activeProfile;
+ android.hardware.tv.mediaquality.SoundStyle soundStyle;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundParameters.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundParameters.aidl
new file mode 100644
index 0000000..6492163
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundParameters.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable SoundParameters {
+ android.hardware.tv.mediaquality.SoundParameter[] soundParameters;
+ ParcelableHolder vendorSoundParameters;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundProfile.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundProfile.aidl
new file mode 100644
index 0000000..05f936f
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundProfile.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable SoundProfile {
+ long soundProfileId;
+ android.hardware.tv.mediaquality.SoundParameters parameters;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundStyle.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundStyle.aidl
new file mode 100644
index 0000000..1dbaf2c
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/SoundStyle.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum SoundStyle {
+ USER,
+ STANDARD,
+ VIVID,
+ SPORTS,
+ MOVIE,
+ MUSIC,
+ NEWS,
+ AUTO,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/StreamStatus.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/StreamStatus.aidl
new file mode 100644
index 0000000..23e584b
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/StreamStatus.aidl
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum StreamStatus {
+ SDR,
+ DOLBYVISION,
+ HDR10,
+ TCH,
+ HLG,
+ HDR10PLUS,
+ HDRVIVID,
+ IMAXSDR,
+ IMAXHDR10,
+ IMAXHDR10PLUS,
+ FMMSDR,
+ FMMHDR10,
+ FMMHDR10PLUS,
+ FMMHLG,
+ FMMDOLBY,
+ FMMTCH,
+ FMMHDRVIVID,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/VendorParamCapability.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/VendorParamCapability.aidl
new file mode 100644
index 0000000..5f16de9
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/VendorParamCapability.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable VendorParamCapability {
+ android.hardware.tv.mediaquality.VendorParameterIdentifier identifier;
+ boolean isSupported;
+ @nullable android.hardware.tv.mediaquality.ParameterDefaultValue defaultValue;
+ @nullable android.hardware.tv.mediaquality.ParameterRange range;
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl
new file mode 100644
index 0000000..016c22d
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/1/android/hardware/tv/mediaquality/VendorParameterIdentifier.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+parcelable VendorParameterIdentifier {
+ ParcelableHolder identifier;
+}
diff --git a/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs b/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
index 087730f..37f333a 100644
--- a/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
+++ b/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
@@ -62,15 +62,15 @@
pub fn new() -> Self {
Self {
callback: Arc::new(Mutex::new(None)),
- ambient_backlight_supported: Arc::new(Mutex::new(false)),
- ambient_backlight_enabled: Arc::new(Mutex::new(true)),
+ ambient_backlight_supported: Arc::new(Mutex::new(true)),
+ ambient_backlight_enabled: Arc::new(Mutex::new(false)),
ambient_backlight_detector_settings:
Arc::new(Mutex::new(AmbientBacklightSettings::default())),
- auto_pq_supported: Arc::new(Mutex::new(false)),
+ auto_pq_supported: Arc::new(Mutex::new(true)),
auto_pq_enabled: Arc::new(Mutex::new(false)),
- auto_sr_supported: Arc::new(Mutex::new(false)),
+ auto_sr_supported: Arc::new(Mutex::new(true)),
auto_sr_enabled: Arc::new(Mutex::new(false)),
- auto_aq_supported: Arc::new(Mutex::new(false)),
+ auto_aq_supported: Arc::new(Mutex::new(true)),
auto_aq_enabled: Arc::new(Mutex::new(false)),
picture_profile_adjustment_listener: Arc::new(Mutex::new(None)),
sound_profile_adjustment_listener: Arc::new(Mutex::new(None)),
@@ -236,7 +236,7 @@
fn getPictureProfileListener(&self) -> binder::Result<binder::Strong<dyn IPictureProfileChangedListener>> {
println!("getPictureProfileListener");
let listener = self.picture_profile_changed_listener.lock().unwrap();
- listener.clone().ok_or(binder::StatusCode::UNKNOWN_ERROR.into())
+ Ok(listener.clone().expect("NONE"))
}
fn setPictureProfileAdjustmentListener(
diff --git a/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp b/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
index a01d4b0..5d320d3 100644
--- a/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
+++ b/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
@@ -578,6 +578,18 @@
ASSERT_OK(mediaquality->setAmbientBacklightCallback(callback));
}
+TEST_P(MediaQualityAidl, TestGetPictureProfileChangedListener) {
+ std::shared_ptr<::aidl::android::hardware::tv::mediaquality::IPictureProfileChangedListener>
+ aidlListener;
+ mediaquality->getPictureProfileListener(&aidlListener);
+}
+
+TEST_P(MediaQualityAidl, TestGetSoundProfileChangedListener) {
+ std::shared_ptr<::aidl::android::hardware::tv::mediaquality::ISoundProfileChangedListener>
+ aidlListener;
+ mediaquality->getSoundProfileListener(&aidlListener);
+}
+
TEST_P(MediaQualityAidl, TestSetPictureProfileAdjustmentListener) {
std::shared_ptr<PictureProfileAdjustmentListener> listener =
ndk::SharedRefBase::make<PictureProfileAdjustmentListener>(
diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
index 56b8bb1..a172601 100644
--- a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
@@ -1016,6 +1016,10 @@
*/
TEST_P(WifiChipAidlTest, GetWifiChipCapabilities) {
WifiChipCapabilities chipCapabilities;
+ // STA iface needs to be configured for this test
+ auto iface = configureChipForStaAndGetIface();
+ ASSERT_NE(iface, nullptr);
+
auto status = wifi_chip_->getWifiChipCapabilities(&chipCapabilities);
if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
GTEST_SKIP() << "getWifiChipCapabilities() is not supported by vendor.";
@@ -1027,6 +1031,10 @@
* SetMloMode
*/
TEST_P(WifiChipAidlTest, SetMloMode) {
+ // STA iface needs to be configured for this test
+ auto iface = configureChipForStaAndGetIface();
+ ASSERT_NE(iface, nullptr);
+
auto status = wifi_chip_->setMloMode(IWifiChip::ChipMloMode::LOW_LATENCY);
if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
GTEST_SKIP() << "setMloMode() is not supported by vendor.";
@@ -1034,6 +1042,54 @@
EXPECT_TRUE(status.isOk());
}
+/*
+ * EnableDebugErrorAlerts
+ */
+TEST_P(WifiChipAidlTest, EnableDebugErrorAlerts) {
+ // STA iface needs to be configured for this test
+ auto iface = configureChipForStaAndGetIface();
+ ASSERT_NE(iface, nullptr);
+
+ auto status = wifi_chip_->enableDebugErrorAlerts(true);
+ if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
+ GTEST_SKIP() << "EnableDebugErrorAlerts is not supported by vendor";
+ }
+ EXPECT_TRUE(status.isOk());
+ EXPECT_TRUE(wifi_chip_->enableDebugErrorAlerts(false).isOk());
+}
+
+/*
+ * TriggerSubsystemRestart
+ */
+TEST_P(WifiChipAidlTest, TriggerSubsystemRestart) {
+ // STA iface needs to be configured for this test
+ auto iface = configureChipForStaAndGetIface();
+ ASSERT_NE(iface, nullptr);
+
+ auto status = wifi_chip_->triggerSubsystemRestart();
+ if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
+ GTEST_SKIP() << "TriggerSubsystemRestart is not supported by vendor";
+ }
+ EXPECT_TRUE(status.isOk());
+}
+
+/*
+ * EnableStaChannelForPeerNetwork
+ */
+TEST_P(WifiChipAidlTest, EnableStaChannelForPeerNetwork) {
+ // STA iface needs to be configured for this test
+ auto iface = configureChipForStaAndGetIface();
+ ASSERT_NE(iface, nullptr);
+
+ int categoryMask = (int)IWifiChip::ChannelCategoryMask::INDOOR_CHANNEL |
+ (int)IWifiChip::ChannelCategoryMask::DFS_CHANNEL;
+ auto status = wifi_chip_->enableStaChannelForPeerNetwork(categoryMask);
+ if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
+ GTEST_SKIP() << "EnableStaChannelForPeerNetwork is not supported by vendor";
+ }
+ EXPECT_TRUE(status.isOk());
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiChipAidlTest);
INSTANTIATE_TEST_SUITE_P(WifiTest, WifiChipAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)),
diff --git a/wifi/apex/Android.bp b/wifi/apex/Android.bp
index f8c8e6f..5052ebb 100644
--- a/wifi/apex/Android.bp
+++ b/wifi/apex/Android.bp
@@ -15,13 +15,6 @@
installable: false,
}
-prebuilt_etc {
- name: "com.android.hardware.wifi.xml",
- src: ":default-android.hardware.wifi-service.xml",
- installable: false,
- sub_dir: "vintf",
-}
-
apex {
name: "com.android.hardware.wifi",
manifest: "apex_manifest.json",
@@ -36,7 +29,6 @@
],
prebuilts: [
"com.android.hardware.wifi.rc",
- "com.android.hardware.wifi.xml",
],
overrides: [
"android.hardware.wifi-service",