Fixed exception accessing Bluetooth devices on Android 12

Since accessing Bluetooth prompts the user for permission on both Android and iOS, and we only need it for Steam Controller support, we'll leave it off by default. You can enable it by setting the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM to "1" before calling SDL_Init()

Fixes https://github.com/libsdl-org/SDL/issues/4952
This commit is contained in:
Sam Lantinga
2021-11-15 16:52:56 -08:00
parent be5b4d980d
commit 66058bbbd5
17 changed files with 145 additions and 47 deletions

View File

@@ -720,9 +720,10 @@ extern "C" {
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
* "1" - HIDAPI driver is used for Steam Controllers, which requires Bluetooth access
* and may prompt the user for permission on iOS and Android.
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
* The default is "0"
*/
#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM"