Merge "Improve input devices changed logs"
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
index b4c6b33..eee49d5 100644
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -559,7 +559,8 @@
mEventHub->setExcludedDevices(mConfig.excludedDeviceNames);
if (changes) {
- ALOGI("Reconfiguring input devices. changes=0x%08x", changes);
+ ALOGI("Reconfiguring input devices, changes=%s",
+ InputReaderConfiguration::changesToString(changes).c_str());
nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
if (changes & InputReaderConfiguration::CHANGE_MUST_REOPEN) {
diff --git a/services/inputflinger/InputReaderBase.cpp b/services/inputflinger/InputReaderBase.cpp
index f48a645..bc53cf5 100644
--- a/services/inputflinger/InputReaderBase.cpp
+++ b/services/inputflinger/InputReaderBase.cpp
@@ -49,6 +49,44 @@
// --- InputReaderConfiguration ---
+std::string InputReaderConfiguration::changesToString(uint32_t changes) {
+ if (changes == 0) {
+ return "<none>";
+ }
+ std::string result;
+ if (changes & CHANGE_POINTER_SPEED) {
+ result += "POINTER_SPEED | ";
+ }
+ if (changes & CHANGE_POINTER_GESTURE_ENABLEMENT) {
+ result += "POINTER_GESTURE_ENABLEMENT | ";
+ }
+ if (changes & CHANGE_DISPLAY_INFO) {
+ result += "DISPLAY_INFO | ";
+ }
+ if (changes & CHANGE_SHOW_TOUCHES) {
+ result += "SHOW_TOUCHES | ";
+ }
+ if (changes & CHANGE_KEYBOARD_LAYOUTS) {
+ result += "KEYBOARD_LAYOUTS | ";
+ }
+ if (changes & CHANGE_DEVICE_ALIAS) {
+ result += "DEVICE_ALIAS | ";
+ }
+ if (changes & CHANGE_TOUCH_AFFINE_TRANSFORMATION) {
+ result += "TOUCH_AFFINE_TRANSFORMATION | ";
+ }
+ if (changes & CHANGE_EXTERNAL_STYLUS_PRESENCE) {
+ result += "EXTERNAL_STYLUS_PRESENCE | ";
+ }
+ if (changes & CHANGE_ENABLED_STATE) {
+ result += "ENABLED_STATE | ";
+ }
+ if (changes & CHANGE_MUST_REOPEN) {
+ result += "MUST_REOPEN | ";
+ }
+ return result;
+}
+
std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByUniqueId(
const std::string& uniqueDisplayId) const {
if (uniqueDisplayId.empty()) {
diff --git a/services/inputflinger/include/InputReaderBase.h b/services/inputflinger/include/InputReaderBase.h
index 8ad5dd0..c7720cb 100644
--- a/services/inputflinger/include/InputReaderBase.h
+++ b/services/inputflinger/include/InputReaderBase.h
@@ -270,6 +270,8 @@
pointerGestureZoomSpeedRatio(0.3f),
showTouches(false), pointerCapture(false) { }
+ static std::string changesToString(uint32_t changes);
+
std::optional<DisplayViewport> getDisplayViewportByType(ViewportType type) const;
std::optional<DisplayViewport> getDisplayViewportByUniqueId(const std::string& uniqueDisplayId)
const;