Loading include/input/InputDevice.h +2 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,8 @@ enum class InputDeviceSensorAccuracy : int32_t { ACCURACY_LOW = 1, ACCURACY_MEDIUM = 2, ACCURACY_HIGH = 3, ftl_last = ACCURACY_HIGH, }; enum class InputDeviceSensorReportingMode : int32_t { Loading libs/input/InputTransport.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -387,9 +387,9 @@ status_t InputChannel::openInputChannelPair(const std::string& name, status_t InputChannel::sendMessage(const InputMessage* msg) { ATRACE_NAME_IF(ATRACE_ENABLED(), StringPrintf("sendMessage(inputChannel=%s, seq=0x%" PRIx32 ", type=0x%" PRIx32 ")", name.c_str(), msg->header.seq, msg->header.type)); StringPrintf("sendMessage(inputChannel=%s, seq=0x%" PRIx32 ", type=%s)", name.c_str(), msg->header.seq, ftl::enum_string(msg->header.type).c_str())); const size_t msgLength = msg->size(); InputMessage cleanMsg; msg->getSanitizedCopy(&cleanMsg); Loading Loading @@ -458,9 +458,10 @@ status_t InputChannel::receiveMessage(InputMessage* msg) { ftl::enum_string(msg->header.type).c_str()); if (ATRACE_ENABLED()) { // Add an additional trace point to include data about the received message. std::string message = StringPrintf("receiveMessage(inputChannel=%s, seq=0x%" PRIx32 ", type=0x%" PRIx32 ")", name.c_str(), msg->header.seq, msg->header.type); std::string message = StringPrintf("receiveMessage(inputChannel=%s, seq=0x%" PRIx32 ", type=%s)", name.c_str(), msg->header.seq, ftl::enum_string(msg->header.type).c_str()); ATRACE_NAME(message.c_str()); } return OK; Loading services/inputflinger/dispatcher/Entry.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <android-base/stringprintf.h> #include <cutils/atomic.h> #include <ftl/enum.h> #include <inttypes.h> using android::base::StringPrintf; Loading Loading @@ -261,9 +262,10 @@ SensorEntry::SensorEntry(int32_t id, nsecs_t eventTime, int32_t deviceId, uint32 std::string SensorEntry::getDescription() const { std::string msg; msg += StringPrintf("SensorEntry(deviceId=%d, source=%s, sensorType=%s, " "accuracy=0x%08x, hwTimestamp=%" PRId64, "accuracy=%s, hwTimestamp=%" PRId64, deviceId, inputEventSourceToString(source).c_str(), ftl::enum_string(sensorType).c_str(), accuracy, hwTimestamp); ftl::enum_string(sensorType).c_str(), ftl::enum_string(accuracy).c_str(), hwTimestamp); if (IS_DEBUGGABLE_BUILD) { for (size_t i = 0; i < values.size(); i++) { Loading services/inputflinger/reader/mapper/InputMapper.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <sstream> #include <ftl/enum.h> #include "InputDevice.h" #include "input/PrintTools.h" Loading Loading @@ -133,7 +135,7 @@ void InputMapper::dumpStylusState(std::string& dump, const StylusState& state) { dump += StringPrintf(INDENT4 "When: %" PRId64 "\n", state.when); dump += StringPrintf(INDENT4 "Pressure: %s\n", toString(state.pressure).c_str()); dump += StringPrintf(INDENT4 "Button State: 0x%08x\n", state.buttons); dump += StringPrintf(INDENT4 "Tool Type: %" PRId32 "\n", state.toolType); dump += StringPrintf(INDENT4 "Tool Type: %s\n", ftl::enum_string(state.toolType).c_str()); } } // namespace android services/inputflinger/reader/mapper/TouchInputMapper.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -1063,10 +1063,11 @@ void TouchInputMapper::configureInputDevice(nsecs_t when, bool* outResetNeeded) } if ((viewportChanged && !skipViewportUpdate) || deviceModeChanged) { ALOGI("Device reconfigured: id=%d, name='%s', size %s, orientation %d, mode %d, " ALOGI("Device reconfigured: id=%d, name='%s', size %s, orientation %s, mode %s, " "display id %d", getDeviceId(), getDeviceName().c_str(), toString(mDisplayBounds).c_str(), mInputDeviceOrientation, mDeviceMode, mViewport.displayId); ftl::enum_string(mInputDeviceOrientation).c_str(), ftl::enum_string(mDeviceMode).c_str(), mViewport.displayId); configureVirtualKeys(); Loading Loading @@ -1117,7 +1118,8 @@ void TouchInputMapper::dumpDisplay(std::string& dump) { dump += StringPrintf(INDENT3 "DisplayBounds: %s\n", toString(mDisplayBounds).c_str()); dump += StringPrintf(INDENT3 "PhysicalFrameInRotatedDisplay: %s\n", toString(mPhysicalFrameInRotatedDisplay).c_str()); dump += StringPrintf(INDENT3 "InputDeviceOrientation: %d\n", mInputDeviceOrientation); dump += StringPrintf(INDENT3 "InputDeviceOrientation: %s\n", ftl::enum_string(mInputDeviceOrientation).c_str()); } void TouchInputMapper::configureVirtualKeys() { Loading Loading @@ -3093,11 +3095,13 @@ bool TouchInputMapper::preparePointerGestures(nsecs_t when, bool* outCancelPrevi if (DEBUG_GESTURES) { ALOGD("Gestures: finishPreviousGesture=%s, cancelPreviousGesture=%s, " "currentGestureMode=%d, currentGestureIdBits=0x%08x, " "lastGestureMode=%d, lastGestureIdBits=0x%08x", "currentGestureMode=%s, currentGestureIdBits=0x%08x, " "lastGestureMode=%s, lastGestureIdBits=0x%08x", toString(*outFinishPreviousGesture), toString(*outCancelPreviousGesture), mPointerGesture.currentGestureMode, mPointerGesture.currentGestureIdBits.value, mPointerGesture.lastGestureMode, mPointerGesture.lastGestureIdBits.value); ftl::enum_string(mPointerGesture.currentGestureMode).c_str(), mPointerGesture.currentGestureIdBits.value, ftl::enum_string(mPointerGesture.lastGestureMode).c_str(), mPointerGesture.lastGestureIdBits.value); for (BitSet32 idBits = mPointerGesture.currentGestureIdBits; !idBits.isEmpty();) { uint32_t id = idBits.clearFirstMarkedBit(); uint32_t index = mPointerGesture.currentGestureIdToIndex[id]; Loading Loading
include/input/InputDevice.h +2 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,8 @@ enum class InputDeviceSensorAccuracy : int32_t { ACCURACY_LOW = 1, ACCURACY_MEDIUM = 2, ACCURACY_HIGH = 3, ftl_last = ACCURACY_HIGH, }; enum class InputDeviceSensorReportingMode : int32_t { Loading
libs/input/InputTransport.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -387,9 +387,9 @@ status_t InputChannel::openInputChannelPair(const std::string& name, status_t InputChannel::sendMessage(const InputMessage* msg) { ATRACE_NAME_IF(ATRACE_ENABLED(), StringPrintf("sendMessage(inputChannel=%s, seq=0x%" PRIx32 ", type=0x%" PRIx32 ")", name.c_str(), msg->header.seq, msg->header.type)); StringPrintf("sendMessage(inputChannel=%s, seq=0x%" PRIx32 ", type=%s)", name.c_str(), msg->header.seq, ftl::enum_string(msg->header.type).c_str())); const size_t msgLength = msg->size(); InputMessage cleanMsg; msg->getSanitizedCopy(&cleanMsg); Loading Loading @@ -458,9 +458,10 @@ status_t InputChannel::receiveMessage(InputMessage* msg) { ftl::enum_string(msg->header.type).c_str()); if (ATRACE_ENABLED()) { // Add an additional trace point to include data about the received message. std::string message = StringPrintf("receiveMessage(inputChannel=%s, seq=0x%" PRIx32 ", type=0x%" PRIx32 ")", name.c_str(), msg->header.seq, msg->header.type); std::string message = StringPrintf("receiveMessage(inputChannel=%s, seq=0x%" PRIx32 ", type=%s)", name.c_str(), msg->header.seq, ftl::enum_string(msg->header.type).c_str()); ATRACE_NAME(message.c_str()); } return OK; Loading
services/inputflinger/dispatcher/Entry.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <android-base/stringprintf.h> #include <cutils/atomic.h> #include <ftl/enum.h> #include <inttypes.h> using android::base::StringPrintf; Loading Loading @@ -261,9 +262,10 @@ SensorEntry::SensorEntry(int32_t id, nsecs_t eventTime, int32_t deviceId, uint32 std::string SensorEntry::getDescription() const { std::string msg; msg += StringPrintf("SensorEntry(deviceId=%d, source=%s, sensorType=%s, " "accuracy=0x%08x, hwTimestamp=%" PRId64, "accuracy=%s, hwTimestamp=%" PRId64, deviceId, inputEventSourceToString(source).c_str(), ftl::enum_string(sensorType).c_str(), accuracy, hwTimestamp); ftl::enum_string(sensorType).c_str(), ftl::enum_string(accuracy).c_str(), hwTimestamp); if (IS_DEBUGGABLE_BUILD) { for (size_t i = 0; i < values.size(); i++) { Loading
services/inputflinger/reader/mapper/InputMapper.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <sstream> #include <ftl/enum.h> #include "InputDevice.h" #include "input/PrintTools.h" Loading Loading @@ -133,7 +135,7 @@ void InputMapper::dumpStylusState(std::string& dump, const StylusState& state) { dump += StringPrintf(INDENT4 "When: %" PRId64 "\n", state.when); dump += StringPrintf(INDENT4 "Pressure: %s\n", toString(state.pressure).c_str()); dump += StringPrintf(INDENT4 "Button State: 0x%08x\n", state.buttons); dump += StringPrintf(INDENT4 "Tool Type: %" PRId32 "\n", state.toolType); dump += StringPrintf(INDENT4 "Tool Type: %s\n", ftl::enum_string(state.toolType).c_str()); } } // namespace android
services/inputflinger/reader/mapper/TouchInputMapper.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -1063,10 +1063,11 @@ void TouchInputMapper::configureInputDevice(nsecs_t when, bool* outResetNeeded) } if ((viewportChanged && !skipViewportUpdate) || deviceModeChanged) { ALOGI("Device reconfigured: id=%d, name='%s', size %s, orientation %d, mode %d, " ALOGI("Device reconfigured: id=%d, name='%s', size %s, orientation %s, mode %s, " "display id %d", getDeviceId(), getDeviceName().c_str(), toString(mDisplayBounds).c_str(), mInputDeviceOrientation, mDeviceMode, mViewport.displayId); ftl::enum_string(mInputDeviceOrientation).c_str(), ftl::enum_string(mDeviceMode).c_str(), mViewport.displayId); configureVirtualKeys(); Loading Loading @@ -1117,7 +1118,8 @@ void TouchInputMapper::dumpDisplay(std::string& dump) { dump += StringPrintf(INDENT3 "DisplayBounds: %s\n", toString(mDisplayBounds).c_str()); dump += StringPrintf(INDENT3 "PhysicalFrameInRotatedDisplay: %s\n", toString(mPhysicalFrameInRotatedDisplay).c_str()); dump += StringPrintf(INDENT3 "InputDeviceOrientation: %d\n", mInputDeviceOrientation); dump += StringPrintf(INDENT3 "InputDeviceOrientation: %s\n", ftl::enum_string(mInputDeviceOrientation).c_str()); } void TouchInputMapper::configureVirtualKeys() { Loading Loading @@ -3093,11 +3095,13 @@ bool TouchInputMapper::preparePointerGestures(nsecs_t when, bool* outCancelPrevi if (DEBUG_GESTURES) { ALOGD("Gestures: finishPreviousGesture=%s, cancelPreviousGesture=%s, " "currentGestureMode=%d, currentGestureIdBits=0x%08x, " "lastGestureMode=%d, lastGestureIdBits=0x%08x", "currentGestureMode=%s, currentGestureIdBits=0x%08x, " "lastGestureMode=%s, lastGestureIdBits=0x%08x", toString(*outFinishPreviousGesture), toString(*outCancelPreviousGesture), mPointerGesture.currentGestureMode, mPointerGesture.currentGestureIdBits.value, mPointerGesture.lastGestureMode, mPointerGesture.lastGestureIdBits.value); ftl::enum_string(mPointerGesture.currentGestureMode).c_str(), mPointerGesture.currentGestureIdBits.value, ftl::enum_string(mPointerGesture.lastGestureMode).c_str(), mPointerGesture.lastGestureIdBits.value); for (BitSet32 idBits = mPointerGesture.currentGestureIdBits; !idBits.isEmpty();) { uint32_t id = idBits.clearFirstMarkedBit(); uint32_t index = mPointerGesture.currentGestureIdToIndex[id]; Loading