From 14c24e1fabb3870fa85fbbcd22bdbf20a45d9b28 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 28 Jan 2020 17:00:28 +0100 Subject: [PATCH 1/3] Remove unnecessarry check for AMotionEvent_getX Unlike getAxis getX is always present and doesn't need to be checked --- input/drivers/android_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index f387223fa9..8b8e24c89b 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -698,7 +698,7 @@ static INLINE void android_mouse_calculate_deltas(android_input_t *android, * compared to AXIS_RELATIVE because once the Android mouse cursor hits the edge of the screen it is * not possible to move the in-game mouse any further in that direction. */ - if (!x && !y && AMotionEvent_getX && AMotionEvent_getX) + if (!x && !y) { x = (AMotionEvent_getX(event, motion_ptr) - android->mouse_x_prev); y = (AMotionEvent_getY(event, motion_ptr) - android->mouse_y_prev); From 6d8cbd2c4b895c265da89243928d571a49ea8578 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 28 Jan 2020 17:01:42 +0100 Subject: [PATCH 2/3] Fix so file for x64 android In particular it affects Pixelbook which implements x64 Android --- input/drivers/android_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 8b8e24c89b..a1f55e1980 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -522,7 +522,7 @@ static bool android_input_init_handle(void) #ifdef HAVE_DYNAMIC if (libandroid_handle != NULL) /* already initialized */ return true; -#ifdef ANDROID_AARCH64 +#if defined (ANDROID_AARCH64) || defined(ANDROID_X64) if ((libandroid_handle = dlopen("/system/lib64/libandroid.so", RTLD_LOCAL | RTLD_LAZY)) == 0) return false; From 193d40bae414bd0b8ac4db288f518a4690ca10c1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 28 Jan 2020 17:32:38 +0100 Subject: [PATCH 3/3] Cleanup AMotionEvent_getAxisValue check I though it was a weak loading but in fact it's explicit so loading with some define magic, so we need to check for p_AMotionEvent_getAxisValue to be clean. Binary code is actually the same Tested by reverting path fix --- input/drivers/android_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index a1f55e1980..84222fe210 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -687,7 +687,7 @@ static INLINE void android_mouse_calculate_deltas(android_input_t *android, } /* This axis is only available on Android Nougat and on Android devices with NVIDIA extensions */ - if (AMotionEvent_getAxisValue) + if (p_AMotionEvent_getAxisValue) { x = AMotionEvent_getAxisValue(event,AMOTION_EVENT_AXIS_RELATIVE_X, motion_ptr); y = AMotionEvent_getAxisValue(event,AMOTION_EVENT_AXIS_RELATIVE_Y, motion_ptr);