audioswitch icon indicating copy to clipboard operation
audioswitch copied to clipboard

Use AudioManager.registerAudioDeviceCallback to avoid BLUETOOTH related permissions

Open davidliu opened this issue 2 years ago • 2 comments

The bluetooth permissions are currently only used to get information about Bluetooth devices, and aren't actually needed to connect/route audio to the bluetooth device.

This information can be gotten through AudioManager.registerAudioDeviceCallback since API 23, avoiding the need for these permissions. This is particularly important on API 31 and up, where the BLUETOOTH_CONNECT is a runtime permission (with a rather confusing permission message).

davidliu avatar Dec 22 '22 19:12 davidliu

What's up with this issue? The library still requires BLUETOOTH_CONNECT permission on Android 31+ in order to route audio to Bluetooth headset, even in version 1.2.0. WhatsApp, for instance, does not require this permission, but still is perfectly able to use connected Bluetooth headset. This is very unfortunate. Our users rightfully object against requesting this unnecessary permission.

kletzander avatar Sep 27 '24 09:09 kletzander

Hi,

we're internally discussing approaches for this issue. We're currently not in a position to increase the baseline API requirements for Audioswitch, as that would break some integrations with some projects depending on Audioswitch.

GirtsR avatar Apr 07 '25 15:04 GirtsR