From c877dd93c5154b26859beec7487d23c5411e774c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 11 Nov 2021 19:29:42 -0800
Subject: [PATCH] The hidapi code is now built into SDL, we don't need to load
a shared library for it
---
.../java/org/libsdl/app/HIDDeviceManager.java | 30 -------------------
1 file changed, 30 deletions(-)
diff --git a/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java b/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java
index b0df0feb50..c751b821b1 100644
--- a/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java
+++ b/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java
@@ -105,36 +105,6 @@ public void onReceive(Context context, Intent intent) {
private HIDDeviceManager(final Context context) {
mContext = context;
- // Make sure we have the HIDAPI library loaded with the native functions
- try {
- SDL.loadLibrary("hidapi");
- } catch (Throwable e) {
- Log.w(TAG, "Couldn't load hidapi: " + e.toString());
-
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
- builder.setCancelable(false);
- builder.setTitle("SDL HIDAPI Error");
- builder.setMessage("Please report the following error to the SDL maintainers: " + e.getMessage());
- builder.setNegativeButton("Quit", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- try {
- // If our context is an activity, exit rather than crashing when we can't
- // call our native functions.
- Activity activity = (Activity)context;
-
- activity.finish();
- }
- catch (ClassCastException cce) {
- // Context wasn't an activity, there's nothing we can do. Give up and return.
- }
- }
- });
- builder.show();
-
- return;
- }
-
HIDDeviceRegisterCallback();
mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE);