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

Commit 44028670 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Replace usage of "vector<>" with "std::vector<>"

This change is needed so we can remove the last instances
of "using std::vector" statements in hardware/libhardware.

Test: code compilation
Change-Id: I6a9fc62152371d1bba6ead71e7ff8c2610799637
parent c4e680d2
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -297,7 +297,7 @@ void GattServer::ConnectionCallback(


void GattServer::ServiceAddedCallback(hal::BluetoothGattInterface* gatt_iface,
void GattServer::ServiceAddedCallback(hal::BluetoothGattInterface* gatt_iface,
                                      int status, int server_id,
                                      int status, int server_id,
                                      vector<btgatt_db_element_t> svc) {
                                      std::vector<btgatt_db_element_t> svc) {
  lock_guard<mutex> lock(mutex_);
  lock_guard<mutex> lock(mutex_);


  if (server_id != server_id_) return;
  if (server_id != server_id_) return;
@@ -407,7 +407,7 @@ void GattServer::RequestReadDescriptorCallback(
void GattServer::RequestWriteCharacteristicCallback(
void GattServer::RequestWriteCharacteristicCallback(
    hal::BluetoothGattInterface* /* gatt_iface */, int conn_id, int trans_id,
    hal::BluetoothGattInterface* /* gatt_iface */, int conn_id, int trans_id,
    const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
    const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
    bool is_prep, vector<uint8_t> value) {
    bool is_prep, std::vector<uint8_t> value) {
  lock_guard<mutex> lock(mutex_);
  lock_guard<mutex> lock(mutex_);


  // Check to see if we know about this connection. Otherwise ignore the
  // Check to see if we know about this connection. Otherwise ignore the
@@ -446,7 +446,7 @@ void GattServer::RequestWriteCharacteristicCallback(
void GattServer::RequestWriteDescriptorCallback(
void GattServer::RequestWriteDescriptorCallback(
    hal::BluetoothGattInterface* /* gatt_iface */, int conn_id, int trans_id,
    hal::BluetoothGattInterface* /* gatt_iface */, int conn_id, int trans_id,
    const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
    const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
    bool is_prep, vector<uint8_t> value) {
    bool is_prep, std::vector<uint8_t> value) {
  lock_guard<mutex> lock(mutex_);
  lock_guard<mutex> lock(mutex_);


  // Check to see if we know about this connection. Otherwise ignore the
  // Check to see if we know about this connection. Otherwise ignore the
+3 −3
Original line number Original line Diff line number Diff line
@@ -196,7 +196,7 @@ class GattServer : public BluetoothInstance,
                          const bt_bdaddr_t& bda) override;
                          const bt_bdaddr_t& bda) override;
  void ServiceAddedCallback(hal::BluetoothGattInterface* gatt_iface, int status,
  void ServiceAddedCallback(hal::BluetoothGattInterface* gatt_iface, int status,
                            int server_if,
                            int server_if,
                            vector<btgatt_db_element_t>) override;
                            std::vector<btgatt_db_element_t>) override;
  void ServiceStoppedCallback(hal::BluetoothGattInterface* gatt_iface,
  void ServiceStoppedCallback(hal::BluetoothGattInterface* gatt_iface,
                              int status, int server_id,
                              int status, int server_id,
                              int service_handle) override;
                              int service_handle) override;
@@ -212,12 +212,12 @@ class GattServer : public BluetoothInstance,
  void RequestWriteCharacteristicCallback(
  void RequestWriteCharacteristicCallback(
      hal::BluetoothGattInterface* gatt_iface, int conn_id, int trans_id,
      hal::BluetoothGattInterface* gatt_iface, int conn_id, int trans_id,
      const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
      const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
      bool is_prep, vector<uint8_t> value) override;
      bool is_prep, std::vector<uint8_t> value) override;
  void RequestWriteDescriptorCallback(hal::BluetoothGattInterface* gatt_iface,
  void RequestWriteDescriptorCallback(hal::BluetoothGattInterface* gatt_iface,
                                      int conn_id, int trans_id,
                                      int conn_id, int trans_id,
                                      const bt_bdaddr_t& bda, int attr_handle,
                                      const bt_bdaddr_t& bda, int attr_handle,
                                      int offset, bool need_rsp, bool is_prep,
                                      int offset, bool need_rsp, bool is_prep,
                                      vector<uint8_t> value) override;
                                      std::vector<uint8_t> value) override;
  void RequestExecWriteCallback(hal::BluetoothGattInterface* gatt_iface,
  void RequestExecWriteCallback(hal::BluetoothGattInterface* gatt_iface,
                                int conn_id, int trans_id,
                                int conn_id, int trans_id,
                                const bt_bdaddr_t& bda,
                                const bt_bdaddr_t& bda,
+4 −3
Original line number Original line Diff line number Diff line
@@ -139,7 +139,7 @@ void RegisterServerCallback(int status, int server_if, bt_uuid_t* app_uuid) {
}
}


void ServiceAddedCallback(int status, int server_if,
void ServiceAddedCallback(int status, int server_if,
                          vector<btgatt_db_element_t> service) {
                          std::vector<btgatt_db_element_t> service) {
  LOG_INFO(LOG_TAG, "%s: status:%d server_if:%d count:%zu svc_handle:%d",
  LOG_INFO(LOG_TAG, "%s: status:%d server_if:%d count:%zu svc_handle:%d",
           __func__, status, server_if, service.size(),
           __func__, status, server_if, service.size(),
           service[0].attribute_handle);
           service[0].attribute_handle);
@@ -248,7 +248,7 @@ void RequestReadCallback(int conn_id, int trans_id, bt_bdaddr_t* bda,


void RequestWriteCallback(int conn_id, int trans_id, bt_bdaddr_t* bda,
void RequestWriteCallback(int conn_id, int trans_id, bt_bdaddr_t* bda,
                          int attr_handle, int attribute_offset, bool need_rsp,
                          int attr_handle, int attribute_offset, bool need_rsp,
                          bool is_prep, vector<uint8_t> value) {
                          bool is_prep, std::vector<uint8_t> value) {
  std::string addr(BtAddrString(bda));
  std::string addr(BtAddrString(bda));
  LOG_INFO(LOG_TAG,
  LOG_INFO(LOG_TAG,
           "%s: connection:%d (%s:trans:%d) write attr:%d attribute_offset:%d "
           "%s: connection:%d (%s:trans:%d) write attr:%d attribute_offset:%d "
@@ -374,7 +374,8 @@ void ServiceStoppedCallback(int status, int server_if, int srvc_handle) {
  g_internal->api_synchronize.notify_one();
  g_internal->api_synchronize.notify_one();
}
}


void ScanResultCallback(bt_bdaddr_t* bda, int rssi, vector<uint8_t> adv_data) {
void ScanResultCallback(bt_bdaddr_t* bda, int rssi,
                        std::vector<uint8_t> adv_data) {
  std::string addr(BtAddrString(bda));
  std::string addr(BtAddrString(bda));
  (void)adv_data;
  (void)adv_data;
  std::lock_guard<std::mutex> lock(g_internal->lock);
  std::lock_guard<std::mutex> lock(g_internal->lock);
+11 −9
Original line number Original line Diff line number Diff line
@@ -99,8 +99,9 @@ void RegisterScannerCallback(int status, int scanner_id, bt_uuid_t* app_uuid) {
      RegisterScannerCallback(g_interface, status, scanner_id, *app_uuid));
      RegisterScannerCallback(g_interface, status, scanner_id, *app_uuid));
}
}


void ScanResultCallback(bt_bdaddr_t* bda, int rssi,
void ScanResultCallback(
                        vector<uint8_t> adv_data) {  // NOLINT(pass-by-value)
    bt_bdaddr_t* bda, int rssi,
    std::vector<uint8_t> adv_data) {  // NOLINT(pass-by-value)
  shared_lock<shared_mutex_impl> lock(g_instance_lock);
  shared_lock<shared_mutex_impl> lock(g_instance_lock);
  VERIFY_INTERFACE_OR_RETURN();
  VERIFY_INTERFACE_OR_RETURN();
  CHECK(bda);
  CHECK(bda);
@@ -252,7 +253,7 @@ void ConnectionCallback(int conn_id, int server_if, int connected,


void ServiceAddedCallback(
void ServiceAddedCallback(
    int status, int server_if,
    int status, int server_if,
    vector<btgatt_db_element_t> service) {  // NOLINT(pass-by-value)
    std::vector<btgatt_db_element_t> service) {  // NOLINT(pass-by-value)
  shared_lock<shared_mutex_impl> lock(g_instance_lock);
  shared_lock<shared_mutex_impl> lock(g_instance_lock);
  VLOG(2) << __func__ << " - status: " << status << " server_if: " << server_if
  VLOG(2) << __func__ << " - status: " << status << " server_if: " << server_if
          << " count: " << service.size();
          << " count: " << service.size();
@@ -313,7 +314,7 @@ void RequestReadDescriptorCallback(int conn_id, int trans_id, bt_bdaddr_t* bda,
void RequestWriteCharacteristicCallback(int conn_id, int trans_id,
void RequestWriteCharacteristicCallback(int conn_id, int trans_id,
                                        bt_bdaddr_t* bda, int attr_handle,
                                        bt_bdaddr_t* bda, int attr_handle,
                                        int offset, bool need_rsp, bool is_prep,
                                        int offset, bool need_rsp, bool is_prep,
                                        vector<uint8_t> value) {
                                        std::vector<uint8_t> value) {
  shared_lock<shared_mutex_impl> lock(g_instance_lock);
  shared_lock<shared_mutex_impl> lock(g_instance_lock);
  VLOG(2) << __func__ << " - conn_id: " << conn_id << " trans_id: " << trans_id
  VLOG(2) << __func__ << " - conn_id: " << conn_id << " trans_id: " << trans_id
          << " attr_handle: " << attr_handle << " offset: " << offset
          << " attr_handle: " << attr_handle << " offset: " << offset
@@ -330,7 +331,7 @@ void RequestWriteCharacteristicCallback(int conn_id, int trans_id,
void RequestWriteDescriptorCallback(
void RequestWriteDescriptorCallback(
    int conn_id, int trans_id, bt_bdaddr_t* bda, int attr_handle, int offset,
    int conn_id, int trans_id, bt_bdaddr_t* bda, int attr_handle, int offset,
    bool need_rsp, bool is_prep,
    bool need_rsp, bool is_prep,
    vector<uint8_t> value) {  // NOLINT(pass-by-value)
    std::vector<uint8_t> value) {  // NOLINT(pass-by-value)
  shared_lock<shared_mutex_impl> lock(g_instance_lock);
  shared_lock<shared_mutex_impl> lock(g_instance_lock);
  VLOG(2) << __func__ << " - conn_id: " << conn_id << " trans_id: " << trans_id
  VLOG(2) << __func__ << " - conn_id: " << conn_id << " trans_id: " << trans_id
          << " attr_handle: " << attr_handle << " offset: " << offset
          << " attr_handle: " << attr_handle << " offset: " << offset
@@ -581,7 +582,8 @@ void BluetoothGattInterface::ScannerObserver::RegisterScannerCallback(


void BluetoothGattInterface::ScannerObserver::ScanResultCallback(
void BluetoothGattInterface::ScannerObserver::ScanResultCallback(
    BluetoothGattInterface* /* gatt_iface */, const bt_bdaddr_t& /* bda */,
    BluetoothGattInterface* /* gatt_iface */, const bt_bdaddr_t& /* bda */,
    int /* rssi */, vector<uint8_t> /* adv_data */) {  // NOLINT(pass-by-value)
    int /* rssi */,
    std::vector<uint8_t> /* adv_data */) {  // NOLINT(pass-by-value)
  // Do Nothing.
  // Do Nothing.
}
}


@@ -672,7 +674,7 @@ void BluetoothGattInterface::ServerObserver::ConnectionCallback(
void BluetoothGattInterface::ServerObserver::ServiceAddedCallback(
void BluetoothGattInterface::ServerObserver::ServiceAddedCallback(
    BluetoothGattInterface* /* gatt_iface */, int /* status */,
    BluetoothGattInterface* /* gatt_iface */, int /* status */,
    int /* server_if */,
    int /* server_if */,
    vector<btgatt_db_element_t> /* service */) {  // NOLINT(pass-by-value)
    std::vector<btgatt_db_element_t> /* service */) {  // NOLINT(pass-by-value)
  // Do nothing.
  // Do nothing.
}
}


@@ -706,7 +708,7 @@ void BluetoothGattInterface::ServerObserver::RequestWriteCharacteristicCallback(
    BluetoothGattInterface* /* gatt_iface */, int /* conn_id */,
    BluetoothGattInterface* /* gatt_iface */, int /* conn_id */,
    int /* trans_id */, const bt_bdaddr_t& /* bda */, int /* attr_handle */,
    int /* trans_id */, const bt_bdaddr_t& /* bda */, int /* attr_handle */,
    int /* offset */, bool /* need_rsp */, bool /* is_prep */,
    int /* offset */, bool /* need_rsp */, bool /* is_prep */,
    vector<uint8_t> /* value */) {  // NOLINT(pass-by-value)
    std::vector<uint8_t> /* value */) {  // NOLINT(pass-by-value)
  // Do nothing.
  // Do nothing.
}
}


@@ -714,7 +716,7 @@ void BluetoothGattInterface::ServerObserver::RequestWriteDescriptorCallback(
    BluetoothGattInterface* /* gatt_iface */, int /* conn_id */,
    BluetoothGattInterface* /* gatt_iface */, int /* conn_id */,
    int /* trans_id */, const bt_bdaddr_t& /* bda */, int /* attr_handle */,
    int /* trans_id */, const bt_bdaddr_t& /* bda */, int /* attr_handle */,
    int /* offset */, bool /* need_rsp */, bool /* is_prep */,
    int /* offset */, bool /* need_rsp */, bool /* is_prep */,
    vector<uint8_t> /* value */) {  // NOLINT(pass-by-value)
    std::vector<uint8_t> /* value */) {  // NOLINT(pass-by-value)
  // Do nothing.
  // Do nothing.
}
}


+4 −4
Original line number Original line Diff line number Diff line
@@ -58,7 +58,7 @@ class BluetoothGattInterface {


    virtual void ScanResultCallback(
    virtual void ScanResultCallback(
        BluetoothGattInterface* gatt_iface, const bt_bdaddr_t& bda, int rssi,
        BluetoothGattInterface* gatt_iface, const bt_bdaddr_t& bda, int rssi,
        vector<uint8_t> adv_data);  // NOLINT(pass-by-value)
        std::vector<uint8_t> adv_data);  // NOLINT(pass-by-value)
  };
  };


  // The standard BT-GATT client callback interface.
  // The standard BT-GATT client callback interface.
@@ -130,7 +130,7 @@ class BluetoothGattInterface {


    virtual void ServiceAddedCallback(
    virtual void ServiceAddedCallback(
        BluetoothGattInterface* gatt_iface, int status, int server_if,
        BluetoothGattInterface* gatt_iface, int status, int server_if,
        vector<btgatt_db_element_t> service);  // NOLINT(pass-by-value)
        std::vector<btgatt_db_element_t> service);  // NOLINT(pass-by-value)


    virtual void ServiceStoppedCallback(BluetoothGattInterface* gatt_iface,
    virtual void ServiceStoppedCallback(BluetoothGattInterface* gatt_iface,
                                        int status, int server_if,
                                        int status, int server_if,
@@ -152,13 +152,13 @@ class BluetoothGattInterface {
        BluetoothGattInterface* gatt_iface, int conn_id, int trans_id,
        BluetoothGattInterface* gatt_iface, int conn_id, int trans_id,
        const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
        const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
        bool is_prep,
        bool is_prep,
        vector<uint8_t> value);  // NOLINT(pass-by-value)
        std::vector<uint8_t> value);  // NOLINT(pass-by-value)


    virtual void RequestWriteDescriptorCallback(
    virtual void RequestWriteDescriptorCallback(
        BluetoothGattInterface* gatt_iface, int conn_id, int trans_id,
        BluetoothGattInterface* gatt_iface, int conn_id, int trans_id,
        const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
        const bt_bdaddr_t& bda, int attr_handle, int offset, bool need_rsp,
        bool is_prep,
        bool is_prep,
        vector<uint8_t> value);  // NOLINT(pass-by-alue)
        std::vector<uint8_t> value);  // NOLINT(pass-by-alue)


    virtual void RequestExecWriteCallback(BluetoothGattInterface* gatt_iface,
    virtual void RequestExecWriteCallback(BluetoothGattInterface* gatt_iface,
                                          int conn_id, int trans_id,
                                          int conn_id, int trans_id,
Loading