input_verifier: add isolated MotionEvent checks
Previously, we were checking the consistency of MotionEvents inside
input_verifier in one large 'match' statement.
However, the verifier should only be used to check whether a given
MotionEvent makes sense in relation to all of the preceding motions.
To improve the situation, in this CL some checks are moved into a
separate function. Those checks allow us to test whether the event
itself makes sense. If the event is bad, then no need to do the
remaining checks in input_verifier.
This CL makes the rust code a bit closer to the current checks
implemented in the InputDispatcher.
Bug: 211379801
Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST
Change-Id: I60437797980f4f8f050023419a03d80e4ee4e1f1
diff --git a/libs/input/rust/input.rs b/libs/input/rust/input.rs
index 804f96d..705c959 100644
--- a/libs/input/rust/input.rs
+++ b/libs/input/rust/input.rs
@@ -180,6 +180,7 @@
bitflags! {
/// MotionEvent flags.
+ #[derive(Debug)]
pub struct MotionFlags: u32 {
/// FLAG_CANCELED
const CANCELED = input_bindgen::AMOTION_EVENT_FLAG_CANCELED as u32;