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

Commit 5e9c4ebd authored by Martin Brabham's avatar Martin Brabham
Browse files

Floss: DisconnectAllAcls BTIF API

Allow for a disconnect of all currently connected devices to be issued
from the application layer.

Bug: 224604354
Test: mma -j $(nproc)
Test: ./build.py
Tag: #floss
Change-Id: I2020a3e7afeebab454ed896caa760213bf75b025
parent 607f5231
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -438,6 +438,14 @@ static int clear_filter_accept_list() {
  return BT_STATUS_SUCCESS;
}

static int disconnect_all_acls() {
  LOG_VERBOSE("%s", __func__);
  if (!interface_ready()) return BT_STATUS_NOT_READY;

  do_in_main_thread(FROM_HERE, base::BindOnce(btif_dm_disconnect_all_acls));
  return BT_STATUS_SUCCESS;
}

static void dump(int fd, const char** arguments) {
  btif_debug_conn_dump(fd);
  btif_debug_bond_event_dump(fd);
@@ -694,7 +702,8 @@ EXPORT_SYMBOL bt_interface_t bluetoothInterface = {
    allow_low_latency_audio,
    clear_event_filter,
    clear_event_mask,
    clear_filter_accept_list};
    clear_filter_accept_list,
    disconnect_all_acls};

// callback reporting helpers

+6 −1
Original line number Diff line number Diff line
@@ -787,9 +787,14 @@ typedef struct {
  int (*clear_event_mask)();

  /**
   * Call to clear out the connect list
   * Call to clear out the filter accept list
   */
  int (*clear_filter_accept_list)();

  /**
   * Call to disconnect all ACL connections
   */
  int (*disconnect_all_acls)();
} bt_interface_t;

#define BLUETOOTH_INTERFACE_STRING "bluetoothInterface"
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ bt_interface_t fake_bt_iface = {
    nullptr, /* clear_event_filter */
    nullptr, /* clear_event_mask */
    nullptr, /* clear_filter_accept_list */
    nullptr, /* disconnect_all_acls */
};

}  // namespace
+4 −1
Original line number Diff line number Diff line
@@ -155,6 +155,8 @@ static int clear_event_mask() { return 0; }

static int clear_filter_accept_list() { return 0; }

static int disconnect_all_acls() { return 0; }

EXPORT_SYMBOL bt_interface_t bluetoothInterface = {
    sizeof(bluetoothInterface),
    init,
@@ -197,7 +199,8 @@ EXPORT_SYMBOL bt_interface_t bluetoothInterface = {
    allow_low_latency_audio,
    clear_event_filter,
    clear_event_mask,
    clear_filter_accept_list};
    clear_filter_accept_list,
    disconnect_all_acls};

// callback reporting helpers