Add static asserts for InputMessage sizes
We currently don't test the total size of InputMessage.
But that's still important, to ensure it doesn't extend further than
expected.
Add asserts for the sizes of Header and Body.
Bug: none
Test: presubmit
Change-Id: I2dbda2136186b22a9247fde058a9c356b07c808d
diff --git a/libs/input/InputTransport.cpp b/libs/input/InputTransport.cpp
index 8d1dd63..b7937dc 100644
--- a/libs/input/InputTransport.cpp
+++ b/libs/input/InputTransport.cpp
@@ -547,7 +547,7 @@
return UNKNOWN_ERROR;
}
*outSeq = msg.body.finished.seq;
- *outHandled = msg.body.finished.handled;
+ *outHandled = msg.body.finished.handled == 1;
return OK;
}
@@ -1065,7 +1065,7 @@
InputMessage msg;
msg.header.type = InputMessage::Type::FINISHED;
msg.body.finished.seq = seq;
- msg.body.finished.handled = handled;
+ msg.body.finished.handled = handled ? 1 : 0;
return mChannel->sendMessage(&msg);
}