mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-24 03:15:10 +00:00
HIDAPI is only reliable on Android 4.3 and newer
Fixes https://github.com/libsdl-org/SDL/issues/4955
This commit is contained in:
parent
d713a68071
commit
30f04d63e6
|
@ -1047,6 +1047,8 @@ int hid_init(void)
|
|||
{
|
||||
if ( !g_initialized )
|
||||
{
|
||||
// HIDAPI doesn't work well with Android < 4.3
|
||||
if (SDL_GetAndroidSDKVersion() >= 18) {
|
||||
// Make sure thread is attached to JVM/env
|
||||
JNIEnv *env;
|
||||
g_JVM->AttachCurrentThread( &env, NULL );
|
||||
|
@ -1070,6 +1072,7 @@ int hid_init(void)
|
|||
}
|
||||
env->CallBooleanMethod( g_HIDDeviceManagerCallbackHandler, g_midHIDDeviceManagerInitialize, init_usb, init_bluetooth );
|
||||
ExceptionCheck( env, NULL, "hid_init" );
|
||||
}
|
||||
g_initialized = true; // Regardless of result, so it's only called once
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue