Loading automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -326,6 +326,8 @@ const std::vector<ConfigDeclaration> kVehicleProperties = { .prop = toInt(VehicleProperty::EV_CHARGE_TIME_REMAINING), .prop = toInt(VehicleProperty::EV_CHARGE_TIME_REMAINING), .access = VehiclePropertyAccess::READ, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, }, }, .initialValue = {.int32Values = {20}}}, .initialValue = {.int32Values = {20}}}, Loading graphics/composer/aidl/vts/ReadbackVts.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -76,6 +76,7 @@ LayerSettings TestLayer::toRenderEngineLayerSettings() { layerSettings.alpha = ::android::half(mAlpha); layerSettings.alpha = ::android::half(mAlpha); layerSettings.disableBlending = mBlendMode == BlendMode::NONE; layerSettings.disableBlending = mBlendMode == BlendMode::NONE; layerSettings.source.buffer.isOpaque = mBlendMode == BlendMode::NONE; layerSettings.geometry.boundaries = ::android::FloatRect( layerSettings.geometry.boundaries = ::android::FloatRect( static_cast<float>(mDisplayFrame.left), static_cast<float>(mDisplayFrame.top), static_cast<float>(mDisplayFrame.left), static_cast<float>(mDisplayFrame.top), static_cast<float>(mDisplayFrame.right), static_cast<float>(mDisplayFrame.bottom)); static_cast<float>(mDisplayFrame.right), static_cast<float>(mDisplayFrame.bottom)); Loading graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -1132,8 +1132,8 @@ class GraphicsBlendModeCompositionTest Color mBackgroundColor; Color mBackgroundColor; Color mTopLayerColor; Color mTopLayerColor; }; }; // TODO(b/219576457) Enable tests once we have fixed the bug on composer. TEST_P(GraphicsBlendModeCompositionTest, DISABLED_None) { TEST_P(GraphicsBlendModeCompositionTest, None) { for (ColorMode mode : mTestColorModes) { for (ColorMode mode : mTestColorModes) { EXPECT_TRUE(mComposerClient EXPECT_TRUE(mComposerClient ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) Loading power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp +47 −12 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,11 @@ class PowerStatsAidl : public testing::TestWithParam<std::string> { template <typename T, typename S, typename R> template <typename T, typename S, typename R> void testMatching(std::vector<T> const& c1, R T::*f1, std::vector<S> const& c2, R S::*f2); void testMatching(std::vector<T> const& c1, R T::*f1, std::vector<S> const& c2, R S::*f2); bool containsTimedEntity(const std::string& str); void excludeTimedEntities(std::vector<PowerEntity>* entities, std::vector<StateResidencyResult>* results); std::shared_ptr<IPowerStats> powerstats; std::shared_ptr<IPowerStats> powerstats; }; }; Loading Loading @@ -111,6 +116,29 @@ void PowerStatsAidl::testMatching(std::vector<T> const& c1, R T::*f1, std::vecto EXPECT_EQ(c1fields, c2fields); EXPECT_EQ(c1fields, c2fields); } } bool PowerStatsAidl::containsTimedEntity(const std::string& str) { // TODO(b/229698505): Extend PowerEntityInfo to identify timed power entity return str.find("AoC") != std::string::npos; } void PowerStatsAidl::excludeTimedEntities(std::vector<PowerEntity>* entities, std::vector<StateResidencyResult>* results) { for (auto it = entities->begin(); it != entities->end(); it++) { if (containsTimedEntity((*it).name)) { auto entityId = (*it).id; entities->erase(it--); // Erase result element matching the entity ID for (auto resultsIt = results->begin(); resultsIt != results->end(); resultsIt++) { if ((*resultsIt).id == entityId) { results->erase(resultsIt--); break; } } } } } // Each PowerEntity must have a valid name // Each PowerEntity must have a valid name TEST_P(PowerStatsAidl, ValidatePowerEntityNames) { TEST_P(PowerStatsAidl, ValidatePowerEntityNames) { std::vector<PowerEntity> infos; std::vector<PowerEntity> infos; Loading Loading @@ -185,19 +213,20 @@ TEST_P(PowerStatsAidl, TestGetStateResidency) { ASSERT_OK(powerstats->getStateResidency({}, &results)); ASSERT_OK(powerstats->getStateResidency({}, &results)); } } // State residency must return all results // State residency must return all results except timed power entities TEST_P(PowerStatsAidl, TestGetStateResidencyAllResults) { TEST_P(PowerStatsAidl, TestGetStateResidencyAllResultsExceptTimedEntities) { std::vector<PowerEntity> entities; std::vector<PowerEntity> entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); std::vector<StateResidencyResult> results; std::vector<StateResidencyResult> results; ASSERT_OK(powerstats->getStateResidency({}, &results)); ASSERT_OK(powerstats->getStateResidency({}, &results)); excludeTimedEntities(&entities, &results); testMatching(entities, &PowerEntity::id, results, &StateResidencyResult::id); testMatching(entities, &PowerEntity::id, results, &StateResidencyResult::id); } } // Each result must contain all state residencies // Each result must contain all state residencies except timed power entities TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidencies) { TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidenciesExceptTimedEntities) { std::vector<PowerEntity> entities; std::vector<PowerEntity> entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); Loading @@ -205,6 +234,7 @@ TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidencies) { ASSERT_OK(powerstats->getStateResidency({}, &results)); ASSERT_OK(powerstats->getStateResidency({}, &results)); for (auto entity : entities) { for (auto entity : entities) { if (!containsTimedEntity(entity.name)) { auto it = std::find_if(results.begin(), results.end(), auto it = std::find_if(results.begin(), results.end(), [&entity](const auto& x) { return x.id == entity.id; }); [&entity](const auto& x) { return x.id == entity.id; }); ASSERT_NE(it, results.end()); ASSERT_NE(it, results.end()); Loading @@ -212,9 +242,10 @@ TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidencies) { testMatching(entity.states, &State::id, it->stateResidencyData, &StateResidency::id); testMatching(entity.states, &State::id, it->stateResidencyData, &StateResidency::id); } } } } } // State residency must return results for each requested power entity // State residency must return results for each requested power entity except timed power entities TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResults) { TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResultsExceptTimedEntities) { std::vector<PowerEntity> entities; std::vector<PowerEntity> entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); if (entities.empty()) { if (entities.empty()) { Loading @@ -223,8 +254,12 @@ TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResults) { std::vector<PowerEntity> selectedEntities = getRandomSubset(entities); std::vector<PowerEntity> selectedEntities = getRandomSubset(entities); std::vector<int32_t> selectedIds; std::vector<int32_t> selectedIds; for (auto const& entity : selectedEntities) { for (auto it = selectedEntities.begin(); it != selectedEntities.end(); it++) { selectedIds.push_back(entity.id); if (!containsTimedEntity((*it).name)) { selectedIds.push_back((*it).id); } else { selectedEntities.erase(it--); } } } std::vector<StateResidencyResult> selectedResults; std::vector<StateResidencyResult> selectedResults; Loading Loading
automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -326,6 +326,8 @@ const std::vector<ConfigDeclaration> kVehicleProperties = { .prop = toInt(VehicleProperty::EV_CHARGE_TIME_REMAINING), .prop = toInt(VehicleProperty::EV_CHARGE_TIME_REMAINING), .access = VehiclePropertyAccess::READ, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, }, }, .initialValue = {.int32Values = {20}}}, .initialValue = {.int32Values = {20}}}, Loading
graphics/composer/aidl/vts/ReadbackVts.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -76,6 +76,7 @@ LayerSettings TestLayer::toRenderEngineLayerSettings() { layerSettings.alpha = ::android::half(mAlpha); layerSettings.alpha = ::android::half(mAlpha); layerSettings.disableBlending = mBlendMode == BlendMode::NONE; layerSettings.disableBlending = mBlendMode == BlendMode::NONE; layerSettings.source.buffer.isOpaque = mBlendMode == BlendMode::NONE; layerSettings.geometry.boundaries = ::android::FloatRect( layerSettings.geometry.boundaries = ::android::FloatRect( static_cast<float>(mDisplayFrame.left), static_cast<float>(mDisplayFrame.top), static_cast<float>(mDisplayFrame.left), static_cast<float>(mDisplayFrame.top), static_cast<float>(mDisplayFrame.right), static_cast<float>(mDisplayFrame.bottom)); static_cast<float>(mDisplayFrame.right), static_cast<float>(mDisplayFrame.bottom)); Loading
graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -1132,8 +1132,8 @@ class GraphicsBlendModeCompositionTest Color mBackgroundColor; Color mBackgroundColor; Color mTopLayerColor; Color mTopLayerColor; }; }; // TODO(b/219576457) Enable tests once we have fixed the bug on composer. TEST_P(GraphicsBlendModeCompositionTest, DISABLED_None) { TEST_P(GraphicsBlendModeCompositionTest, None) { for (ColorMode mode : mTestColorModes) { for (ColorMode mode : mTestColorModes) { EXPECT_TRUE(mComposerClient EXPECT_TRUE(mComposerClient ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) Loading
power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp +47 −12 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,11 @@ class PowerStatsAidl : public testing::TestWithParam<std::string> { template <typename T, typename S, typename R> template <typename T, typename S, typename R> void testMatching(std::vector<T> const& c1, R T::*f1, std::vector<S> const& c2, R S::*f2); void testMatching(std::vector<T> const& c1, R T::*f1, std::vector<S> const& c2, R S::*f2); bool containsTimedEntity(const std::string& str); void excludeTimedEntities(std::vector<PowerEntity>* entities, std::vector<StateResidencyResult>* results); std::shared_ptr<IPowerStats> powerstats; std::shared_ptr<IPowerStats> powerstats; }; }; Loading Loading @@ -111,6 +116,29 @@ void PowerStatsAidl::testMatching(std::vector<T> const& c1, R T::*f1, std::vecto EXPECT_EQ(c1fields, c2fields); EXPECT_EQ(c1fields, c2fields); } } bool PowerStatsAidl::containsTimedEntity(const std::string& str) { // TODO(b/229698505): Extend PowerEntityInfo to identify timed power entity return str.find("AoC") != std::string::npos; } void PowerStatsAidl::excludeTimedEntities(std::vector<PowerEntity>* entities, std::vector<StateResidencyResult>* results) { for (auto it = entities->begin(); it != entities->end(); it++) { if (containsTimedEntity((*it).name)) { auto entityId = (*it).id; entities->erase(it--); // Erase result element matching the entity ID for (auto resultsIt = results->begin(); resultsIt != results->end(); resultsIt++) { if ((*resultsIt).id == entityId) { results->erase(resultsIt--); break; } } } } } // Each PowerEntity must have a valid name // Each PowerEntity must have a valid name TEST_P(PowerStatsAidl, ValidatePowerEntityNames) { TEST_P(PowerStatsAidl, ValidatePowerEntityNames) { std::vector<PowerEntity> infos; std::vector<PowerEntity> infos; Loading Loading @@ -185,19 +213,20 @@ TEST_P(PowerStatsAidl, TestGetStateResidency) { ASSERT_OK(powerstats->getStateResidency({}, &results)); ASSERT_OK(powerstats->getStateResidency({}, &results)); } } // State residency must return all results // State residency must return all results except timed power entities TEST_P(PowerStatsAidl, TestGetStateResidencyAllResults) { TEST_P(PowerStatsAidl, TestGetStateResidencyAllResultsExceptTimedEntities) { std::vector<PowerEntity> entities; std::vector<PowerEntity> entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); std::vector<StateResidencyResult> results; std::vector<StateResidencyResult> results; ASSERT_OK(powerstats->getStateResidency({}, &results)); ASSERT_OK(powerstats->getStateResidency({}, &results)); excludeTimedEntities(&entities, &results); testMatching(entities, &PowerEntity::id, results, &StateResidencyResult::id); testMatching(entities, &PowerEntity::id, results, &StateResidencyResult::id); } } // Each result must contain all state residencies // Each result must contain all state residencies except timed power entities TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidencies) { TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidenciesExceptTimedEntities) { std::vector<PowerEntity> entities; std::vector<PowerEntity> entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); Loading @@ -205,6 +234,7 @@ TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidencies) { ASSERT_OK(powerstats->getStateResidency({}, &results)); ASSERT_OK(powerstats->getStateResidency({}, &results)); for (auto entity : entities) { for (auto entity : entities) { if (!containsTimedEntity(entity.name)) { auto it = std::find_if(results.begin(), results.end(), auto it = std::find_if(results.begin(), results.end(), [&entity](const auto& x) { return x.id == entity.id; }); [&entity](const auto& x) { return x.id == entity.id; }); ASSERT_NE(it, results.end()); ASSERT_NE(it, results.end()); Loading @@ -212,9 +242,10 @@ TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidencies) { testMatching(entity.states, &State::id, it->stateResidencyData, &StateResidency::id); testMatching(entity.states, &State::id, it->stateResidencyData, &StateResidency::id); } } } } } // State residency must return results for each requested power entity // State residency must return results for each requested power entity except timed power entities TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResults) { TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResultsExceptTimedEntities) { std::vector<PowerEntity> entities; std::vector<PowerEntity> entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); if (entities.empty()) { if (entities.empty()) { Loading @@ -223,8 +254,12 @@ TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResults) { std::vector<PowerEntity> selectedEntities = getRandomSubset(entities); std::vector<PowerEntity> selectedEntities = getRandomSubset(entities); std::vector<int32_t> selectedIds; std::vector<int32_t> selectedIds; for (auto const& entity : selectedEntities) { for (auto it = selectedEntities.begin(); it != selectedEntities.end(); it++) { selectedIds.push_back(entity.id); if (!containsTimedEntity((*it).name)) { selectedIds.push_back((*it).id); } else { selectedEntities.erase(it--); } } } std::vector<StateResidencyResult> selectedResults; std::vector<StateResidencyResult> selectedResults; Loading