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

Commit 2ee6fb50 authored by Jesse Melhuish's avatar Jesse Melhuish
Browse files

Floss: Return more specific error after listen timeout

Bug: 286684158
Tag: #floss
Test: m Bluetooth
Change-Id: I236296d90415326df749bcefb021a097dee89bd8
parent 701b96cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -842,7 +842,7 @@ impl BluetoothSocketManager {
                                        SocketActions::OnIncomingSocketReady(
                                            cbid,
                                            cloned_socket_info,
                                            BtStatus::Fail,
                                            BtStatus::Timeout,
                                        ),
                                    ))
                                    .await;
+1 −0
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ pub enum BtStatus {
    JniEnvironmentError,
    JniThreadAttachError,
    WakeLockError,
    Timeout,

    // Any statuses that couldn't be cleanly converted
    Unknown = 0xff,
+4 −1
Original line number Diff line number Diff line
@@ -105,7 +105,8 @@ typedef enum {
  BT_STATUS_AUTH_REJECTED,
  BT_STATUS_JNI_ENVIRONMENT_ERROR,
  BT_STATUS_JNI_THREAD_ATTACH_ERROR,
  BT_STATUS_WAKELOCK_ERROR
  BT_STATUS_WAKELOCK_ERROR,
  BT_STATUS_TIMEOUT
} bt_status_t;

inline std::string bt_status_text(const bt_status_t& status) {
@@ -140,6 +141,8 @@ inline std::string bt_status_text(const bt_status_t& status) {
      return std::string("jni_thread_error");
    case BT_STATUS_WAKELOCK_ERROR:
      return std::string("wakelock_error");
    case BT_STATUS_TIMEOUT:
      return std::string("timeout_error");
    default:
      return std::string("UNKNOWN");
  }