Make sure all debug logs could be present after enabled
Moved debug flags to InputDispatcherDebugConfig so they could be
accessed between different source files.
Test: enabled log
Bug: 229302912
Change-Id: I384c9d26ecb130747ffb39782b9c3bb7e2b2f159
diff --git a/services/inputflinger/dispatcher/InputState.cpp b/services/inputflinger/dispatcher/InputState.cpp
index ad3c615..f46a8bc 100644
--- a/services/inputflinger/dispatcher/InputState.cpp
+++ b/services/inputflinger/dispatcher/InputState.cpp
@@ -14,10 +14,12 @@
* limitations under the License.
*/
+#include "DebugConfig.h"
#include "input/InputDevice.h"
#include "InputState.h"
+#include <cinttypes>
#include "InputDispatcher.h"
namespace android::inputdispatcher {
@@ -100,11 +102,11 @@
mMotionMementos.erase(mMotionMementos.begin() + index);
return true;
}
-#if DEBUG_OUTBOUND_EVENT_DETAILS
- ALOGD("Dropping inconsistent motion up or cancel event: deviceId=%d, source=%08x, "
- "displayId=%" PRId32 ", actionMasked=%d",
- entry.deviceId, entry.source, entry.displayId, actionMasked);
-#endif
+ if (DEBUG_OUTBOUND_EVENT_DETAILS) {
+ ALOGD("Dropping inconsistent motion up or cancel event: deviceId=%d, source=%08x, "
+ "displayId=%" PRId32 ", actionMasked=%d",
+ entry.deviceId, entry.source, entry.displayId, actionMasked);
+ }
return false;
}
@@ -157,11 +159,11 @@
return true;
}
}
-#if DEBUG_OUTBOUND_EVENT_DETAILS
- ALOGD("Dropping inconsistent motion pointer up/down or move event: "
- "deviceId=%d, source=%08x, displayId=%" PRId32 ", actionMasked=%d",
- entry.deviceId, entry.source, entry.displayId, actionMasked);
-#endif
+ if (DEBUG_OUTBOUND_EVENT_DETAILS) {
+ ALOGD("Dropping inconsistent motion pointer up/down or move event: "
+ "deviceId=%d, source=%08x, displayId=%" PRId32 ", actionMasked=%d",
+ entry.deviceId, entry.source, entry.displayId, actionMasked);
+ }
return false;
}
@@ -171,11 +173,11 @@
mMotionMementos.erase(mMotionMementos.begin() + index);
return true;
}
-#if DEBUG_OUTBOUND_EVENT_DETAILS
- ALOGD("Dropping inconsistent motion hover exit event: deviceId=%d, source=%08x, "
- "displayId=%" PRId32,
- entry.deviceId, entry.source, entry.displayId);
-#endif
+ if (DEBUG_OUTBOUND_EVENT_DETAILS) {
+ ALOGD("Dropping inconsistent motion hover exit event: deviceId=%d, source=%08x, "
+ "displayId=%" PRId32,
+ entry.deviceId, entry.source, entry.displayId);
+ }
return false;
}