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

Commit db10511e authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Automerger Merge Worker
Browse files

Merge changes I99a4a5c2,I3886ed03 am: ec296799

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1897164

Change-Id: Id8cb4c8f5a8f2d5082392fe112689a64bd66d0e0
parents 897a466d ec296799
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -656,10 +656,8 @@ bt_status_t btif_storage_get_adapter_property(bt_property_t* property) {
        "Property:BT_PROPERTY_ADAPTER_BONDED_DEVICES",
        "Property:BT_PROPERTY_ADAPTER_BONDED_DEVICES",
        __func__, bonded_devices.num_devices);
        __func__, bonded_devices.num_devices);


    if (bonded_devices.num_devices > 0) {
    property->len = bonded_devices.num_devices * RawAddress::kLength;
    property->len = bonded_devices.num_devices * RawAddress::kLength;
    memcpy(property->val, bonded_devices.devices, property->len);
    memcpy(property->val, bonded_devices.devices, property->len);
    }


    /* if there are no bonded_devices, then length shall be 0 */
    /* if there are no bonded_devices, then length shall be 0 */
    return BT_STATUS_SUCCESS;
    return BT_STATUS_SUCCESS;
+22 −3
Original line number Original line Diff line number Diff line
@@ -178,10 +178,29 @@ struct HciLayer::impl {
               OpCodeText(op_code).c_str());
               OpCodeText(op_code).c_str());
    ASSERT_LOG(waiting_command_ == op_code, "Waiting for 0x%02hx (%s), got 0x%02hx (%s)", waiting_command_,
    ASSERT_LOG(waiting_command_ == op_code, "Waiting for 0x%02hx (%s), got 0x%02hx (%s)", waiting_command_,
               OpCodeText(waiting_command_).c_str(), op_code, OpCodeText(op_code).c_str());
               OpCodeText(waiting_command_).c_str(), op_code, OpCodeText(op_code).c_str());
    ASSERT_LOG(command_queue_.front().waiting_for_status_ == is_status, "0x%02hx (%s) was not expecting %s event",

               op_code, OpCodeText(op_code).c_str(), logging_id.c_str());
    bool is_vendor_specific = static_cast<int>(op_code) & (0x3f << 10);
    CommandStatusView status_view = CommandStatusView::Create(event);
    if (is_vendor_specific && (is_status && !command_queue_.front().waiting_for_status_) &&
        (status_view.IsValid() && status_view.GetStatus() == ErrorCode::UNKNOWN_HCI_COMMAND)) {
      // If this is a command status of a vendor specific command, and command complete is expected, we can't treat
      // this as hard failure since we have no way of probing this lack of support at earlier time. Instead we let
      // the command complete handler handle a empty Command Complete packet, which will be interpreted as invalid
      // response.
      CommandCompleteView command_complete_view = CommandCompleteView::Create(
          EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
      command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(move(command_complete_view));
    } else {
      ASSERT_LOG(
          command_queue_.front().waiting_for_status_ == is_status,
          "0x%02hx (%s) was not expecting %s event",
          op_code,
          OpCodeText(op_code).c_str(),
          logging_id.c_str());


      command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
      command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
    }

    command_queue_.pop_front();
    command_queue_.pop_front();
    waiting_command_ = OpCode::NONE;
    waiting_command_ = OpCode::NONE;
    if (hci_timeout_alarm_ != nullptr) {
    if (hci_timeout_alarm_ != nullptr) {