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

Commit 0e89300c authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7058891 from 8e1055bb to sc-release

Change-Id: Id979e1370a835f2ce104d94fa7b16225e2be4a14
parents e8a9af50 8e1055bb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -85,13 +85,15 @@ init_flags!(
        gd_controller,
        gatt_robust_caching,
        btaa_hci,
        gd_rust
        gd_rust,
        gd_link_policy
    },
    dependencies: {
        gd_core => gd_security,
        gd_security => gd_acl,
        gd_acl => gd_controller,
        gd_controller => gd_hci
        gd_controller => gd_hci,
        gd_link_policy => gd_acl
    }
);

+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ mod ffi {
        fn gatt_robust_caching_is_enabled() -> bool;
        fn btaa_hci_is_enabled() -> bool;
        fn gd_rust_is_enabled() -> bool;
        fn gd_link_policy_is_enabled() -> bool;
    }
}

+38 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ typedef enum {
/** We need to build on this */

typedef enum {
  BT_STATUS_SUCCESS,
  BT_STATUS_SUCCESS = 0,
  BT_STATUS_FAIL,
  BT_STATUS_NOT_READY,
  BT_STATUS_NOMEM,
@@ -98,6 +98,43 @@ typedef enum {
  BT_STATUS_WAKELOCK_ERROR
} bt_status_t;

inline std::string bt_status_text(const bt_status_t& status) {
  switch (status) {
    case BT_STATUS_SUCCESS:
      return std::string("success");
    case BT_STATUS_FAIL:
      return std::string("fail");
    case BT_STATUS_NOT_READY:
      return std::string("not_ready");
    case BT_STATUS_NOMEM:
      return std::string("no_memory");
    case BT_STATUS_BUSY:
      return std::string("busy");
    case BT_STATUS_DONE:
      return std::string("already_done");
    case BT_STATUS_UNSUPPORTED:
      return std::string("unsupported");
    case BT_STATUS_PARM_INVALID:
      return std::string("parameter_invalid");
    case BT_STATUS_UNHANDLED:
      return std::string("unhandled");
    case BT_STATUS_AUTH_FAILURE:
      return std::string("failure");
    case BT_STATUS_RMT_DEV_DOWN:
      return std::string("remote_device_down");
    case BT_STATUS_AUTH_REJECTED:
      return std::string("rejected");
    case BT_STATUS_JNI_ENVIRONMENT_ERROR:
      return std::string("jni_env_error");
    case BT_STATUS_JNI_THREAD_ATTACH_ERROR:
      return std::string("jni_thread_error");
    case BT_STATUS_WAKELOCK_ERROR:
      return std::string("wakelock_error");
    default:
      return std::string("UNKNOWN");
  }
}

/** Bluetooth PinKey Code */
typedef struct { uint8_t pin[16]; } __attribute__((packed)) bt_pin_code_t;

+13 −11
Original line number Diff line number Diff line
@@ -37,24 +37,26 @@ class Acl : public hci::acl_manager::ConnectionCallbacks,
  Acl(os::Handler* handler, const acl_interface_t& acl_interface);
  ~Acl();

  void CreateClassicConnection(const bluetooth::hci::Address& address);
  void CreateLeConnection(
      const bluetooth::hci::AddressWithType& address_with_type);
  void CancelLeConnection(
      const bluetooth::hci::AddressWithType& address_with_type);
  void DisconnectClassic(uint16_t handle, tHCI_STATUS reason);
  void DisconnectLe(uint16_t handle, tHCI_STATUS reason);
  // hci::acl_manager::ConnectionCallbacks
  void OnConnectSuccess(
      std::unique_ptr<hci::acl_manager::ClassicAclConnection>) override;
  void OnConnectFail(hci::Address, hci::ErrorCode reason) override;
  void OnClassicLinkDisconnected(uint16_t handle, hci::ErrorCode reason);

  // hci::acl_manager::LeConnectionCallbacks
  void OnLeConnectSuccess(
      hci::AddressWithType,
      std::unique_ptr<hci::acl_manager::LeAclConnection>) override;
  void OnLeConnectFail(hci::AddressWithType, hci::ErrorCode reason) override;
  void OnLeLinkDisconnected(uint16_t handle, hci::ErrorCode reason);

  void OnConnectSuccess(
      std::unique_ptr<hci::acl_manager::ClassicAclConnection>) override;
  void OnConnectFail(hci::Address, hci::ErrorCode reason) override;
  void OnClassicLinkDisconnected(uint16_t handle, hci::ErrorCode reason);
  void CreateClassicConnection(const bluetooth::hci::Address& address);
  void CreateLeConnection(
      const bluetooth::hci::AddressWithType& address_with_type);
  void CancelLeConnection(
      const bluetooth::hci::AddressWithType& address_with_type);
  void DisconnectClassic(uint16_t handle, tHCI_STATUS reason);
  void DisconnectLe(uint16_t handle, tHCI_STATUS reason);

  void WriteData(uint16_t hci_handle,
                 std::unique_ptr<bluetooth::packet::RawBuilder> packet);
+0 −74
Original line number Diff line number Diff line
@@ -1726,80 +1726,6 @@ bool BTM_PeerSupportsSecureConnections(const RawAddress& bd_addr);
 ******************************************************************************/
char* BTM_SecReadDevName(const RawAddress& bd_addr);

/*****************************************************************************
 *  POWER MANAGEMENT FUNCTIONS
 ****************************************************************************/
/*******************************************************************************
 *
 * Function         BTM_PmRegister
 *
 * Description      register or deregister with power manager
 *
 * Returns          BTM_SUCCESS if successful,
 *                  BTM_NO_RESOURCES if no room to hold registration
 *                  BTM_ILLEGAL_VALUE
 *
 ******************************************************************************/
tBTM_STATUS BTM_PmRegister(uint8_t mask, uint8_t* p_pm_id,
                           tBTM_PM_STATUS_CBACK* p_cb);

/*******************************************************************************
 *
 * Function         BTM_SetPowerMode
 *
 * Description      store the mode in control block or
 *                  alter ACL connection behavior.
 *
 * Returns          BTM_SUCCESS if successful,
 *                  BTM_UNKNOWN_ADDR if bd addr is not active or bad
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
                             const tBTM_PM_PWR_MD* p_mode);

/*******************************************************************************
 *
 * Function         BTM_ReadPowerMode
 *
 * Description      This returns the current mode for a specific
 *                  ACL connection.
 *
 * Input Param      remote_bda - device address of desired ACL connection
 *
 * Output Param     p_mode - address where the current mode is copied into.
 *                          BTM_ACL_MODE_NORMAL
 *                          BTM_ACL_MODE_HOLD
 *                          BTM_ACL_MODE_SNIFF
 *                          BTM_ACL_MODE_PARK
 *                          (valid only if return code is BTM_SUCCESS)
 *
 * Returns          BTM_SUCCESS if successful,
 *                  BTM_UNKNOWN_ADDR if bd addr is not active or bad
 *
 ******************************************************************************/
bool BTM_ReadPowerMode(const RawAddress& remote_bda, tBTM_PM_MODE* p_mode);

/*******************************************************************************
 *
 * Function         BTM_SetSsrParams
 *
 * Description      This sends the given SSR parameters for the given ACL
 *                  connection if it is in ACTIVE mode.
 *
 * Input Param      remote_bda - device address of desired ACL connection
 *                  max_lat    - maximum latency (in 0.625ms)(0-0xFFFE)
 *                  min_rmt_to - minimum remote timeout
 *                  min_loc_to - minimum local timeout
 *
 *
 * Returns          BTM_SUCCESS if the HCI command is issued successful,
 *                  BTM_UNKNOWN_ADDR if bd addr is not active or bad
 *                  BTM_CMD_STORED if the command is stored
 *
 ******************************************************************************/
tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat,
                             uint16_t min_rmt_to, uint16_t min_loc_to);

/*******************************************************************************
 *
 * Function         BTM_GetHCIConnHandle
Loading