diff options
3 files changed, 11 insertions, 10 deletions
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 ae17c51ea2..1d81f7b602 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -80,8 +80,9 @@ class ComposerClientWriter { getDisplayCommand(display).colorTransformMatrix.emplace(std::move(matVec)); } - void setDisplayBrightness(int64_t display, float brightness) { - getDisplayCommand(display).brightness.emplace(DisplayBrightness{.brightness = brightness}); + void setDisplayBrightness(int64_t display, float brightness, float brightnessNits) { + getDisplayCommand(display).brightness.emplace( + DisplayBrightness{.brightness = brightness, .brightnessNits = brightnessNits}); } void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index 147a9eec82..c081199ba6 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -974,7 +974,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { // Preconditions to successfully run are knowing the max brightness and successfully applying // the max brightness ASSERT_GT(maxBrightnessNits, 0.f); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f, maxBrightnessNits); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 2d08ac611b..2cae5a2c93 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1374,7 +1374,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::BRIGHTNESS) != capabilities.end(); if (!brightnessSupport) { - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f, -1.f); execute(); const auto errors = mReader.takeErrors(); EXPECT_EQ(1, errors.size()); @@ -1383,23 +1383,23 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { return; } - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -1.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -1.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 2.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 2.0f, -1.f); execute(); { const auto errors = mReader.takeErrors(); @@ -1407,7 +1407,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); } - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -2.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -2.0f, -1.f); execute(); { const auto errors = mReader.takeErrors(); |