aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Rymanowski <lukasz.rymanowski@codecoup.pl>2021-10-06 11:31:49 +0000
committerŁukasz Rymanowski <lukasz.rymanowski@codecoup.pl>2021-10-08 07:42:51 +0000
commitbd9a3bc7fd654161b1539a4db3d658db4e84a08c (patch)
tree57aef5ccd9f910b2596a3cf2444deabb60180ab1
parent03fad9ced7ed1d92658e3887137e5d80b984a826 (diff)
downloadbt-bd9a3bc7fd654161b1539a4db3d658db4e84a08c.tar.gz
Add missing onGroupNodeStatus handler
This part is missing in the c6cad20b8 le_audio: Implement active device handling Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: compile Change-Id: I814ee0f1bf762e369d0a5be1b7bc53df607b2386
-rw-r--r--binder/android/bluetooth/IBluetoothLeAudio.aidl3
-rw-r--r--btif/src/btif_le_audio.cc9
-rw-r--r--include/hardware/bt_le_audio.h8
3 files changed, 19 insertions, 1 deletions
diff --git a/binder/android/bluetooth/IBluetoothLeAudio.aidl b/binder/android/bluetooth/IBluetoothLeAudio.aidl
index d5b12fe18..ada067ebf 100644
--- a/binder/android/bluetooth/IBluetoothLeAudio.aidl
+++ b/binder/android/bluetooth/IBluetoothLeAudio.aidl
@@ -51,6 +51,9 @@ interface IBluetoothLeAudio {
const int GROUP_STATUS_INACTIVE = 0;
const int GROUP_STATUS_ACTIVE = 1;
+ const int GROUP_NODE_ADDED = 1;
+ const int GROUP_NODE_REMOVED = 2;
+
/**
* Get device group id. Devices with same group id belong to same group (i.e left and right
* earbud)
diff --git a/btif/src/btif_le_audio.cc b/btif/src/btif_le_audio.cc
index d025f532e..343812987 100644
--- a/btif/src/btif_le_audio.cc
+++ b/btif/src/btif_le_audio.cc
@@ -28,7 +28,7 @@
using base::Bind;
using base::Unretained;
using bluetooth::le_audio::ConnectionState;
-
+using bluetooth::le_audio::GroupNodeStatus;
using bluetooth::le_audio::GroupStatus;
using bluetooth::le_audio::LeAudioClientCallbacks;
using bluetooth::le_audio::LeAudioClientInterface;
@@ -53,6 +53,13 @@ class LeAudioClientInterfaceImpl : public LeAudioClientInterface,
Unretained(callbacks), group_id, group_status));
}
+ void OnGroupNodeStatus(const RawAddress& addr, int group_id,
+ GroupNodeStatus node_status) override {
+ do_in_jni_thread(FROM_HERE,
+ Bind(&LeAudioClientCallbacks::OnGroupNodeStatus,
+ Unretained(callbacks), addr, group_id, node_status));
+ }
+
void OnAudioConf(uint8_t direction, int group_id, uint32_t snk_audio_location,
uint32_t src_audio_location, uint16_t avail_cont) override {
do_in_jni_thread(FROM_HERE,
diff --git a/include/hardware/bt_le_audio.h b/include/hardware/bt_le_audio.h
index fa4eaf83a..d62eb0f46 100644
--- a/include/hardware/bt_le_audio.h
+++ b/include/hardware/bt_le_audio.h
@@ -45,6 +45,11 @@ enum class GroupStreamStatus {
DESTROYED,
};
+enum class GroupNodeStatus {
+ ADDED = 1,
+ REMOVED,
+};
+
class LeAudioClientCallbacks {
public:
virtual ~LeAudioClientCallbacks() = default;
@@ -56,6 +61,9 @@ class LeAudioClientCallbacks {
/* Callback with group status update */
virtual void OnGroupStatus(int group_id, GroupStatus group_status) = 0;
+ /* Callback with node status update */
+ virtual void OnGroupNodeStatus(const RawAddress& bd_addr, int group_id,
+ GroupNodeStatus node_status) = 0;
/* Callback for newly recognized or reconfigured existing le audio group */
virtual void OnAudioConf(uint8_t direction, int group_id,
uint32_t snk_audio_location,