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/include/input/InputTransport.h b/include/input/InputTransport.h
index 94d90ad..d39ee25 100644
--- a/include/input/InputTransport.h
+++ b/include/input/InputTransport.h
@@ -121,11 +121,16 @@
             float yCursorPosition;
             uint32_t pointerCount;
             uint32_t empty3;
-            // Note that PointerCoords requires 8 byte alignment.
+            /**
+             * The "pointers" field must be the last field of the struct InputMessage.
+             * When we send the struct InputMessage across the socket, we are not
+             * writing the entire "pointers" array, but only the pointerCount portion
+             * of it as an optimization. Adding a field after "pointers" would break this.
+             */
             struct Pointer {
                 PointerProperties properties;
                 PointerCoords coords;
-            } pointers[MAX_POINTERS];
+            } pointers[MAX_POINTERS] __attribute__((aligned(8)));
 
             int32_t getActionId() const {
                 uint32_t index = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK)
@@ -141,7 +146,7 @@
 
         struct Finished {
             uint32_t seq;
-            bool handled;
+            uint32_t handled; // actually a bool, but we must maintain 8-byte alignment
 
             inline size_t size() const {
                 return sizeof(Finished);