Fix libinput mac build, hopefully.
Restore the ifdefs removed in go/ag/12549959, but using
ifdef __linux__ instead of __ANDROID__.
Test: m libinput
Bug: 172023026
Change-Id: Iafbf592e7b937b780e5ffc2df490a6c17f5f6cf5
diff --git a/include/input/Input.h b/include/input/Input.h
index d3a9694..3facfa5 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -177,7 +177,9 @@
namespace android {
+#ifdef __linux__
class Parcel;
+#endif
const char* inputEventTypeToString(int32_t type);
@@ -344,8 +346,10 @@
return getAxisValue(AMOTION_EVENT_AXIS_Y);
}
+#ifdef __linux__
status_t readFromParcel(Parcel* parcel);
status_t writeToParcel(Parcel* parcel) const;
+#endif
bool operator==(const PointerCoords& other) const;
inline bool operator!=(const PointerCoords& other) const {
@@ -704,8 +708,10 @@
// Matrix is in row-major form and compatible with SkMatrix.
void transform(const std::array<float, 9>& matrix);
+#ifdef __linux__
status_t readFromParcel(Parcel* parcel);
status_t writeToParcel(Parcel* parcel) const;
+#endif
static bool isTouchEvent(uint32_t source, int32_t action);
inline bool isTouchEvent() const {
diff --git a/include/input/KeyCharacterMap.h b/include/input/KeyCharacterMap.h
index 339c7eb..3ac5cff 100644
--- a/include/input/KeyCharacterMap.h
+++ b/include/input/KeyCharacterMap.h
@@ -19,7 +19,9 @@
#include <stdint.h>
+#ifdef __linux__
#include <binder/IBinder.h>
+#endif
#include <android-base/result.h>
#include <input/Input.h>
@@ -132,11 +134,13 @@
void tryRemapKey(int32_t scanCode, int32_t metaState,
int32_t* outKeyCode, int32_t* outMetaState) const;
+#ifdef __linux__
/* Reads a key map from a parcel. */
static std::shared_ptr<KeyCharacterMap> readFromParcel(Parcel* parcel);
/* Writes a key map to a parcel. */
void writeToParcel(Parcel* parcel) const;
+#endif
KeyCharacterMap(const KeyCharacterMap& other);