SnoopLogger: Refactor after separating filter properties

Bug: 247859568
Tag: #feature
Test: atest BluetoothInstrumentationTests
Test: atest bluetooth_test_gd_unit
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Ic844487f253b850e227f020f2172a21242c5e47a
diff --git a/system/bta/av/bta_av_aact.cc b/system/bta/av/bta_av_aact.cc
index 418995a..20f4f5b 100644
--- a/system/bta/av/bta_av_aact.cc
+++ b/system/bta/av/bta_av_aact.cc
@@ -1245,9 +1245,7 @@
         .sep = AVDT_TSEP_INVALID,
     };
 
-    if (p_scb) {
-      L2CA_SetMediaStreamChannel(p_scb->l2c_cid, true);
-    }
+    L2CA_SetMediaStreamChannel(p_scb->l2c_cid, true);
 
     p = BTM_ReadRemoteFeatures(p_scb->PeerAddress());
     if (p != NULL) {
@@ -2479,9 +2477,7 @@
     BTM_default_unblock_role_switch();
   }
 
-  if (p_scb) {
-    L2CA_SetMediaStreamChannel(p_scb->l2c_cid, false);
-  }
+  L2CA_SetMediaStreamChannel(p_scb->l2c_cid, false);
 
   if (p_scb->open_status != BTA_AV_SUCCESS) {
     /* must be failure when opening the stream */
diff --git a/system/gd/hal/snoop_logger.cc b/system/gd/hal/snoop_logger.cc
index e3037df..6e97abd 100644
--- a/system/gd/hal/snoop_logger.cc
+++ b/system/gd/hal/snoop_logger.cc
@@ -308,8 +308,7 @@
 std::mutex a2dpMediaChannels_mutex;
 std::vector<SnoopLogger::A2dpMediaChannel> a2dpMediaChannels;
 
-std::mutex filter_types_mutex;
-std::mutex snoop_log_filter_profiles_mutex;
+std::mutex snoop_log_filters_mutex;
 
 std::mutex profiles_filter_mutex;
 std::unordered_map<int16_t, ProfilesFilter> profiles_filter_table;
@@ -437,12 +436,21 @@
 const std::string SnoopLogger::kBtSnoopLogModeProperty = "persist.bluetooth.btsnooplogmode";
 const std::string SnoopLogger::kBtSnoopDefaultLogModeProperty = "persist.bluetooth.btsnoopdefaultmode";
 const std::string SnoopLogger::kBtSnoopLogPersists = "persist.bluetooth.btsnooplogpersists";
-const std::string SnoopLogger::kBtSnoopLogFilterTypesProperty =
-    "persist.bluetooth.btsnooplogfilter.types";
-const std::string SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty =
-    "persist.bluetooth.btsnooplogfilter.profiles.pbap";
-const std::string SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty =
-    "persist.bluetooth.btsnooplogfilter.profiles.map";
+// Truncates ACL packets (non-fragment) to fixed (MAX_HCI_ACL_LEN) number of bytes
+const std::string SnoopLogger::kBtSnoopLogFilterHeadersProperty =
+    "persist.bluetooth.snooplogfilter.headers.enabled";
+// Discards A2DP media packets (non-split mode)
+const std::string SnoopLogger::kBtSnoopLogFilterProfileA2dpProperty =
+    "persist.bluetooth.snooplogfilter.profiles.a2dp.enabled";
+// Filters MAP packets based on the filter mode
+const std::string SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty =
+    "persist.bluetooth.snooplogfilter.profiles.map";
+// Filters PBAP and HFP packets (CPBR, CLCC) based on the filter mode
+const std::string SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty =
+    "persist.bluetooth.snooplogfilter.profiles.pbap";
+// Truncates RFCOMM UIH packet to fixed (L2CAP_HEADER_SIZE) number of bytes
+const std::string SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty =
+    "persist.bluetooth.snooplogfilter.profiles.rfcomm.enabled";
 const std::string SnoopLogger::kSoCManufacturerProperty = "ro.soc.manufacturer";
 
 // persist.bluetooth.btsnooplogmode
@@ -451,30 +459,14 @@
 const std::string SnoopLogger::kBtSnoopLogModeFull = "full";
 // ro.soc.manufacturer
 const std::string SnoopLogger::kSoCManufacturerQualcomm = "Qualcomm";
-/*
- * persist.bluetooth.btsnooplogfilter.types
- *  rfcommchannelfiltered - Truncates RFCOMM UIH packet to fixed (L2CAP_HEADER_SIZE)
- *                          number of bytes
- *  snoopheadersfiltered  - Truncates ACL packets (non-fragment) to fixed (MAX_HCI_ACL_LEN)
- *                          number of bytes
- *  a2dppktsfiltered      - Discards A2DP media packets (non-split mode)
- *  profilesfiltered      - Filters PBAP, MAP and HFP packets (CPBR, CLCC) based on
- *                          filter mode:
- *                            fullfilter - discard whole packet
- *                            header     - truncate to fixed length
- *                            magic      - fill with a magic string, such as: "PROHIBITED"
- */
-const std::string SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered = "rfcommchannelfiltered";
-const std::string SnoopLogger::kBtSnoopLogFilterTypeHeadersFiltered = "snoopheadersfiltered";
-const std::string SnoopLogger::kBtSnoopLogFilterTypeA2dpPktsFiltered = "a2dppktsfiltered";
-const std::string SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered = "profilesfiltered";
-// Currently supported profiles
-const std::string SnoopLogger::kBtSnoopLogFilterProfilePbap = "pbap";
-const std::string SnoopLogger::kBtSnoopLogFilterProfileMap = "map";
-// persist.bluetooth.btsnooplogfilter.profiles.pbap / .map
+
+// PBAP, MAP and HFP packets filter mode - discard whole packet
 const std::string SnoopLogger::kBtSnoopLogFilterProfileModeFullfillter = "fullfilter";
+// PBAP, MAP and HFP packets filter mode - truncate to fixed length
 const std::string SnoopLogger::kBtSnoopLogFilterProfileModeHeader = "header";
+// PBAP, MAP and HFP packets filter mode - fill with a magic string, such as: "PROHIBITED"
 const std::string SnoopLogger::kBtSnoopLogFilterProfileModeMagic = "magic";
+// PBAP, MAP and HFP packets filter mode - disabled
 const std::string SnoopLogger::kBtSnoopLogFilterProfileModeDisabled = "disabled";
 
 std::string SnoopLogger::btsnoop_mode_;
@@ -587,85 +579,52 @@
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered) {
     return;
   }
