Remove PointerProperties::copyFrom
Remove copyFrom in favor of default-generated operator=.
Bug: 271455682
Test: m checkinput
Change-Id: Ie00d027bcbf0a994e04e6b79a107c32077c3a3d8
diff --git a/services/inputflinger/NotifyArgs.cpp b/services/inputflinger/NotifyArgs.cpp
index 0fa47d1..c34cd53 100644
--- a/services/inputflinger/NotifyArgs.cpp
+++ b/services/inputflinger/NotifyArgs.cpp
@@ -91,8 +91,8 @@
readTime(readTime),
videoFrames(videoFrames) {
for (uint32_t i = 0; i < pointerCount; i++) {
- this->pointerProperties.push_back(pointerProperties[i]);
- this->pointerCoords.push_back(pointerCoords[i]);
+ this->pointerProperties.emplace_back(pointerProperties[i]);
+ this->pointerCoords.emplace_back(pointerCoords[i]);
}
}
diff --git a/services/inputflinger/dispatcher/Entry.cpp b/services/inputflinger/dispatcher/Entry.cpp
index a670ebe..a0f0dcb 100644
--- a/services/inputflinger/dispatcher/Entry.cpp
+++ b/services/inputflinger/dispatcher/Entry.cpp
@@ -235,8 +235,8 @@
downTime(downTime),
pointerCount(pointerCount) {
for (uint32_t i = 0; i < pointerCount; i++) {
- this->pointerProperties[i].copyFrom(pointerProperties[i]);
- this->pointerCoords[i].copyFrom(pointerCoords[i]);
+ this->pointerProperties[i] = pointerProperties[i];
+ this->pointerCoords[i] = pointerCoords[i];
}
}
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index abb0610..1d9c5b4 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -4093,9 +4093,9 @@
uint32_t pointerId = uint32_t(pointerProperties.id);
if (pointerIds.test(pointerId)) {
splitPointerIndexMap[splitPointerCount] = originalPointerIndex;
- splitPointerProperties[splitPointerCount].copyFrom(pointerProperties);
- splitPointerCoords[splitPointerCount].copyFrom(
- originalMotionEntry.pointerCoords[originalPointerIndex]);
+ splitPointerProperties[splitPointerCount] = pointerProperties;
+ splitPointerCoords[splitPointerCount] =
+ originalMotionEntry.pointerCoords[originalPointerIndex];
splitPointerCount += 1;
}
}
diff --git a/services/inputflinger/dispatcher/InputState.cpp b/services/inputflinger/dispatcher/InputState.cpp
index 2fcb89a..fe0b89c 100644
--- a/services/inputflinger/dispatcher/InputState.cpp
+++ b/services/inputflinger/dispatcher/InputState.cpp
@@ -240,8 +240,8 @@
continue;
}
}
- pointerProperties[pointerCount].copyFrom(entry.pointerProperties[i]);
- pointerCoords[pointerCount].copyFrom(entry.pointerCoords[i]);
+ pointerProperties[pointerCount] = entry.pointerProperties[i];
+ pointerCoords[pointerCount] = entry.pointerCoords[i];
pointerCount++;
}
}
@@ -251,8 +251,8 @@
if (other.firstNewPointerIdx < 0) {
other.firstNewPointerIdx = other.pointerCount;
}
- other.pointerProperties[other.pointerCount].copyFrom(pointerProperties[i]);
- other.pointerCoords[other.pointerCount].copyFrom(pointerCoords[i]);
+ other.pointerProperties[other.pointerCount] = pointerProperties[i];
+ other.pointerCoords[other.pointerCount] = pointerCoords[i];
other.pointerCount++;
}
}
@@ -324,17 +324,16 @@
// We will deliver all pointers the target already knows about
for (uint32_t i = 0; i < static_cast<uint32_t>(memento.firstNewPointerIdx); i++) {
- pointerProperties[i].copyFrom(memento.pointerProperties[i]);
- pointerCoords[i].copyFrom(memento.pointerCoords[i]);
+ pointerProperties[i] = memento.pointerProperties[i];
+ pointerCoords[i] = memento.pointerCoords[i];
pointerCount++;
}
// We will send explicit events for all pointers the target doesn't know about
for (uint32_t i = static_cast<uint32_t>(memento.firstNewPointerIdx);
i < memento.pointerCount; i++) {
-
- pointerProperties[i].copyFrom(memento.pointerProperties[i]);
- pointerCoords[i].copyFrom(memento.pointerCoords[i]);
+ pointerProperties[i] = memento.pointerProperties[i];
+ pointerCoords[i] = memento.pointerCoords[i];
pointerCount++;
// Down only if the first pointer, pointer down otherwise
@@ -370,8 +369,8 @@
std::vector<PointerCoords> pointerCoords(MAX_POINTERS);
for (uint32_t pointerIdx = 0; pointerIdx < memento.pointerCount; pointerIdx++) {
uint32_t pointerId = uint32_t(memento.pointerProperties[pointerIdx].id);
- pointerProperties[pointerIdx].copyFrom(memento.pointerProperties[pointerIdx]);
- pointerCoords[pointerIdx].copyFrom(memento.pointerCoords[pointerIdx]);
+ pointerProperties[pointerIdx] = memento.pointerProperties[pointerIdx];
+ pointerCoords[pointerIdx] = memento.pointerCoords[pointerIdx];
if (pointerIds.test(pointerId)) {
canceledPointerIndices.push_back(pointerIdx);
}
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
index f48ff4c..b565454 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -2009,12 +2009,12 @@
PointerCoords& curOutCoords = outCoords[outIndex];
if (curInProperties != curOutProperties) {
- curOutProperties.copyFrom(curInProperties);
+ curOutProperties = curInProperties;
changed = true;
}
if (curInCoords != curOutCoords) {
- curOutCoords.copyFrom(curInCoords);
+ curOutCoords = curInCoords;
changed = true;
}
}
@@ -2756,10 +2756,9 @@
for (BitSet32 idBits(mPointerGesture.currentGestureIdBits); !idBits.isEmpty();) {
uint32_t id = idBits.clearFirstMarkedBit();
uint32_t index = mPointerGesture.currentGestureIdToIndex[id];
- mPointerGesture.lastGestureProperties[index].copyFrom(
- mPointerGesture.currentGestureProperties[index]);
- mPointerGesture.lastGestureCoords[index].copyFrom(
- mPointerGesture.currentGestureCoords[index]);
+ mPointerGesture.lastGestureProperties[index] =
+ mPointerGesture.currentGestureProperties[index];
+ mPointerGesture.lastGestureCoords[index] = mPointerGesture.currentGestureCoords[index];
mPointerGesture.lastGestureIdToIndex[id] = index;
}
}
@@ -3543,8 +3542,7 @@
std::tie(x, y) = mPointerController->getPosition();
}
- mPointerSimple.currentCoords.copyFrom(
- mCurrentCookedState.cookedPointerData.pointerCoords[index]);
+ mPointerSimple.currentCoords = mCurrentCookedState.cookedPointerData.pointerCoords[index];
mPointerSimple.currentCoords.setAxisValue(AMOTION_EVENT_AXIS_X, x);
mPointerSimple.currentCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, y);
mPointerSimple.currentProperties.id = 0;
@@ -3582,8 +3580,8 @@
const auto [x, y] = mPointerController->getPosition();
const uint32_t currentIndex = mCurrentRawState.rawPointerData.idToIndex[id];
- mPointerSimple.currentCoords.copyFrom(
- mCurrentCookedState.cookedPointerData.pointerCoords[currentIndex]);
+ mPointerSimple.currentCoords =
+ mCurrentCookedState.cookedPointerData.pointerCoords[currentIndex];
mPointerSimple.currentCoords.setAxisValue(AMOTION_EVENT_AXIS_X, x);
mPointerSimple.currentCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, y);
mPointerSimple.currentCoords.setAxisValue(AMOTION_EVENT_AXIS_PRESSURE,
@@ -3723,8 +3721,7 @@
mWheelXVelocityControl.move(when, &hscroll, nullptr);
// Send scroll.
- PointerCoords pointerCoords;
- pointerCoords.copyFrom(mPointerSimple.currentCoords);
+ PointerCoords pointerCoords = mPointerSimple.currentCoords;
pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_VSCROLL, vscroll);
pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_HSCROLL, hscroll);
@@ -3740,8 +3737,8 @@
// Save state.
if (down || hovering) {
- mPointerSimple.lastCoords.copyFrom(mPointerSimple.currentCoords);
- mPointerSimple.lastProperties.copyFrom(mPointerSimple.currentProperties);
+ mPointerSimple.lastCoords = mPointerSimple.currentCoords;
+ mPointerSimple.lastProperties = mPointerSimple.currentProperties;
mPointerSimple.displayId = displayId;
mPointerSimple.source = mSource;
mPointerSimple.lastCursorX = cursorPosition.x;
@@ -3795,8 +3792,8 @@
while (!idBits.isEmpty()) {
uint32_t id = idBits.clearFirstMarkedBit();
uint32_t index = idToIndex[id];
- pointerProperties[pointerCount].copyFrom(properties[index]);
- pointerCoords[pointerCount].copyFrom(coords[index]);
+ pointerProperties[pointerCount] = properties[index];
+ pointerCoords[pointerCount] = coords[index];
if (changedId >= 0 && id == uint32_t(changedId)) {
action |= pointerCount << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;