Input injection: Assume transformed values are in logical display space

Previously, we assumed that, for injected MotionEvents, the values in
the PointerCoords were in logical display space. This is not always
true, as the PointerCoords for events generated by dispatcher are in the
display space, and are only in the logical display space once their
transform is applied.

In this CL we assume that the transformed PointerCoords values are in
the logical display space before converting it to the display space.

Additionally, we set the offset values to 0, because they are now
already included in the transform.

Bug: 206842332
Test: atest inputflinger_tests
Test: manual with accessibility over (e.g. Magnification) in different
orientations

Change-Id: I65c284e5e00ed7c1b60b31269e16ba6f045071c2
diff --git a/services/inputflinger/dispatcher/InputDispatcher.h b/services/inputflinger/dispatcher/InputDispatcher.h
index 8a551cf..6f05670 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.h
+++ b/services/inputflinger/dispatcher/InputDispatcher.h
@@ -280,7 +280,9 @@
     bool hasInjectionPermission(int32_t injectorPid, int32_t injectorUid);
     void setInjectionResult(EventEntry& entry,
                             android::os::InputEventInjectionResult injectionResult);
-    void transformMotionEntryForInjectionLocked(MotionEntry&) const REQUIRES(mLock);
+    void transformMotionEntryForInjectionLocked(MotionEntry&,
+                                                const ui::Transform& injectedTransform) const
+            REQUIRES(mLock);
 
     std::condition_variable mInjectionSyncFinished;
     void incrementPendingForegroundDispatches(EventEntry& entry);