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

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

Snap for 5831531 from 6a9f9594 to rvc-release

Change-Id: I2cd19dda857a4f9c5566baab71c912c99862f767
parents ee42c3c1 6a9f9594
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -83,10 +83,6 @@ cc_defaults {
            clang_cflags: [
                "-fprofile-instr-generate",
                "-fcoverage-mapping",

                // New pass manager does not work with -fprofile-instr-generate yet.
                // http://b/131132095
                "-fno-experimental-new-pass-manager",
            ],
        },
    },
@@ -105,10 +101,6 @@ cc_defaults {
            ldflags: [
                "-fprofile-instr-generate",
                "-fcoverage-mapping",

                // New pass manager does not work with -fprofile-instr-generate yet.
                // http://b/131132095
                "-fno-experimental-new-pass-manager",
            ],
        },
    },
+0 −8
Original line number Diff line number Diff line
@@ -49,10 +49,6 @@ cc_defaults {
            clang_cflags: [
                "-fprofile-instr-generate",
                "-fcoverage-mapping",

                // New pass manager does not work with -fprofile-instr-generate yet.
                // http://b/131132095
                "-fno-experimental-new-pass-manager",
            ],
        },
    },
@@ -71,10 +67,6 @@ cc_defaults {
            ldflags: [
                "-fprofile-instr-generate",
                "-fcoverage-mapping",

                // New pass manager does not work with -fprofile-instr-generate yet.
                // http://b/131132095
                "-fno-experimental-new-pass-manager",
            ],
        },
    },
+0 −4
Original line number Diff line number Diff line
filegroup {
    name: "BluetoothCommonSources",
    srcs: [
        "address.cc",
        "class_of_device.cc",
        "link_key.cc",
    ],
}
@@ -10,9 +8,7 @@ filegroup {
filegroup {
    name: "BluetoothCommonTestSources",
    srcs: [
        "address_unittest.cc",
        "blocking_queue_unittest.cc",
        "class_of_device_unittest.cc",
        "bidi_queue_unittest.cc",
        "observer_registry_test.cc",
        "link_key_unittest.cc",
+10 −0
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@ filegroup {
        "acl_manager.cc",
        "classic_security_manager.cc",
        "controller.cc",
        "address.cc",
        "class_of_device.cc",
        "device.cc",
        "device_database.cc",
        "hci_layer.cc",
    ],
}
@@ -15,7 +19,13 @@ filegroup {
        "acl_manager_test.cc",
        "classic_security_manager_test.cc",
        "controller_test.cc",
        "address_unittest.cc",
        "class_of_device_unittest.cc",
        "device_test.cc",
        "device_database_test.cc",
        "dual_device_test.cc",
        "hci_layer_test.cc",
        "hci_packets_test.cc",
    ],
}

+10 −10
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ struct AclManager::impl {
        common::Bind(&impl::incoming_acl_credits, common::Unretained(this)), handler_);

    // TODO: determine when we should reject connection
    should_accept_connection_ = common::Bind([](common::Address, common::ClassOfDevice) { return true; });
    should_accept_connection_ = common::Bind([](Address, ClassOfDevice) { return true; });
    hci_queue_end_ = hci_layer_->GetAclQueueEnd();
    hci_queue_end_->RegisterDequeue(
        handler_, common::Bind(&impl::dequeue_and_route_acl_packet_to_connection, common::Unretained(this)));
@@ -204,7 +204,7 @@ struct AclManager::impl {
  void on_incoming_connection(EventPacketView packet) {
    ConnectionRequestView request = ConnectionRequestView::Create(packet);
    ASSERT(request.IsValid());
    common::Address address = request.GetBdAddr();
    Address address = request.GetBdAddr();
    if (client_callbacks_ == nullptr) {
      LOG_ERROR("No callbacks to call");
      auto reason = RejectConnectionReason::LIMITED_RESOURCES;
@@ -267,7 +267,7 @@ struct AclManager::impl {
    }
  }

  void create_connection(common::Address address) {
  void create_connection(Address address) {
    // TODO: Configure default connection parameters?
    uint16_t packet_type = 0x4408 /* DM 1,3,5 */ | 0x8810 /*DH 1,3,5 */;
    PageScanRepetitionMode page_scan_repetition_mode = PageScanRepetitionMode::R1;
@@ -287,7 +287,7 @@ struct AclManager::impl {
                               handler_);
  }

  void cancel_connect(common::Address address) {
  void cancel_connect(Address address) {
    auto connecting_addr = connecting_.find(address);
    if (connecting_addr == connecting_.end()) {
      LOG_INFO("Cannot cancel non-existent connection to %s", address.ToString().c_str());
@@ -299,7 +299,7 @@ struct AclManager::impl {
                               handler_);
  }

  void accept_connection(common::Address address) {
  void accept_connection(Address address) {
    auto role = AcceptConnectionRequestRole::BECOME_MASTER;  // We prefer to be master
    hci_layer_->EnqueueCommand(AcceptConnectionRequestBuilder::Create(address, role),
                               common::BindOnce(&impl::on_accept_connection_status, common::Unretained(this), address),
@@ -323,7 +323,7 @@ struct AclManager::impl {
    acl_connections_.erase(handle);
  }

  void on_accept_connection_status(common::Address address, CommandStatusView status) {
  void on_accept_connection_status(Address address, CommandStatusView status) {
    auto accept_status = AcceptConnectionRequestStatusView::Create(status);
    ASSERT(accept_status.IsValid());
    if (status.GetStatus() != ErrorCode::SUCCESS) {
@@ -398,8 +398,8 @@ struct AclManager::impl {
  os::Handler* client_handler_ = nullptr;
  common::BidiQueueEnd<AclPacketBuilder, AclPacketView>* hci_queue_end_ = nullptr;
  std::map<uint16_t, AclManager::acl_connection> acl_connections_;
  std::set<common::Address> connecting_;
  common::Callback<bool(common::Address, common::ClassOfDevice)> should_accept_connection_;
  std::set<Address> connecting_;
  common::Callback<bool(Address, ClassOfDevice)> should_accept_connection_;
};

AclConnection::QueueUpEnd* AclConnection::GetAclQueueEnd() const {
@@ -428,11 +428,11 @@ bool AclManager::RegisterCallbacks(ConnectionCallbacks* callbacks, os::Handler*
  return true;
}

void AclManager::CreateConnection(common::Address address) {
void AclManager::CreateConnection(Address address) {
  GetHandler()->Post(common::BindOnce(&impl::create_connection, common::Unretained(pimpl_.get()), address));
}

void AclManager::CancelConnect(common::Address address) {
void AclManager::CancelConnect(Address address) {
  GetHandler()->Post(BindOnce(&impl::cancel_connect, common::Unretained(pimpl_.get()), address));
}

Loading