File tree Expand file tree Collapse file tree
services/inputflinger/dispatcher/trace Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717#include " AndroidInputEventProtoConverter.h"
1818
19+ #include < android/input.h>
1920#include < android-base/logging.h>
21+ #include < input/Input.h>
2022#include < perfetto/trace/android/android_input_event.pbzero.h>
2123
2224namespace android ::inputdispatcher::trace {
@@ -67,6 +69,12 @@ void AndroidInputEventProtoConverter::toProtoMotionEvent(const TracedMotionEvent
6769
6870 const auto & coords = event.pointerCoords [i];
6971 auto bits = BitSet64 (coords.bits );
72+ if (isFromSource (event.source , AINPUT_SOURCE_CLASS_POINTER)) {
73+ // Always include the X and Y axes for pointer events, since the
74+ // bits will not be marked if the value is 0.
75+ bits.markBit (AMOTION_EVENT_AXIS_X);
76+ bits.markBit (AMOTION_EVENT_AXIS_Y);
77+ }
7078 for (int32_t axisIndex = 0 ; !bits.isEmpty (); axisIndex++) {
7179 const auto axis = bits.clearFirstMarkedBit ();
7280 auto axisEntry = pointer->add_axis_value ();
You can’t perform that action at this time.
0 commit comments