mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 05:49:27 +00:00
Merge "automotive: Remove unnecessary std::move" into main am: c9777e83a1 am: bd4f0e7ad3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3217719 Change-Id: Ia610e32846f69730d3ed095bbef6d508e55ea3e3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -495,7 +495,7 @@ unsigned EvsCamera::increaseAvailableFrames_Locked(unsigned numToAdd) {
|
||||
}
|
||||
if (!stored) {
|
||||
// Add a BufferRecord wrapping this handle to our set of available buffers
|
||||
mBuffers.push_back(std::move(BufferRecord(memHandle)));
|
||||
mBuffers.push_back(BufferRecord(memHandle));
|
||||
}
|
||||
|
||||
mFramesAllowed++;
|
||||
|
||||
@@ -199,8 +199,8 @@ size_t ConfigManager::readCameraCapabilities(const XMLElement* const aCapElem, C
|
||||
|
||||
CameraParam aParam;
|
||||
if (ConfigManagerUtil::convertToEvsCameraParam(nameAttr, aParam)) {
|
||||
aCamera->controls.insert_or_assign(
|
||||
aParam, std::move(std::make_tuple(minVal, maxVal, stepVal)));
|
||||
aCamera->controls.insert_or_assign(aParam,
|
||||
std::make_tuple(minVal, maxVal, stepVal));
|
||||
}
|
||||
|
||||
ctrlElem = ctrlElem->NextSiblingElement("control");
|
||||
@@ -583,8 +583,8 @@ bool ConfigManager::readConfigDataFromBinary() {
|
||||
CameraCtrl* ptr = reinterpret_cast<CameraCtrl*>(p);
|
||||
for (size_t idx = 0; idx < sz; ++idx) {
|
||||
CameraCtrl temp = *ptr++;
|
||||
aCamera->controls.insert_or_assign(
|
||||
temp.cid, std::move(std::make_tuple(temp.min, temp.max, temp.step)));
|
||||
aCamera->controls.insert_or_assign(temp.cid,
|
||||
std::make_tuple(temp.min, temp.max, temp.step));
|
||||
}
|
||||
p = reinterpret_cast<char*>(ptr);
|
||||
|
||||
@@ -689,8 +689,8 @@ bool ConfigManager::readConfigDataFromBinary() {
|
||||
CameraCtrl* ptr = reinterpret_cast<CameraCtrl*>(p);
|
||||
for (size_t idx = 0; idx < sz; ++idx) {
|
||||
CameraCtrl temp = *ptr++;
|
||||
aCamera->controls.insert_or_assign(
|
||||
temp.cid, std::move(std::make_tuple(temp.min, temp.max, temp.step)));
|
||||
aCamera->controls.insert_or_assign(temp.cid,
|
||||
std::make_tuple(temp.min, temp.max, temp.step));
|
||||
}
|
||||
p = reinterpret_cast<char*>(ptr);
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ ScopedAStatus EvsGlDisplay::getTargetBuffer(BufferDesc* _aidl_return) {
|
||||
.buffer =
|
||||
{
|
||||
.description = mBuffer.description,
|
||||
.handle = std::move(::android::dupToAidl(mBuffer.handle)),
|
||||
.handle = ::android::dupToAidl(mBuffer.handle),
|
||||
},
|
||||
.pixelSizeBytes = 4, // RGBA_8888 is 4-byte-per-pixel format
|
||||
.bufferId = mBuffer.fingerprint,
|
||||
|
||||
@@ -50,12 +50,12 @@ NativeHandle dupNativeHandle(const NativeHandle& handle, bool doDup) {
|
||||
}
|
||||
} else {
|
||||
for (auto i = 0; i < handle.fds.size(); ++i) {
|
||||
dup.fds[i] = std::move(handle.fds[i].dup());
|
||||
dup.fds[i] = handle.fds[i].dup();
|
||||
}
|
||||
}
|
||||
dup.ints = handle.ints;
|
||||
|
||||
return std::move(dup);
|
||||
return dup;
|
||||
}
|
||||
|
||||
HardwareBuffer dupHardwareBuffer(const HardwareBuffer& buffer, bool doDup) {
|
||||
@@ -64,7 +64,7 @@ HardwareBuffer dupHardwareBuffer(const HardwareBuffer& buffer, bool doDup) {
|
||||
.handle = dupNativeHandle(buffer.handle, doDup),
|
||||
};
|
||||
|
||||
return std::move(dup);
|
||||
return dup;
|
||||
}
|
||||
|
||||
BufferDesc dupBufferDesc(const BufferDesc& src, bool doDup) {
|
||||
@@ -77,7 +77,7 @@ BufferDesc dupBufferDesc(const BufferDesc& src, bool doDup) {
|
||||
.metadata = src.metadata,
|
||||
};
|
||||
|
||||
return std::move(dup);
|
||||
return dup;
|
||||
}
|
||||
|
||||
bool comparePayload(const EvsEventDesc& l, const EvsEventDesc& r) {
|
||||
|
||||
@@ -583,12 +583,12 @@ std::vector<std::string> VehicleHalManager::getOptionValues(const hidl_vec<hidl_
|
||||
while (*index < options.size()) {
|
||||
std::string option = options[*index];
|
||||
if (kSetPropOptions.find(option) != kSetPropOptions.end()) {
|
||||
return std::move(values);
|
||||
return values;
|
||||
}
|
||||
values.push_back(option);
|
||||
(*index)++;
|
||||
}
|
||||
return std::move(values);
|
||||
return values;
|
||||
}
|
||||
|
||||
bool VehicleHalManager::parseSetPropOptions(int fd, const hidl_vec<hidl_string>& options,
|
||||
|
||||
@@ -509,7 +509,7 @@ IVehicleServer::DumpResult DefaultVehicleHalServer::setValueCommand(
|
||||
int64_t timestamp;
|
||||
int32_t areaId = 0;
|
||||
if (options[1] == "--setint") {
|
||||
updatedPropValue = std::move(createVehiclePropValue(VehiclePropertyType::INT32, 1));
|
||||
updatedPropValue = createVehiclePropValue(VehiclePropertyType::INT32, 1);
|
||||
if (!android::base::ParseInt(options[3], &intValue)) {
|
||||
result.buffer += "failed to parse value as int: \"" + options[3] + "\"\n";
|
||||
result.buffer += getHelpInfo();
|
||||
@@ -517,7 +517,7 @@ IVehicleServer::DumpResult DefaultVehicleHalServer::setValueCommand(
|
||||
}
|
||||
updatedPropValue->value.int32Values[0] = intValue;
|
||||
} else if (options[1] == "--setbool") {
|
||||
updatedPropValue = std::move(createVehiclePropValue(VehiclePropertyType::BOOLEAN, 1));
|
||||
updatedPropValue = createVehiclePropValue(VehiclePropertyType::BOOLEAN, 1);
|
||||
if (options[3] == "true" || options[3] == "True") {
|
||||
updatedPropValue->value.int32Values[0] = 1;
|
||||
} else if (options[3] == "false" || options[3] == "False") {
|
||||
@@ -529,7 +529,7 @@ IVehicleServer::DumpResult DefaultVehicleHalServer::setValueCommand(
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
updatedPropValue = std::move(createVehiclePropValue(VehiclePropertyType::FLOAT, 1));
|
||||
updatedPropValue = createVehiclePropValue(VehiclePropertyType::FLOAT, 1);
|
||||
if (!android::base::ParseFloat(options[3], &floatValue)) {
|
||||
result.buffer += "failed to parse value as float: \"" + options[3] + "\"\n";
|
||||
result.buffer += getHelpInfo();
|
||||
|
||||
@@ -1871,7 +1871,7 @@ TEST_F(FakeVehicleHardwareTest, testSetVehicleMapService) {
|
||||
|
||||
TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) {
|
||||
FakeVehicleHardwareTestHelper helper(getHardware());
|
||||
auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON)));
|
||||
auto hvacPowerOnConfig = getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON));
|
||||
EXPECT_NE(hvacPowerOnConfig, nullptr);
|
||||
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
|
||||
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
|
||||
@@ -1882,7 +1882,7 @@ TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) {
|
||||
EXPECT_EQ(status, StatusCode::OK);
|
||||
|
||||
for (auto& powerPropId : helper.getHvacPowerDependentProps()) {
|
||||
auto powerPropConfig = std::move(getVehiclePropConfig(powerPropId));
|
||||
auto powerPropConfig = getVehiclePropConfig(powerPropId);
|
||||
EXPECT_NE(powerPropConfig, nullptr);
|
||||
if (powerPropConfig->access == VehiclePropertyAccess::WRITE) {
|
||||
continue;
|
||||
@@ -1918,7 +1918,7 @@ TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) {
|
||||
|
||||
TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) {
|
||||
FakeVehicleHardwareTestHelper helper(getHardware());
|
||||
auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON)));
|
||||
auto hvacPowerOnConfig = getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON));
|
||||
EXPECT_NE(hvacPowerOnConfig, nullptr);
|
||||
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
|
||||
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
|
||||
@@ -1929,7 +1929,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) {
|
||||
EXPECT_EQ(status, StatusCode::OK);
|
||||
|
||||
for (auto& powerPropId : helper.getHvacPowerDependentProps()) {
|
||||
auto powerPropConfig = std::move(getVehiclePropConfig(powerPropId));
|
||||
auto powerPropConfig = getVehiclePropConfig(powerPropId);
|
||||
EXPECT_NE(powerPropConfig, nullptr);
|
||||
if (powerPropConfig->access == VehiclePropertyAccess::READ) {
|
||||
continue;
|
||||
@@ -1968,7 +1968,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) {
|
||||
|
||||
TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) {
|
||||
FakeVehicleHardwareTestHelper helper(getHardware());
|
||||
auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON)));
|
||||
auto hvacPowerOnConfig = getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON));
|
||||
EXPECT_NE(hvacPowerOnConfig, nullptr);
|
||||
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
|
||||
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
|
||||
@@ -2007,9 +2007,9 @@ TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) {
|
||||
}
|
||||
|
||||
TEST_F(FakeVehicleHardwareTest, testHvacDualOnSynchronizesTemp) {
|
||||
auto hvacDualOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_DUAL_ON)));
|
||||
auto hvacDualOnConfig = getVehiclePropConfig(toInt(VehicleProperty::HVAC_DUAL_ON));
|
||||
auto hvacTemperatureSetConfig =
|
||||
std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET)));
|
||||
getVehiclePropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET));
|
||||
EXPECT_NE(hvacDualOnConfig, nullptr);
|
||||
EXPECT_NE(hvacTemperatureSetConfig, nullptr);
|
||||
for (auto& hvacTemperatureSetConfig : hvacTemperatureSetConfig->areaConfigs) {
|
||||
@@ -3605,7 +3605,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) {
|
||||
// Config array values from HVAC_TEMPERATURE_SET in DefaultProperties.json
|
||||
auto configs = getHardware()->getAllPropertyConfigs();
|
||||
auto hvacTemperatureSetConfig =
|
||||
std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET)));
|
||||
getVehiclePropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET));
|
||||
EXPECT_NE(hvacTemperatureSetConfig, nullptr);
|
||||
|
||||
auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfig->configArray;
|
||||
|
||||
@@ -289,7 +289,7 @@ std::vector<VehiclePropValuePool::RecyclableType> VehiclePropertyStore::readAllV
|
||||
|
||||
for (auto const& [_, record] : mRecordsByPropId) {
|
||||
for (auto const& [_, value] : record.values) {
|
||||
allValues.push_back(std::move(mValuePool->obtain(*value)));
|
||||
allValues.push_back(mValuePool->obtain(*value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ VehiclePropertyStore::ValuesResultType VehiclePropertyStore::readValuesForProper
|
||||
}
|
||||
|
||||
for (auto const& [_, value] : record->values) {
|
||||
values.push_back(std::move(mValuePool->obtain(*value)));
|
||||
values.push_back(mValuePool->obtain(*value));
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ TEST_F(VehiclePropertyStoreTest, testRemoveValue) {
|
||||
TEST_F(VehiclePropertyStoreTest, testRemoveValuesForProperty) {
|
||||
auto values = getTestPropValues();
|
||||
for (const auto& value : values) {
|
||||
ASSERT_RESULT_OK(mStore->writeValue(std::move(mValuePool->obtain(value))));
|
||||
ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(value)));
|
||||
}
|
||||
|
||||
mStore->removeValuesForProperty(toInt(VehicleProperty::INFO_FUEL_CAPACITY));
|
||||
|
||||
@@ -95,7 +95,7 @@ class VtsVehicleCallback final : public ISubscriptionCallback {
|
||||
std::lock_guard<std::mutex> lockGuard(mLock);
|
||||
for (auto& value : values) {
|
||||
int32_t propId = value->getPropId();
|
||||
mEvents[propId].push_back(std::move(value->clone()));
|
||||
mEvents[propId].push_back(value->clone());
|
||||
}
|
||||
}
|
||||
mEventCond.notify_one();
|
||||
@@ -122,7 +122,7 @@ class VtsVehicleCallback final : public ISubscriptionCallback {
|
||||
return events;
|
||||
}
|
||||
for (const auto& eventPtr : mEvents[propId]) {
|
||||
events.push_back(std::move(eventPtr->clone()));
|
||||
events.push_back(eventPtr->clone());
|
||||
}
|
||||
return events;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user