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

Commit 548b53c2 authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

Floss: Fix usage of BT_STATUS_BUSY

Since we want to expose the `btif_status_t` as public API for Floss, we
need to be consistent in the interpretation of the error codes.

Changed error code in btif_hf and btif_hd to use BT_STATUS_DONE instead
of BT_STATUS_BUSY since those cases look like the errors are not
retryable, but rather a request that is already completed and can be
assumed success unless need to be redone.

Bug: 247110650
Tag: #floss
Test: Manual - Build Floss on Linux

Change-Id: If483dff010a620cafe9f659cfdc1ac8d7af37025
parent 2dd7a3cb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -393,7 +393,7 @@ static bt_status_t register_app(bthd_app_param_t* p_app_param,


  if (btif_hd_cb.app_registered) {
  if (btif_hd_cb.app_registered) {
    BTIF_TRACE_WARNING("%s: application already registered", __func__);
    BTIF_TRACE_WARNING("%s: application already registered", __func__);
    return BT_STATUS_BUSY;
    return BT_STATUS_DONE;
  }
  }


  if (strlen(p_app_param->name) >= BTIF_HD_APP_NAME_LEN ||
  if (strlen(p_app_param->name) >= BTIF_HD_APP_NAME_LEN ||
+1 −1
Original line number Original line Diff line number Diff line
@@ -658,7 +658,7 @@ static bt_status_t connect_int(RawAddress* bd_addr, uint16_t uuid) {
  if (is_connected(bd_addr)) {
  if (is_connected(bd_addr)) {
    BTIF_TRACE_WARNING("%s: device %s is already connected", __func__,
    BTIF_TRACE_WARNING("%s: device %s is already connected", __func__,
                       bd_addr->ToString().c_str());
                       bd_addr->ToString().c_str());
    return BT_STATUS_BUSY;
    return BT_STATUS_DONE;
  }
  }
  btif_hf_cb_t* hf_cb = nullptr;
  btif_hf_cb_t* hf_cb = nullptr;
  for (int i = 0; i < btif_max_hf_clients; i++) {
  for (int i = 0; i < btif_max_hf_clients; i++) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -92,7 +92,7 @@ typedef enum {
  BT_STATUS_FAIL,
  BT_STATUS_FAIL,
  BT_STATUS_NOT_READY,
  BT_STATUS_NOT_READY,
  BT_STATUS_NOMEM,
  BT_STATUS_NOMEM,
  BT_STATUS_BUSY,
  BT_STATUS_BUSY, /* retryable error */
  BT_STATUS_DONE, /* request already completed */
  BT_STATUS_DONE, /* request already completed */
  BT_STATUS_UNSUPPORTED,
  BT_STATUS_UNSUPPORTED,
  BT_STATUS_PARM_INVALID,
  BT_STATUS_PARM_INVALID,
+1 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@


#include <raw_address.h>
#include <raw_address.h>


#include "bluetooth.h"
#include "bluetooth_headset_callbacks.h"
#include "bluetooth_headset_callbacks.h"
#include "bt_hf.h"
#include "bt_hf.h"