summaryrefslogtreecommitdiff
path: root/include/input
diff options
context:
space:
mode:
authorPrabir Pradhan <prabirmsp@google.com>2021-09-24 06:35:16 -0700
committerPrabir Pradhan <prabirmsp@google.com>2021-10-04 04:00:44 -0700
commitb5cb957254201f19a434898c249d59752e2a88b7 (patch)
tree1448609838a4c522f11ee3454eb227d2f83dee9e /include/input
parentc2872295a47436c5507c38ddac0393b76d5471d1 (diff)
downloadnative-b5cb957254201f19a434898c249d59752e2a88b7.tar.gz
VerifiedMotionEvent: Sign transformed raw values
The values for axes X/Y that are stored in MotionEvent are transformed to values used for its getRaw API based on the source. This is because non-pointer sources should not have translation applied to them. We need to ensure that we use the same raw coordinates when we sign a VerifiedMotionEvent in InputDispatcher that we would get with the MotionEvent#getRaw API. To do this, we re-use the same logic used to transform the raw coordinates in MotionEvent in InputDispatcher. Bug: 179274888 Test: atest inputflinger_tests Test: atest VerifyInputEventTest Change-Id: I552f94064f15573ddda8f7c0b588cd3b984b6a94
Diffstat (limited to 'include/input')
-rw-r--r--include/input/Input.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/input/Input.h b/include/input/Input.h
index d397313ab6..5015e68121 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -801,6 +801,8 @@ public:
static std::string actionToString(int32_t action);
+ static vec2 calculateTransformedXY(uint32_t source, const ui::Transform&, const vec2& xy);
+
protected:
int32_t mAction;
int32_t mActionButton;