Fix VirtualInputDevice build for musl libc

The struct input_event timespec types come from the kernel headers,
which can vary in their exact definition based on which libc they
came from.  Use decltype to cast to the exact definition of the
fields.

Bug: 271946580
Test: m USE_HOST_MUSL=true host-native
Change-Id: Iddcc6ea7c1e5d70edf8c159ddaff585eb38ef7fa
diff --git a/libs/input/VirtualInputDevice.cpp b/libs/input/VirtualInputDevice.cpp
index af9ce3a..9a459b1 100644
--- a/libs/input/VirtualInputDevice.cpp
+++ b/libs/input/VirtualInputDevice.cpp
@@ -49,11 +49,10 @@
     std::chrono::seconds seconds = std::chrono::duration_cast<std::chrono::seconds>(eventTime);
     std::chrono::microseconds microseconds =
             std::chrono::duration_cast<std::chrono::microseconds>(eventTime - seconds);
-    struct input_event ev = {.type = type,
-                             .code = code,
-                             .value = value,
-                             .input_event_sec = static_cast<time_t>(seconds.count()),
-                             .input_event_usec = static_cast<suseconds_t>(microseconds.count())};
+    struct input_event ev = {.type = type, .code = code, .value = value};
+    ev.input_event_sec = static_cast<decltype(ev.input_event_sec)>(seconds.count());
+    ev.input_event_usec = static_cast<decltype(ev.input_event_usec)>(microseconds.count());
+
     return TEMP_FAILURE_RETRY(write(mFd, &ev, sizeof(struct input_event))) == sizeof(ev);
 }