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 Bluetooth permission question #2210

Closed
Basewq opened this issue Jun 3, 2024 · 2 comments · Fixed by #2211
Closed

Android Bluetooth permission question #2210

Basewq opened this issue Jun 3, 2024 · 2 comments · Fixed by #2211

Comments

@Basewq
Copy link

Basewq commented Jun 3, 2024

I am assuming pull #1372 is in version 2.20.0 and 2.21.0 (the two latest versions of Silk) and contained the SDL changes which defaults to not enabling checking the bluetooth permission.
According to SDL the bluetooth permission check is ignored by default on Android (the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM)
libsdl-org/SDL@66058bb

However, when I run the android app (just the Silk Android sample project in the repo) I am noticing the debug log shows

[hidapi] Initializing Bluetooth

which seems to imply the hint is being set in Silk?
Is there a way to forcibly unset this hint value?

@Perksey
Copy link
Member

Perksey commented Jun 3, 2024

That PR has been in Silk.NET since 2.17. However, I notice that we haven't rebuilt the Android binary for some time, so it's actually closer to being exactly the same for 3 years.

Silk.NET uses SdlProvider to create its instance. You can hijack this process using the following:

var sdl = Sdl.GetApi();
sdl.InitHint(...);
sdl = SdlProvider.SDL.Value;

Though I agree this shouldn't really be necessary.

Really we need to update our Android binaries.

@Basewq
Copy link
Author

Basewq commented Jun 3, 2024

Thanks for the info.
The code doesn't work (the InitHint method is for Glfw, not the android code).
Sdl.GetApi() does have a SetHint, but unfortunately there's no effect, but it might not be possible to set anyway since the creation and init seems to be within SDLActivity.onCreate.

If you haven't rebuilt the Android binary, then that would make sense that it's not actually running the new checks (since the changed logic check is within SDLActivity.java).

Would be nice to have a new binary with this change, if not, then please close this as unplanned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants