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

Commit bd11c96f authored by Antoine Soulier's avatar Antoine Soulier
Browse files

Revert "bt_snoop: Add intermediate copy preventing source packet..."

Revert submission 3057587

Reason for revert: b/336882228 

Reverted changes: /q/submissionid:3057587

Change-Id: I427293c692c312c3db59f04df37e23071f29d252
parent 36c82f7e
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -1187,11 +1187,7 @@ void SnoopLogger::FilterCapturedPacket(
  }
}

void SnoopLogger::Capture(const HciPacket& immutable_packet, Direction direction, PacketType type) {
  //// TODO(b/335520123) update FilterCapture to stop modifying packets ////
  HciPacket mutable_packet(immutable_packet);
  HciPacket& packet = mutable_packet;
  //////////////////////////////////////////////////////////////////////////
void SnoopLogger::Capture(HciPacket& packet, Direction direction, PacketType type) {
  uint64_t timestamp_us =
      std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch())
          .count();
+1 −1
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ class SnoopLogger : public ::bluetooth::Module {
    OUTGOING,
  };

  void Capture(const HciPacket& packet, Direction direction, PacketType type);
  void Capture(HciPacket& packet, Direction direction, PacketType type);

  // Set a L2CAP channel as acceptlisted, allowing packets with that L2CAP CID
  // to show up in the snoop logs.
+1 −8
Original line number Diff line number Diff line
@@ -1599,13 +1599,6 @@ TEST_F(SnoopLoggerModuleTest, custom_socket_profiles_filtered_hfp_hf_test) {
      0x35, 0x36, 0x37, 0x38, 0x39, 0x22, 0x2c, 0x31, 0x34, 0x35, 0x0d, 0x0a, 0x49,
  };

  std::vector<uint8_t> kExpectedPhoneNumber = {
      0x0b, 0x00, 0x30, 0x00, 0x0c, 0x00, 0x40, 0x30, 0x19, 0xff, 0x4f, 0x01, 0x0d,
      0x0a, 0x2b, 0x43, 0x4c, 0x43, 0x43, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  };

  // Set pbap and map filtering modes
  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
@@ -1688,7 +1681,7 @@ TEST_F(SnoopLoggerModuleTest, custom_socket_profiles_filtered_hfp_hf_test) {
  ASSERT_TRUE(
      std::memcmp(recv_buf1, &SnoopLoggerCommon::kBtSnoopFileHeader, sizeof(recv_buf1)) == 0);
  ASSERT_EQ(bytes_read, static_cast<int>(expected_data_size));
  ASSERT_TRUE(std::memcmp(recv_buf3, kExpectedPhoneNumber.data(), expected_data_size) == 0);
  ASSERT_TRUE(std::memcmp(recv_buf3, kPhoneNumber.data(), expected_data_size) == 0);

  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,