From 8fa90784a14bc3f9926c0706d863d4b0dd9290c3 Mon Sep 17 00:00:00 2001 From: attila Date: Thu, 22 Dec 2022 14:21:58 +0100 Subject: [PATCH] Android: Add missing runtime permission for Bluetooth Midi on API >= 31 --- .../Source/ProjectSaving/jucer_ProjectExport_Android.h | 2 +- modules/juce_core/native/juce_android_RuntimePermissions.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h index 6d37db072e..a030a95940 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h @@ -1145,7 +1145,7 @@ private: "If enabled, this will set the android.permission.BLUETOOTH_ADVERTISE, android.permission.BLUETOOTH and android.permission.BLUETOOTH_ADMIN flags in the manifest."); props.add (new ChoicePropertyComponent (androidBluetoothConnectNeeded, "Bluetooth Connect Required"), - "If enabled, this will set the android.permission.BLUETOOTH_CONNECT, android.permission.BLUETOOTH and android.permission.BLUETOOTH_ADMIN flags in the manifest."); + "If enabled, this will set the android.permission.BLUETOOTH_CONNECT, android.permission.BLUETOOTH and android.permission.BLUETOOTH_ADMIN flags in the manifest. This is required for Bluetooth MIDI on Android."); props.add (new ChoicePropertyComponent (androidReadMediaAudioPermission, "Read Audio From External Storage"), "If enabled, this will set the android.permission.READ_MEDIA_AUDIO and android.permission.READ_EXTERNAL_STORAGE flags in the manifest."); diff --git a/modules/juce_core/native/juce_android_RuntimePermissions.cpp b/modules/juce_core/native/juce_android_RuntimePermissions.cpp index d651442284..285b92c1e1 100644 --- a/modules/juce_core/native/juce_android_RuntimePermissions.cpp +++ b/modules/juce_core/native/juce_android_RuntimePermissions.cpp @@ -39,7 +39,8 @@ static StringArray jucePermissionToAndroidPermissions (RuntimePermissions::Permi if (getAndroidSDKVersion() < 31) return { "android.permission.ACCESS_FINE_LOCATION" }; - return { "android.permission.BLUETOOTH_SCAN" }; + return { "android.permission.BLUETOOTH_SCAN", + "android.permission.BLUETOOTH_CONNECT" }; } case RuntimePermissions::writeExternalStorage: return { "android.permission.WRITE_EXTERNAL_STORAGE" };