Loading services/inputflinger/dispatcher/trace/AndroidInputEventProtoConverter.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ #include "AndroidInputEventProtoConverter.h" #include <android/input.h> #include <android-base/logging.h> #include <input/Input.h> #include <perfetto/trace/android/android_input_event.pbzero.h> namespace android::inputdispatcher::trace { Loading Loading @@ -67,6 +69,12 @@ void AndroidInputEventProtoConverter::toProtoMotionEvent(const TracedMotionEvent const auto& coords = event.pointerCoords[i]; auto bits = BitSet64(coords.bits); if (isFromSource(event.source, AINPUT_SOURCE_CLASS_POINTER)) { // Always include the X and Y axes for pointer events, since the // bits will not be marked if the value is 0. bits.markBit(AMOTION_EVENT_AXIS_X); bits.markBit(AMOTION_EVENT_AXIS_Y); } for (int32_t axisIndex = 0; !bits.isEmpty(); axisIndex++) { const auto axis = bits.clearFirstMarkedBit(); auto axisEntry = pointer->add_axis_value(); Loading Loading
services/inputflinger/dispatcher/trace/AndroidInputEventProtoConverter.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ #include "AndroidInputEventProtoConverter.h" #include <android/input.h> #include <android-base/logging.h> #include <input/Input.h> #include <perfetto/trace/android/android_input_event.pbzero.h> namespace android::inputdispatcher::trace { Loading Loading @@ -67,6 +69,12 @@ void AndroidInputEventProtoConverter::toProtoMotionEvent(const TracedMotionEvent const auto& coords = event.pointerCoords[i]; auto bits = BitSet64(coords.bits); if (isFromSource(event.source, AINPUT_SOURCE_CLASS_POINTER)) { // Always include the X and Y axes for pointer events, since the // bits will not be marked if the value is 0. bits.markBit(AMOTION_EVENT_AXIS_X); bits.markBit(AMOTION_EVENT_AXIS_Y); } for (int32_t axisIndex = 0; !bits.isEmpty(); axisIndex++) { const auto axis = bits.clearFirstMarkedBit(); auto axisEntry = pointer->add_axis_value(); Loading