Merge changes from topic "supportedvalueinfo" into main
* changes:
Add config check for require_min_max_value.
Use parameterized test to auto generate config test.
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..0d4c74e 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()) {
@@ -1255,6 +1263,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 +1276,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 +1391,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/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..53e5e99 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",
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..a7ecb36 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
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/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
index 3e18de2..2474916 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
@@ -394,7 +394,8 @@
void AudioSetConfigurationProviderJson::populateAseConfiguration(
const std::string& name, 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 +411,7 @@
case le_audio::AudioSetConfigurationTargetLatency::
AudioSetConfigurationTargetLatency_LOW:
ase.targetLatency = LeAudioAseConfiguration::TargetLatency::LOWER;
+ configurationFlags.bitmask |= ConfigurationFlags::LOW_LATENCY;
break;
default:
ase.targetLatency = LeAudioAseConfiguration::TargetLatency::UNDEFINED;
@@ -507,7 +509,8 @@
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 +518,8 @@
LeAudioDataPathConfiguration path;
// Translate into LeAudioAseConfiguration
- populateAseConfiguration(name, ase, flat_subconfig, qos_cfg);
+ populateAseConfiguration(name, ase, flat_subconfig, qos_cfg,
+ configurationFlags);
// Translate into LeAudioAseQosConfiguration
populateAseQosConfiguration(qos, qos_cfg, ase,
@@ -554,10 +558,10 @@
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(name, subconfig, qos_cfg,
+ location, configurationFlags);
directionAseConfiguration.push_back(config);
// Put the same setting again.
if (ase_cnt == 2) directionAseConfiguration.push_back(config);
@@ -643,10 +647,10 @@
for (auto subconfig : *codec_cfg->subconfigurations()) {
if (subconfig->direction() == kLeAudioDirectionSink) {
processSubconfig(flat_cfg->name()->str(), subconfig, qos_sink_cfg,
- sinkAseConfiguration, location);
+ sinkAseConfiguration, location, configurationFlags);
} else {
processSubconfig(flat_cfg->name()->str(), subconfig, qos_source_cfg,
- sourceAseConfiguration, location);
+ sourceAseConfiguration, location, configurationFlags);
}
}
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.h b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.h
index fac6152..8e12618 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.h
@@ -75,7 +75,8 @@
static void populateAseConfiguration(
const std::string& name, 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,
@@ -85,7 +86,8 @@
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,
@@ -93,7 +95,7 @@
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/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/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
index dff044d..11452eb 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -92,7 +92,9 @@
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;
+ displayWriters.emplace(getPrimaryDisplayId(), mWriter.get());
+ ASSERT_TRUE(mComposerClient->tearDown(displayWriters));
mComposerClient.reset();
const auto errors = mReader.takeErrors();
ASSERT_TRUE(mReader.takeErrors().empty());
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 88e5cb5..2ff3b2b 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(display.getDisplayId()).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/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..c6b2579 100644
--- a/radio/aidl/vts/radio_modem_test.cpp
+++ b/radio/aidl/vts/radio_modem_test.cpp
@@ -220,13 +220,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);
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 2b4dc42..5529b7e 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -1065,7 +1065,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,
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/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/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/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/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",