summaryrefslogtreecommitdiff
path: root/libs/input/Input.cpp
diff options
context:
space:
mode:
author Harry Cutts <hcutts@google.com> 2024-11-19 14:41:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-11-19 14:41:55 +0000
commit78a03d11689cdcc249573f5f78aef1dbc27ea970 (patch)
treeeaa41d87cafc4593d641cc9f67163169c1ad6ab9 /libs/input/Input.cpp
parentc34f5ddd94875d48f78504d3fe91b04a8cb5714c (diff)
parentffbd83c6226273ae00781f42e52f485d895ee864 (diff)
Merge "input: don't log the whole MotionEvent in index checks" into main
Diffstat (limited to 'libs/input/Input.cpp')
-rw-r--r--libs/input/Input.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/input/Input.cpp b/libs/input/Input.cpp
index a2bb3453fe..b87a7068b5 100644
--- a/libs/input/Input.cpp
+++ b/libs/input/Input.cpp
@@ -705,15 +705,17 @@ float MotionEvent::getAxisValue(int32_t axis, size_t pointerIndex) const {
const PointerCoords* MotionEvent::getHistoricalRawPointerCoords(
size_t pointerIndex, size_t historicalIndex) const {
if (CC_UNLIKELY(pointerIndex < 0 || pointerIndex >= getPointerCount())) {
- LOG(FATAL) << __func__ << ": Invalid pointer index " << pointerIndex << " for " << *this;
+ LOG(FATAL) << __func__ << ": Invalid pointer index " << pointerIndex
+ << "; should be between >0 and ≤" << getPointerCount();
}
if (CC_UNLIKELY(historicalIndex < 0 || historicalIndex > getHistorySize())) {
- LOG(FATAL) << __func__ << ": Invalid historical index " << historicalIndex << " for "
- << *this;
+ LOG(FATAL) << __func__ << ": Invalid historical index " << historicalIndex
+ << "; should be >0 and ≤" << getHistorySize();
}
const size_t position = historicalIndex * getPointerCount() + pointerIndex;
if (CC_UNLIKELY(position < 0 || position >= mSamplePointerCoords.size())) {
- LOG(FATAL) << __func__ << ": Invalid array index " << position << " for " << *this;
+ LOG(FATAL) << __func__ << ": Invalid array index " << position << "; should be >0 and ≤"
+ << mSamplePointerCoords.size();
}
return &mSamplePointerCoords[position];
}