-
-  std::lock_guard<std::mutex> lock(filter_types_mutex);
-  auto filter_types_prop = os::GetSystemProperty(kBtSnoopLogFilterTypesProperty);
-  if (filter_types_prop) {
-    LOG_INFO("filter_types_prop: %s", filter_types_prop.value().c_str());
-    for (auto itr = kBtSnoopLogFilterTypes.begin(); itr != kBtSnoopLogFilterTypes.end(); itr++) {
-      if (filter_types_prop->find(itr->name) != std::string::npos) {
-        itr->enabled = true;
-
-        if (itr->name == kBtSnoopLogFilterTypeProfilesFiltered) {
-          SnoopLogger::EnableProfilesFilters();
-        }
-      } else {
-        itr->enabled = false;
-      }
-      LOG_INFO("%s, %d", itr->name.c_str(), itr->enabled);
+  std::lock_guard<std::mutex> lock(snoop_log_filters_mutex);
+  for (auto itr = kBtSnoopLogFilterState.begin(); itr != kBtSnoopLogFilterState.end(); itr++) {
+    auto filter_enabled_property = os::GetSystemProperty(itr->first);
+    if (filter_enabled_property) {
+      itr->second = filter_enabled_property.value() == "true";
     }
+    LOG_INFO("%s: %d", itr->first.c_str(), itr->second);
+  }
+  for (auto itr = kBtSnoopLogFilterMode.begin(); itr != kBtSnoopLogFilterMode.end(); itr++) {
+    auto filter_mode_property = os::GetSystemProperty(itr->first);
+    if (filter_mode_property) {
+      itr->second = filter_mode_property.value();
+    } else {
+      itr->second = SnoopLogger::kBtSnoopLogFilterProfileModeDisabled;
+    }
+    LOG_INFO("%s: %s", itr->first.c_str(), itr->second.c_str());
   }
 }
 
 void SnoopLogger::DisableFilters() {
-  std::lock_guard<std::mutex> lock(filter_types_mutex);
-  for (auto itr = kBtSnoopLogFilterTypes.begin(); itr != kBtSnoopLogFilterTypes.end(); itr++) {
-    itr->enabled = false;
-    LOG_DEBUG("%s, %d", itr->name.c_str(), itr->enabled);
-    if (itr->name == kBtSnoopLogFilterTypeProfilesFiltered) {
-      SnoopLogger::DisableProfilesFilters();
-    }
+  std::lock_guard<std::mutex> lock(snoop_log_filters_mutex);
+  for (auto itr = kBtSnoopLogFilterState.begin(); itr != kBtSnoopLogFilterState.end(); itr++) {
+    itr->second = false;
+    LOG_INFO("%s, %d", itr->first.c_str(), itr->second);
+  }
+  for (auto itr = kBtSnoopLogFilterMode.begin(); itr != kBtSnoopLogFilterMode.end(); itr++) {
+    itr->second = SnoopLogger::kBtSnoopLogFilterProfileModeDisabled;
+    LOG_INFO("%s, %s", itr->first.c_str(), itr->second.c_str());
   }
 }
 
 bool SnoopLogger::IsFilterEnabled(std::string filter_name) {
-  std::lock_guard<std::mutex> lock(filter_types_mutex);
-
-  for (auto itr = kBtSnoopLogFilterTypes.begin(); itr != kBtSnoopLogFilterTypes.end(); itr++) {
-    if (filter_name == itr->name) {
-      return itr->enabled == true;
+  std::lock_guard<std::mutex> lock(snoop_log_filters_mutex);
+  for (auto itr = kBtSnoopLogFilterState.begin(); itr != kBtSnoopLogFilterState.end(); itr++) {
+    if (filter_name == itr->first) {
+      return itr->second == true;
     }
   }
-
+  for (auto itr = kBtSnoopLogFilterMode.begin(); itr != kBtSnoopLogFilterMode.end(); itr++) {
+    if (filter_name == itr->first) {
+      return itr->second != SnoopLogger::kBtSnoopLogFilterProfileModeDisabled;
+    }
+  }
   return false;
 }
 
-void SnoopLogger::EnableProfilesFilters() {
-  if (btsnoop_mode_ != kBtSnoopLogModeFiltered) {
-    return;
-  }
-
-  std::lock_guard<std::mutex> lock(snoop_log_filter_profiles_mutex);
-
-  auto profile_pbap_mode =
-      os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty);
-  if (profile_pbap_mode) {
-    LOG_DEBUG("profile_pbap_mode: %s", profile_pbap_mode.value().c_str());
-    kBtSnoopLogFilterProfiles[SnoopLogger::kBtSnoopLogFilterProfilePbap] =
-        profile_pbap_mode.value();
-  } else {
-    kBtSnoopLogFilterProfiles[SnoopLogger::kBtSnoopLogFilterProfilePbap] =
-        kBtSnoopLogFilterProfileModeDisabled;
-  }
-
-  auto profile_map_mode =
-      os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty);
-  if (profile_map_mode) {
-    LOG_DEBUG("profile_map_mode: %s", profile_map_mode.value().c_str());
-    kBtSnoopLogFilterProfiles[SnoopLogger::kBtSnoopLogFilterProfileMap] = profile_map_mode.value();
-  } else {
-    kBtSnoopLogFilterProfiles[SnoopLogger::kBtSnoopLogFilterProfileMap] =
-        kBtSnoopLogFilterProfileModeDisabled;
-  }
-}
-
-void SnoopLogger::DisableProfilesFilters() {
-  for (auto itr = kBtSnoopLogFilterProfiles.begin(); itr != kBtSnoopLogFilterProfiles.end();
-       itr++) {
-    itr->second = SnoopLogger::kBtSnoopLogFilterProfileModeDisabled;
-  }
-}
-
 bool SnoopLogger::ShouldFilterLog(bool is_received, uint8_t* packet) {
   uint16_t conn_handle =
       ((((uint16_t)packet[ACL_CHANNEL_OFFSET + 1]) << 8) + packet[ACL_CHANNEL_OFFSET]) & 0x0fff;
@@ -728,15 +687,17 @@
       ProfilesFilter::ProfileToString(current_profile).c_str(),
       hdr_len,
       pl_len);
-  std::lock_guard<std::mutex> lock(snoop_log_filter_profiles_mutex);
+  std::lock_guard<std::mutex> lock(snoop_log_filters_mutex);
   switch (current_profile) {
     case FILTER_PROFILE_PBAP:
     case FILTER_PROFILE_HFP_HF:
     case FILTER_PROFILE_HFP_HS:
-      profile_filter_mode = kBtSnoopLogFilterProfiles[SnoopLogger::kBtSnoopLogFilterProfilePbap];
+      profile_filter_mode =
+          kBtSnoopLogFilterMode[SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty];
       break;
     case FILTER_PROFILE_MAP:
-      profile_filter_mode = kBtSnoopLogFilterProfiles[SnoopLogger::kBtSnoopLogFilterProfileMap];
+      profile_filter_mode =
+          kBtSnoopLogFilterMode[SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty];
       break;
     default:
       profile_filter_mode = kBtSnoopLogFilterProfileModeDisabled;
@@ -917,7 +878,7 @@
 void SnoopLogger::AcceptlistL2capChannel(
     uint16_t conn_handle, uint16_t local_cid, uint16_t remote_cid) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeRfcommChannelFiltered)) {
+      !IsFilterEnabled(kBtSnoopLogFilterProfileRfcommProperty)) {
     return;
   }
 
@@ -935,7 +896,7 @@
 
 void SnoopLogger::AcceptlistRfcommDlci(uint16_t conn_handle, uint16_t local_cid, uint8_t dlci) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeRfcommChannelFiltered)) {
+      !IsFilterEnabled(kBtSnoopLogFilterProfileRfcommProperty)) {
     return;
   }
 
@@ -948,7 +909,7 @@
 void SnoopLogger::AddRfcommL2capChannel(
     uint16_t conn_handle, uint16_t local_cid, uint16_t remote_cid) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeRfcommChannelFiltered)) {
+      !IsFilterEnabled(kBtSnoopLogFilterProfileRfcommProperty)) {
     return;
   }
 
@@ -966,7 +927,7 @@
 void SnoopLogger::ClearL2capAcceptlist(
     uint16_t conn_handle, uint16_t local_cid, uint16_t remote_cid) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeRfcommChannelFiltered)) {
+      !IsFilterEnabled(kBtSnoopLogFilterProfileRfcommProperty)) {
     return;
   }
 
@@ -982,7 +943,7 @@
 
 bool SnoopLogger::IsA2dpMediaChannel(uint16_t conn_handle, uint16_t cid, bool is_local_cid) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeA2dpPktsFiltered)) {
+      !IsFilterEnabled(kBtSnoopLogFilterProfileA2dpProperty)) {
     return false;
   }
 
@@ -1016,7 +977,7 @@
 void SnoopLogger::AddA2dpMediaChannel(
     uint16_t conn_handle, uint16_t local_cid, uint16_t remote_cid) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeA2dpPktsFiltered)) {
+      !IsFilterEnabled(kBtSnoopLogFilterProfileA2dpProperty)) {
     return;
   }
 
