Skip to content

Commit 78a03d1

Browse files
HarryCuttsAndroid (Google) Code Review
authored andcommitted
Merge "input: don't log the whole MotionEvent in index checks" into main
2 parents c34f5dd + ffbd83c commit 78a03d1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

libs/input/Input.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,15 +705,17 @@ float MotionEvent::getAxisValue(int32_t axis, size_t pointerIndex) const {
705705
const PointerCoords* MotionEvent::getHistoricalRawPointerCoords(
706706
size_t pointerIndex, size_t historicalIndex) const {
707707
if (CC_UNLIKELY(pointerIndex < 0 || pointerIndex >= getPointerCount())) {
708-
LOG(FATAL) << __func__ << ": Invalid pointer index " << pointerIndex << " for " << *this;
708+
LOG(FATAL) << __func__ << ": Invalid pointer index " << pointerIndex
709+
<< "; should be between >0 and ≤" << getPointerCount();
709710
}
710711
if (CC_UNLIKELY(historicalIndex < 0 || historicalIndex > getHistorySize())) {
711-
LOG(FATAL) << __func__ << ": Invalid historical index " << historicalIndex << " for "
712-
<< *this;
712+
LOG(FATAL) << __func__ << ": Invalid historical index " << historicalIndex
713+
<< "; should be >0 and ≤" << getHistorySize();
713714
}
714715
const size_t position = historicalIndex * getPointerCount() + pointerIndex;
715716
if (CC_UNLIKELY(position < 0 || position >= mSamplePointerCoords.size())) {
716-
LOG(FATAL) << __func__ << ": Invalid array index " << position << " for " << *this;
717+
LOG(FATAL) << __func__ << ": Invalid array index " << position << "; should be >0 and ≤"
718+
<< mSamplePointerCoords.size();
717719
}
718720
return &mSamplePointerCoords[position];
719721
}

0 commit comments

Comments
 (0)