Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Alert dialog (Couldn't load hidapi: hidapi.so) is displayed when SDL is compiled with disabled hidapi #3378

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 2 comments
Milestone

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.10
Reported for operating system, platform: Android (All), ARM

Comments on the original bug report:

On 2019-08-29 19:58:35 +0000, ZZ wrote:

In connection to this: https://bugzilla.libsdl.org/show_bug.cgi?id=3918#c23

If SDL on Android is compiled with hidapi disabled an alert dialgo is displayed informing about missing hidapi.so

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) {

I suggest that there is some option for the user to easily disable the use of hidapi in SDLActivity.java I created a custom variable that I can set in a class that inherits from SDLActivity so that I don't have to modify SDLs own source code:

        if (isHIDAPIEnabled)
        {
            mHIDDeviceManager = HIDDeviceManager.acquire(this);
        }

Or maybe some other method could be employed like the Java code could query SDL for hidapi support and disable the above code automatically.

@icculus icculus removed the bug label Nov 30, 2021
@icculus icculus added this to the 2.0.20 milestone Nov 30, 2021
@icculus
Copy link
Collaborator

icculus commented Nov 30, 2021

Not sure if hidapi is always available now. If we can still build Android without it, this check makes sense. Otherwise, let's just close this bug as-is.

@slouken
Copy link
Collaborator

slouken commented Nov 30, 2021

Yep, this code doesn't exist anymore.

@slouken slouken closed this as completed Nov 30, 2021
@icculus icculus modified the milestones: 2.0.22, 2.0.20 Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants