Revert "Send mapper events via context"
This reverts commit cec3f6a94b1cd510d6c2f7ef9935db95fa115297.
As we discussed with Chris and Michael, it is more natural to keep the
flow of inputreader -> inputdevice -> inputmapper -> inputlistener
rather than having to come back to inputreader.
This also reduces the redundancy of having to mimic the inputlistener
interface inside the inputreader context.
Bug: 169866723
Test: atest inputflinger_tests
Change-Id: I4244947810d99ff40cfffaa34f6374aa18a238c6
diff --git a/services/inputflinger/reader/mapper/SwitchInputMapper.cpp b/services/inputflinger/reader/mapper/SwitchInputMapper.cpp
index 07de244..4f73681 100644
--- a/services/inputflinger/reader/mapper/SwitchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/SwitchInputMapper.cpp
@@ -56,7 +56,10 @@
void SwitchInputMapper::sync(nsecs_t when) {
if (mUpdatedSwitchMask) {
uint32_t updatedSwitchValues = mSwitchValues & mUpdatedSwitchMask;
- getContext()->notifySwitch(when, updatedSwitchValues, mUpdatedSwitchMask);
+ NotifySwitchArgs args(getContext()->getNextId(), when, 0 /*policyFlags*/,
+ updatedSwitchValues, mUpdatedSwitchMask);
+ getListener()->notifySwitch(&args);
+
mUpdatedSwitchMask = 0;
}
}