Notify TouchpadDebugActivity on finger/hardware state changes
Notifying TouchpadDebugActivity with any change in the finger or hardware state of the touchpad connected to the device and transferring it from TouchpadInputMapper to InputManagerService using JNI.
Bug: 286551975
Test: Manual testing by flashing the device and tracing the logs
Test: $ atest TouchpadInputMapper_test.cpp
Flag: com.android.hardware.input.touchpad_visualizer
Change-Id: I5edfa3fc568a9c3cfd1a31036a5891829905a1da
diff --git a/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp b/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
index ed79233..dbc2872 100644
--- a/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
@@ -36,6 +36,7 @@
#include <log/log_main.h>
#include <stats_pull_atom_callback.h>
#include <statslog.h>
+#include "InputReaderBase.h"
#include "TouchCursorInputMapperCommon.h"
#include "TouchpadInputMapper.h"
#include "gestures/HardwareProperties.h"
@@ -424,10 +425,8 @@
std::optional<SelfContainedHardwareState> state = mStateConverter.processRawEvent(rawEvent);
if (state) {
if (mTouchpadHardwareStateNotificationsEnabled) {
- // TODO(b/286551975): Notify policy of the touchpad hardware state.
- LOG(DEBUG) << "Notify touchpad hardware state here!";
+ getPolicy()->notifyTouchpadHardwareState(*state, rawEvent.deviceId);
}
-
updatePalmDetectionMetrics();
return sendHardwareState(rawEvent.when, rawEvent.readTime, *state);
} else {