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/include/InputReader.h b/services/inputflinger/reader/include/InputReader.h
index 5f78149..81e3e9a 100644
--- a/services/inputflinger/reader/include/InputReader.h
+++ b/services/inputflinger/reader/include/InputReader.h
@@ -131,31 +131,11 @@
         void dispatchExternalStylusState(const StylusState& outState)
                 NO_THREAD_SAFETY_ANALYSIS override;
         InputReaderPolicyInterface* getPolicy() NO_THREAD_SAFETY_ANALYSIS override;
+        InputListenerInterface* getListener() NO_THREAD_SAFETY_ANALYSIS override;
         EventHubInterface* getEventHub() NO_THREAD_SAFETY_ANALYSIS override;
+        int32_t getNextId() NO_THREAD_SAFETY_ANALYSIS override;
         void updateLedMetaState(int32_t metaState) NO_THREAD_SAFETY_ANALYSIS override;
         int32_t getLedMetaState() NO_THREAD_SAFETY_ANALYSIS override;
-
-        // Send events to InputListener interface
-        void notifyConfigurationChanged(nsecs_t when) override;
-        void notifyKey(nsecs_t eventTime, int32_t deviceId, uint32_t source, int32_t displayId,
-                       uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode,
-                       int32_t scanCode, int32_t metaState, nsecs_t downTime) override;
-        void notifyMotion(nsecs_t eventTime, int32_t deviceId, uint32_t source, int32_t displayId,
-                          uint32_t policyFlags, int32_t action, int32_t actionButton, int32_t flags,
-                          int32_t metaState, int32_t buttonState,
-                          MotionClassification classification, int32_t edgeFlags,
-                          uint32_t pointerCount, const PointerProperties* pointerProperties,
-                          const PointerCoords* pointerCoords, float xPrecision, float yPrecision,
-                          float xCursorPosition, float yCursorPosition, nsecs_t downTime,
-                          const std::vector<TouchVideoFrame>& videoFrames) override;
-        void notifySwitch(nsecs_t eventTime, uint32_t switchValues, uint32_t switchMask) override;
-        void notifySensor(nsecs_t when, int32_t deviceId, InputDeviceSensorType sensorType,
-                          InputDeviceSensorAccuracy accuracy, bool accuracyChanged,
-                          nsecs_t timestamp, std::vector<float> values) override;
-        void notifyVibratorState(nsecs_t when, int32_t deviceId, bool isOn) override;
-        void notifyDeviceReset(nsecs_t when, int32_t deviceId) override;
-        void notifyPointerCaptureChanged(nsecs_t when, bool hasCapture) override;
-
     } mContext;
 
     friend class ContextImpl;
diff --git a/services/inputflinger/reader/include/InputReaderContext.h b/services/inputflinger/reader/include/InputReaderContext.h
index e6ea523..dc807f7 100644
--- a/services/inputflinger/reader/include/InputReaderContext.h
+++ b/services/inputflinger/reader/include/InputReaderContext.h
@@ -55,34 +55,13 @@
     virtual void dispatchExternalStylusState(const StylusState& outState) = 0;
 
     virtual InputReaderPolicyInterface* getPolicy() = 0;
+    virtual InputListenerInterface* getListener() = 0;
     virtual EventHubInterface* getEventHub() = 0;
 
+    virtual int32_t getNextId() = 0;
+
     virtual void updateLedMetaState(int32_t metaState) = 0;
     virtual int32_t getLedMetaState() = 0;
-
-    // Send events to InputListener interface
-
-    virtual void notifyConfigurationChanged(nsecs_t when) = 0;
-    virtual void notifyKey(nsecs_t eventTime, int32_t deviceId, uint32_t source, int32_t displayId,
-                           uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode,
-                           int32_t scanCode, int32_t metaState, nsecs_t downTime) = 0;
-    virtual void notifyMotion(nsecs_t eventTime, int32_t deviceId, uint32_t source,
-                              int32_t displayId, uint32_t policyFlags, int32_t action,
-                              int32_t actionButton, int32_t flags, int32_t metaState,
-                              int32_t buttonState, MotionClassification classification,
-                              int32_t edgeFlags, uint32_t pointerCount,
-                              const PointerProperties* pointerProperties,
-                              const PointerCoords* pointerCoords, float xPrecision,
-                              float yPrecision, float xCursorPosition, float yCursorPosition,
-                              nsecs_t downTime,
-                              const std::vector<TouchVideoFrame>& videoFrames) = 0;
-    virtual void notifySwitch(nsecs_t eventTime, uint32_t switchValues, uint32_t switchMask) = 0;
-    virtual void notifySensor(nsecs_t when, int32_t deviceId, InputDeviceSensorType sensorType,
-                              InputDeviceSensorAccuracy accuracy, bool accuracyChanged,
-                              nsecs_t timestamp, std::vector<float> values) = 0;
-    virtual void notifyVibratorState(nsecs_t when, int32_t deviceId, bool isOn) = 0;
-    virtual void notifyDeviceReset(nsecs_t when, int32_t deviceId) = 0;
-    virtual void notifyPointerCaptureChanged(nsecs_t when, bool hasCapture) = 0;
 };
 
 } // namespace android