@@ -1033,7 +994,7 @@
 
 void SnoopLogger::RemoveA2dpMediaChannel(uint16_t conn_handle, uint16_t local_cid) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeA2dpPktsFiltered)) {
+      !IsFilterEnabled(kBtSnoopLogFilterProfileA2dpProperty)) {
     return;
   }
 
@@ -1051,7 +1012,8 @@
 void SnoopLogger::SetRfcommPortOpen(
     uint16_t conn_handle, uint16_t local_cid, uint8_t dlci, uint16_t uuid, bool flow) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeProfilesFiltered)) {
+      (!IsFilterEnabled(kBtSnoopLogFilterProfilePbapModeProperty) &&
+       !IsFilterEnabled(kBtSnoopLogFilterProfileMapModeProperty))) {
     return;
   }
 
@@ -1060,12 +1022,9 @@
   profile_type_t profile = FILTER_PROFILE_NONE;
   auto& filters = profiles_filter_table[conn_handle];
   {
-    std::lock_guard<std::mutex> lock(snoop_log_filter_profiles_mutex);
     filters.SetupProfilesFilter(
-        kBtSnoopLogFilterProfiles[kBtSnoopLogFilterProfilePbap] !=
-            kBtSnoopLogFilterProfileModeDisabled,
-        kBtSnoopLogFilterProfiles[kBtSnoopLogFilterProfileMap] !=
-            kBtSnoopLogFilterProfileModeDisabled);
+        IsFilterEnabled(kBtSnoopLogFilterProfilePbapModeProperty),
+        IsFilterEnabled(kBtSnoopLogFilterProfileMapModeProperty));
   }
 
   LOG_INFO(
@@ -1099,7 +1058,8 @@
 void SnoopLogger::SetRfcommPortClose(
     uint16_t handle, uint16_t local_cid, uint8_t dlci, uint16_t uuid) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeProfilesFiltered)) {
+      (!IsFilterEnabled(kBtSnoopLogFilterProfilePbapModeProperty) &&
+       !IsFilterEnabled(kBtSnoopLogFilterProfileMapModeProperty))) {
     return;
   }
 
