summaryrefslogtreecommitdiff
path: root/floss
diff options
context:
space:
mode:
author Jeremy Wu <jrwu@google.com> 2024-06-18 00:41:56 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-06-18 00:41:56 +0000
commit422c21c52dc3a56faaf9416d12e3d0c7e679c577 (patch)
treec72a7c3da56e6cb5f7f62613ee72513f45d962a5 /floss
parentc35be7ca18d31e93e3b70b1a0e6a3644ae82bb5e (diff)
parent39bd62f6bb433f6e366fe55d8c4ddfdd539d0d16 (diff)
Merge "floss: notify hfp/a2dp audio status via forwarded fd" into main
Diffstat (limited to 'floss')
-rw-r--r--floss/pandora/floss/media_client.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/floss/pandora/floss/media_client.py b/floss/pandora/floss/media_client.py
index 83dbe1e2c4..fdfa032e56 100644
--- a/floss/pandora/floss/media_client.py
+++ b/floss/pandora/floss/media_client.py
@@ -410,13 +410,16 @@ class FlossMediaClient(BluetoothMediaCallbacks):
return True
@utils.glib_call(False)
- def start_audio_request(self):
+ def start_audio_request(self, connection_listener):
"""Starts audio request.
+ Args:
+ connection_listener: The file descriptor to write 1 (u8) on audio connection.
+
Returns:
True on success, False otherwise.
"""
- self.proxy().StartAudioRequest()
+ self.proxy().StartAudioRequest(connection_listener)
return True
@utils.glib_call(None)
@@ -432,28 +435,32 @@ class FlossMediaClient(BluetoothMediaCallbacks):
return self.proxy().GetA2dpAudioStarted(address)
@utils.glib_call(False)
- def stop_audio_request(self):
+ def stop_audio_request(self, connection_listener):
"""Stops audio request.
+ Args:
+ connection_listener: The file descriptor to write 0 (u8) on audio connection.
+
Returns:
True on success, False otherwise.
"""
- self.proxy().StopAudioRequest()
+ self.proxy().StopAudioRequest(connection_listener)
return True
@utils.glib_call(False)
- def start_sco_call(self, address, sco_offload, force_cvsd):
+ def start_sco_call(self, address, sco_offload, disabled_codecs, connection_listener):
"""Starts the SCO call.
Args:
address: Device address to make SCO call.
sco_offload: Whether SCO offload is enabled.
- force_cvsd: True to force the stack to use CVSD even if mSBC is supported.
+ disabled_codecs: The disabled codecs in bitmask form. CVSD=1, MSBC=2, LC3=4.
+ connection_listener: The file descriptor to write the codec id on audio connection.
Returns:
True on success, False otherwise.
"""
- self.proxy().StartScoCall(address, sco_offload, force_cvsd)
+ self.proxy().StartScoCall(address, sco_offload, disabled_codecs, connection_listener)
return True
@utils.glib_call(None)
@@ -470,16 +477,17 @@ class FlossMediaClient(BluetoothMediaCallbacks):
return self.proxy().GetHfpAudioStarted(address)
@utils.glib_call(False)
- def stop_sco_call(self, address):
+ def stop_sco_call(self, address, connection_listener):
"""Stops the SCO call.
Args:
address: Device address to stop SCO call.
+ connection_listener: The file descriptor to write 0 (u8) on audio disconnection.
Returns:
True on success, False otherwise.
"""
- self.proxy().StopScoCall(address)
+ self.proxy().StopScoCall(address, connection_listener)
return True
@utils.glib_call(None)