Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82888abd authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

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
parent 50809d5e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)
+8 −1
Original line number Diff line number Diff line
@@ -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,
+8 −0
Original line number Diff line number Diff line
@@ -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,