@@ -1124,21 +1084,18 @@
 void SnoopLogger::SetL2capChannelOpen(
     uint16_t handle, uint16_t local_cid, uint16_t remote_cid, uint16_t psm, bool flow) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeProfilesFiltered)) {
+      (!IsFilterEnabled(kBtSnoopLogFilterProfilePbapModeProperty) &&
+       !IsFilterEnabled(kBtSnoopLogFilterProfileMapModeProperty))) {
     return;
   }
 
   std::lock_guard<std::mutex> lock(profiles_filter_mutex);
-
   profile_type_t profile = FILTER_PROFILE_NONE;
   auto& filters = profiles_filter_table[handle];
   {
-    std::lock_guard<std::mutex> lock(snoop_log_filter_profiles_mutex);
     filters.SetupProfilesFilter(
-        kBtSnoopLogFilterProfiles[kBtSnoopLogFilterProfilePbap] !=
-            kBtSnoopLogFilterProfileModeDisabled,
-        kBtSnoopLogFilterProfiles[kBtSnoopLogFilterProfileMap] !=
-            kBtSnoopLogFilterProfileModeDisabled);
+        IsFilterEnabled(kBtSnoopLogFilterProfilePbapModeProperty),
+        IsFilterEnabled(kBtSnoopLogFilterProfileMapModeProperty));
   }
 
   LOG_INFO(
@@ -1169,7 +1126,8 @@
 
 void SnoopLogger::SetL2capChannelClose(uint16_t handle, uint16_t local_cid, uint16_t remote_cid) {
   if (btsnoop_mode_ != kBtSnoopLogModeFiltered ||
-      !IsFilterEnabled(kBtSnoopLogFilterTypeProfilesFiltered)) {
+      (!IsFilterEnabled(kBtSnoopLogFilterProfilePbapModeProperty) &&
+       !IsFilterEnabled(kBtSnoopLogFilterProfileMapModeProperty))) {
     return;
   }
 
@@ -1200,18 +1158,19 @@
     return;
   }
 
-  if (IsFilterEnabled(kBtSnoopLogFilterTypeA2dpPktsFiltered)) {
+  if (IsFilterEnabled(kBtSnoopLogFilterProfileA2dpProperty)) {
     if (IsA2dpMediaPacket(direction == Direction::INCOMING, (uint8_t*)packet.data())) {
       length = 0;
       return;
     }
   }
 
-  if (IsFilterEnabled(kBtSnoopLogFilterTypeHeadersFiltered)) {
+  if (IsFilterEnabled(kBtSnoopLogFilterHeadersProperty)) {
     CalculateAclPacketLength(length, (uint8_t*)packet.data(), direction == Direction::INCOMING);
   }
 
-  if (IsFilterEnabled(kBtSnoopLogFilterTypeProfilesFiltered)) {
+  if (IsFilterEnabled(kBtSnoopLogFilterProfilePbapModeProperty) ||
+      IsFilterEnabled(kBtSnoopLogFilterProfileMapModeProperty)) {
     // If HeadersFiltered applied, do not use ProfilesFiltered
     if (length == ntohl(header.length_original)) {
       if (packet.size() + EXTRA_BUF_SIZE > DEFAULT_PACKET_SIZE) {
@@ -1225,7 +1184,7 @@
     }
   }
 
-  if (IsFilterEnabled(kBtSnoopLogFilterTypeRfcommChannelFiltered)) {
+  if (IsFilterEnabled(kBtSnoopLogFilterProfileRfcommProperty)) {
     bool shouldFilter =
         SnoopLogger::ShouldFilterLog(direction == Direction::INCOMING, (uint8_t*)packet.data());
     if (shouldFilter) {
diff --git a/system/gd/hal/snoop_logger.h b/system/gd/hal/snoop_logger.h
index de45072..369de04 100644
--- a/system/gd/hal/snoop_logger.h
+++ b/system/gd/hal/snoop_logger.h
@@ -146,9 +146,11 @@
   static const std::string kBtSnoopLogModeProperty;
   static const std::string kBtSnoopLogPersists;
   static const std::string kBtSnoopDefaultLogModeProperty;
-  static const std::string kBtSnoopLogFilterTypesProperty;
-  static const std::string kBtSnoopLogFilterProfilesPbapModeProperty;
-  static const std::string kBtSnoopLogFilterProfilesMapModeProperty;
+  static const std::string kBtSnoopLogFilterHeadersProperty;
+  static const std::string kBtSnoopLogFilterProfileA2dpProperty;
+  static const std::string kBtSnoopLogFilterProfileMapModeProperty;
+  static const std::string kBtSnoopLogFilterProfilePbapModeProperty;
+  static const std::string kBtSnoopLogFilterProfileRfcommProperty;
   static const std::string kSoCManufacturerProperty;
 
   static const std::string kBtSnoopLogModeDisabled;
@@ -157,33 +159,19 @@
 
   static const std::string kSoCManufacturerQualcomm;
 
-  static const std::string kBtSnoopLogFilterTypeRfcommChannelFiltered;
-  static const std::string kBtSnoopLogFilterTypeHeadersFiltered;
-  static const std::string kBtSnoopLogFilterTypeA2dpPktsFiltered;
-  static const std::string kBtSnoopLogFilterTypeProfilesFiltered;
-
-  static const std::string kBtSnoopLogFilterProfilePbap;
-  static const std::string kBtSnoopLogFilterProfileMap;
-
   static const std::string kBtSnoopLogFilterProfileModeFullfillter;
   static const std::string kBtSnoopLogFilterProfileModeHeader;
   static const std::string kBtSnoopLogFilterProfileModeMagic;
   static const std::string kBtSnoopLogFilterProfileModeDisabled;
 
-  struct SnoopFilterType {
-    const std::string name;
-    bool enabled;
-  };
+  std::unordered_map<std::string, bool> kBtSnoopLogFilterState = {
+      {kBtSnoopLogFilterHeadersProperty, false},
+      {kBtSnoopLogFilterProfileA2dpProperty, false},
+      {kBtSnoopLogFilterProfileRfcommProperty, false}};
 
-  std::vector<SnoopFilterType> kBtSnoopLogFilterTypes = {
-      {kBtSnoopLogFilterTypeRfcommChannelFiltered, false},
-      {kBtSnoopLogFilterTypeHeadersFiltered, false},
-      {kBtSnoopLogFilterTypeA2dpPktsFiltered, false},
-      {kBtSnoopLogFilterTypeProfilesFiltered, false}};
-
-  std::unordered_map<std::string, std::string> kBtSnoopLogFilterProfiles = {
-      {kBtSnoopLogFilterProfilePbap, kBtSnoopLogFilterProfileModeDisabled},
-      {kBtSnoopLogFilterProfileMap, kBtSnoopLogFilterProfileModeDisabled}};
+  std::unordered_map<std::string, std::string> kBtSnoopLogFilterMode = {
+      {kBtSnoopLogFilterProfilePbapModeProperty, kBtSnoopLogFilterProfileModeDisabled},
+      {kBtSnoopLogFilterProfileMapModeProperty, kBtSnoopLogFilterProfileModeDisabled}};
 
   // Put in header for test
   struct PacketHeaderType {
@@ -310,10 +298,6 @@
   void DisableFilters();
   // Check if the filter is enabled. Pass filter name as a string.
   bool IsFilterEnabled(std::string filter_name);
-  // Enable filters for each profile according to their sysprops
-  void EnableProfilesFilters();
-  // Disable filters for each profile
-  void DisableProfilesFilters();
   // Check if packet should be filtered (rfcommchannelfiltered mode)
   bool ShouldFilterLog(bool is_received, uint8_t* packet);
   // Calculate packet length (snoopheadersfiltered mode)
diff --git a/system/gd/hal/snoop_logger_test.cc b/system/gd/hal/snoop_logger_test.cc
index beaa51b..67de5d2 100644
--- a/system/gd/hal/snoop_logger_test.cc
+++ b/system/gd/hal/snoop_logger_test.cc
@@ -638,15 +638,11 @@
   uint16_t local_cid = 0x0001;
   uint16_t remote_cid = 0xa040;
 
-  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeA2dpPktsFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
   ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeA2dpPktsFiltered) !=
-       std::string::npos));
+      bluetooth::os::SetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileA2dpProperty, "true"));
+  auto filter_a2dp_property =
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileA2dpProperty);
+  ASSERT_TRUE(filter_a2dp_property && filter_a2dp_property.value() == "true");
 
   auto* snoop_logger = new TestSnoopLoggerModule(
       temp_snoop_log_.string(),
@@ -669,6 +665,9 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(
+      bluetooth::os::SetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileA2dpProperty, "false"));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
   // Should filter packet
@@ -684,13 +683,11 @@
   uint16_t local_cid = 0x0001;
   uint16_t remote_cid = 0xa040;
 
-  ASSERT_TRUE(bluetooth::os::SetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty, " "));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
   ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeA2dpPktsFiltered) ==
-       std::string::npos));
+      bluetooth::os::SetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileA2dpProperty, "true"));
+  auto filter_a2dp_property =
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileA2dpProperty);
+  ASSERT_TRUE(filter_a2dp_property && filter_a2dp_property.value() == "true");
 
   auto* snoop_logger = new TestSnoopLoggerModule(
       temp_snoop_log_.string(),
@@ -714,6 +711,9 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(
+      bluetooth::os::SetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileA2dpProperty, "false"));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
   // Should not filter
