The hidapi code is now built into SDL, we don't need to load a shared library for it

This commit is contained in:
Sam Lantinga 2021-11-11 19:29:42 -08:00
parent 9c3bcf8e8a
commit c877dd93c5
1 changed files with 0 additions and 30 deletions

View File

@ -105,36 +105,6 @@ public class HIDDeviceManager {
private HIDDeviceManager(final Context context) { private HIDDeviceManager(final Context context) {
mContext = 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(); HIDDeviceRegisterCallback();
mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE); mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE);