google/mobly-bundled-snippets

Disconnect/Connect with A2DP & Call profiles

vamaring opened this issue · 4 comments

Hello,

Currently there is an A2DP snippet, which controls whether media playback(Media audio in BT settings) is connected/disconnected. But in my device BT settings (Samsung Galaxy S9), there is also a setting to connect/disconnect Call audio. Is there a profile that we can use to connect/disconnect all profiles (A2DP & calls) through snippet? That would be very useful.

Not sure what exactly that would look like.
Do you want to propose a design?

Under my Paired Devices section of phones Bluetooth, If I tap on settings icon, I see the connected device name, Unpair option & I see a section USE FOR with two toggle buttons (Call audio & Media audio). If I use btA2dpDisconnect api from https://github.com/google/mobly-bundled-snippets/blob/master/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java , it only disconnects Media audio toggle button on the phone, but Call audio setting remains connected.

Seems like you can simply create a python util to call disconnect all the profiles you want to disconnect?
MBS is meant to more or less mirror the Android APIs. Is there an Android API that does what you want?

I just started exploring mobly-bundled-snippets to see if it serves my purpose of disconnecting all profiles, but currently is only disconnecting A2DP(Media). I dont know any other way of disconnecting other profiles on Android yet. I will have to find more details about this. Just wanted to check here, if someone had requested similar requirement.