@@ -725,15 +725,11 @@
 }
 
 TEST_F(SnoopLoggerModuleTest, headers_filtered_test) {
-  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeHeadersFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
   ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeHeadersFiltered) !=
-       std::string::npos));
+      bluetooth::os::SetSystemProperty(SnoopLogger::kBtSnoopLogFilterHeadersProperty, "true"));
+  auto filter_headers_property =
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterHeadersProperty);
+  ASSERT_TRUE(filter_headers_property && filter_headers_property.value() == "true");
 
   auto* snoop_logger = new TestSnoopLoggerModule(
       temp_snoop_log_.string(),
@@ -757,6 +753,9 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(
+      bluetooth::os::SetSystemProperty(SnoopLogger::kBtSnoopLogFilterHeadersProperty, "false"));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
   LOG_INFO(
@@ -778,14 +777,11 @@
   uint16_t remote_cid = 0x3040;
 
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered) !=
-       std::string::npos));
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "true"));
+  auto filter_rfcomm_property =
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty);
+  ASSERT_TRUE(filter_rfcomm_property);
+  ASSERT_TRUE(filter_rfcomm_property.value() == "true");
 
   auto* snoop_logger = new TestSnoopLoggerModule(
       temp_snoop_log_.string(),
@@ -837,14 +833,11 @@
   uint8_t dlci_byte = dlci << 2;
 
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered) !=
-       std::string::npos));
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "true"));
+  auto filter_rfcomm_property =
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty);
+  ASSERT_TRUE(filter_rfcomm_property);
+  ASSERT_TRUE(filter_rfcomm_property.value() == "true");
 
   auto* snoop_logger = new TestSnoopLoggerModule(
       temp_snoop_log_.string(),
@@ -873,6 +866,9 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "false"));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
 
@@ -893,14 +889,11 @@
   uint8_t dlci_byte = dlci << 2;
 
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered) !=
-       std::string::npos));
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "true"));
+  auto filter_rfcomm_property =
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty);
+  ASSERT_TRUE(filter_rfcomm_property);
+  ASSERT_TRUE(filter_rfcomm_property.value() == "true");
 
   auto* snoop_logger = new TestSnoopLoggerModule(
       temp_snoop_log_.string(),
@@ -929,6 +922,9 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "false"));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
 
@@ -947,14 +943,11 @@
   uint16_t remote_cid = 0x3040;
 
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered) !=
-       std::string::npos));
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "true"));
+  auto filter_rfcomm_property =
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty);
+  ASSERT_TRUE(filter_rfcomm_property);
+  ASSERT_TRUE(filter_rfcomm_property.value() == "true");
 
   auto* snoop_logger = new TestSnoopLoggerModule(
       temp_snoop_log_.string(),
@@ -980,6 +973,9 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "false"));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
 
@@ -998,14 +994,11 @@
   uint16_t remote_cid = 0x3040;
 
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeRfcommChannelFiltered) !=
-       std::string::npos));
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "true"));
+  auto filter_rfcomm_property =
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty);
+  ASSERT_TRUE(filter_rfcomm_property);
+  ASSERT_TRUE(filter_rfcomm_property.value() == "true");
 
   auto* snoop_logger = new TestSnoopLoggerModule(
       temp_snoop_log_.string(),
@@ -1033,6 +1026,9 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfileRfcommProperty, "false"));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
 
@@ -1057,31 +1053,21 @@
   const std::string clcc_pattern = "\x0d\x0a+CLCC:";
   const uint16_t HEADER_SIZE = 12;
 
-  // Set SnoopLogger filter type
-  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered) !=
-       std::string::npos));
   // Set pbap and map filtering modes
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
       SnoopLogger::kBtSnoopLogFilterProfileModeMagic));
   auto filterPbapModeProperty =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty);
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty);
   ASSERT_TRUE(
       filterPbapModeProperty &&
       (filterPbapModeProperty->find(SnoopLogger::kBtSnoopLogFilterProfileModeMagic) !=
        std::string::npos));
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,
       SnoopLogger::kBtSnoopLogFilterProfileModeMagic));
   auto filterMapModeProperty =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty);
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty);
   ASSERT_TRUE(
       filterMapModeProperty &&
       (filterMapModeProperty->find(SnoopLogger::kBtSnoopLogFilterProfileModeMagic) !=
@@ -1117,6 +1103,13 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileModeDisabled));
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileModeDisabled));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
 
@@ -1142,31 +1135,21 @@
   const std::string magic_string = "PROHIBITED";
   const uint16_t HEADER_SIZE = 8;
 
-  // Set SnoopLogger filter type
-  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered) !=
-       std::string::npos));
   // Set pbap and map filtering modes
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
       SnoopLogger::kBtSnoopLogFilterProfileModeMagic));
   auto filterPbapModeProperty =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty);
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty);
   ASSERT_TRUE(
       filterPbapModeProperty &&
       (filterPbapModeProperty->find(SnoopLogger::kBtSnoopLogFilterProfileModeMagic) !=
        std::string::npos));
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,
       SnoopLogger::kBtSnoopLogFilterProfileModeMagic));
   auto filterMapModeProperty =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty);
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty);
   ASSERT_TRUE(
       filterMapModeProperty &&
       (filterMapModeProperty->find(SnoopLogger::kBtSnoopLogFilterProfileModeMagic) !=
@@ -1198,6 +1181,13 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileModeDisabled));
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileModeDisabled));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
 
@@ -1224,31 +1214,21 @@
   bool flow = true;
   const uint16_t HEADER_SIZE = 8;
 
-  // Set SnoopLogger filter type
-  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered) !=
-       std::string::npos));
   // Set pbap and map filtering modes
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
       SnoopLogger::kBtSnoopLogFilterProfileModeHeader));
   auto filterPbapModeProperty =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty);
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty);
   ASSERT_TRUE(
       filterPbapModeProperty &&
       (filterPbapModeProperty->find(SnoopLogger::kBtSnoopLogFilterProfileModeHeader) !=
        std::string::npos));
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,
       SnoopLogger::kBtSnoopLogFilterProfileModeHeader));
   auto filterMapModeProperty =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty);
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty);
   ASSERT_TRUE(
       filterMapModeProperty &&
       (filterMapModeProperty->find(SnoopLogger::kBtSnoopLogFilterProfileModeHeader) !=
@@ -1280,6 +1260,13 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileModeDisabled));
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileModeDisabled));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));
 
@@ -1304,31 +1291,21 @@
   uint16_t profile_uuid_pbap = PROFILE_UUID_PBAP;
   bool flow = true;
 
-  // Set SnoopLogger filter type
-  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterTypesProperty,
-      SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered));
-  auto filterTypesProperties =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterTypesProperty);
-  ASSERT_TRUE(
-      filterTypesProperties &&
-      (filterTypesProperties->find(SnoopLogger::kBtSnoopLogFilterTypeProfilesFiltered) !=
-       std::string::npos));
   // Set pbap and map filtering modes
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
       SnoopLogger::kBtSnoopLogFilterProfileModeFullfillter));
   auto filterPbapModeProperty =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesPbapModeProperty);
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty);
   ASSERT_TRUE(
       filterPbapModeProperty &&
       (filterPbapModeProperty->find(SnoopLogger::kBtSnoopLogFilterProfileModeFullfillter) !=
        std::string::npos));
   ASSERT_TRUE(bluetooth::os::SetSystemProperty(
-      SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,
       SnoopLogger::kBtSnoopLogFilterProfileModeFullfillter));
   auto filterMapModeProperty =
-      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfilesMapModeProperty);
+      bluetooth::os::GetSystemProperty(SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty);
   ASSERT_TRUE(
       filterMapModeProperty &&
       (filterMapModeProperty->find(SnoopLogger::kBtSnoopLogFilterProfileModeFullfillter) !=
@@ -1360,6 +1337,13 @@
 
   test_registry.StopAll();
 
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfileMapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileModeDisabled));
+  ASSERT_TRUE(bluetooth::os::SetSystemProperty(
+      SnoopLogger::kBtSnoopLogFilterProfilePbapModeProperty,
+      SnoopLogger::kBtSnoopLogFilterProfileModeDisabled));
+
   // Verify states after test
   ASSERT_TRUE(std::filesystem::exists(temp_snoop_log_filtered));