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

Commit 540485b9 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Android (Google) Code Review
Browse files

Merge "AVRCP: Reject invalid PlayItem and SetAddressedPlayer command" into pi-dev

parents 08b442e1 7c84603f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -126,8 +126,8 @@ void Device::VendorPacketHandler(uint8_t label,
      // this currently since the current implementation only has one
      // player and the player will never change, but we need it for a
      // more complete implementation.
      auto response =
          SetAddressedPlayerResponseBuilder::MakeBuilder(Status::NO_ERROR);
      auto response = RejectBuilder::MakeBuilder(
          CommandPdu::SET_ADDRESSED_PLAYER, Status::INVALID_PLAYER_ID);
      send_message(label, false, std::move(response));
    } break;

@@ -605,8 +605,8 @@ void Device::HandlePlayItem(uint8_t label,

  if (media_id == "") {
    DEVICE_VLOG(2) << "Could not find item";
    auto response =
        PlayItemResponseBuilder::MakeBuilder(Status::DOES_NOT_EXIST);
    auto response = RejectBuilder::MakeBuilder(CommandPdu::PLAY_ITEM,
                                               Status::DOES_NOT_EXIST);
    send_message(label, false, std::move(response));
    return;
  }
+2 −2
Original line number Diff line number Diff line
@@ -713,8 +713,8 @@ TEST_F(AvrcpDeviceTest, setAddressedPlayerTest) {

  test_device->RegisterInterfaces(&interface, &a2dp_interface, nullptr);

  auto set_addr_player_rsp =
      SetAddressedPlayerResponseBuilder::MakeBuilder(Status::NO_ERROR);
  auto set_addr_player_rsp = RejectBuilder::MakeBuilder(
      CommandPdu::SET_ADDRESSED_PLAYER, Status::INVALID_PLAYER_ID);

  EXPECT_CALL(response_cb,
              Call(1, false, matchPacket(std::move(set_addr_player_rsp))))