Snap for 8708169 from a81274ed612b762e0d03fe53eeeb94c4ba0e462f to mainline-go-adservices-release

Change-Id: I58a90744123497c9b2eecd43ddf68d70e16fd508
diff --git a/android/app/AndroidManifest.xml b/android/app/AndroidManifest.xml
index ed7daa1..8a1c3c2 100644
--- a/android/app/AndroidManifest.xml
+++ b/android/app/AndroidManifest.xml
@@ -54,7 +54,6 @@
     <uses-permission android:name="android.permission.NETWORK_FACTORY"/>
     <uses-permission android:name="android.permission.TETHER_PRIVILEGED"/>
     <uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/>
-    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
     <uses-permission android:name="android.permission.BLUETOOTH_STACK"/>
     <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
     <uses-permission android:name="android.permission.MANAGE_USERS"/>
diff --git a/android/app/src/com/android/bluetooth/btservice/RemoteDevices.java b/android/app/src/com/android/bluetooth/btservice/RemoteDevices.java
index 81d1a86..da78ec6 100644
--- a/android/app/src/com/android/bluetooth/btservice/RemoteDevices.java
+++ b/android/app/src/com/android/bluetooth/btservice/RemoteDevices.java
@@ -724,7 +724,7 @@
                             break;
                         case AbstractionLayer.BT_PROPERTY_TYPE_OF_DEVICE:
                             if (device.isConsolidated()) {
-                                return;
+                                break;
                             }
                             // The device type from hal layer, defined in bluetooth.h,
                             // matches the type defined in BluetoothDevice.java
diff --git a/android/app/src/com/android/bluetooth/btservice/storage/DatabaseManager.java b/android/app/src/com/android/bluetooth/btservice/storage/DatabaseManager.java
index 66fe33b..4bc32b4 100644
--- a/android/app/src/com/android/bluetooth/btservice/storage/DatabaseManager.java
+++ b/android/app/src/com/android/bluetooth/btservice/storage/DatabaseManager.java
@@ -1046,10 +1046,15 @@
                 // Do not log anything if metadata doesn't fall into above categories
                 return;
         }
+        String[] macAddress = device.getAddress().split(":");
         BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_DEVICE_INFO_REPORTED,
                 mAdapterService.obfuscateAddress(device),
                 BluetoothProtoEnums.DEVICE_INFO_EXTERNAL, callingApp, manufacturerName, modelName,
-                hardwareVersion, softwareVersion, mAdapterService.getMetricId(device));
+                hardwareVersion, softwareVersion, mAdapterService.getMetricId(device),
+                device.getAddressType(),
+                Integer.parseInt(macAddress[0], 16),
+                Integer.parseInt(macAddress[1], 16),
+                Integer.parseInt(macAddress[2], 16));
     }
 
     private void logMetadataChange(String address, String log) {
diff --git a/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java b/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
index 39d372f..e431c43 100644
--- a/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
+++ b/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
@@ -1914,10 +1914,14 @@
         String vendorId = deviceInfo[0];
         String productId = deviceInfo[1];
         String version = deviceInfo[2];
+        String[] macAddress = device.getAddress().split(":");
         BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_DEVICE_INFO_REPORTED,
                 mAdapterService.obfuscateAddress(device), BluetoothProtoEnums.DEVICE_INFO_INTERNAL,
                 BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_XAPL, vendorId, productId, version,
-                null, mAdapterService.getMetricId(device));
+                null, mAdapterService.getMetricId(device),
+                device.getAddressType(),
+                Integer.parseInt(macAddress[0], 16),
+                Integer.parseInt(macAddress[1], 16), Integer.parseInt(macAddress[2], 16));
         // feature = 2 indicates that we support battery level reporting only
         mNativeInterface.atResponseString(device, "+XAPL=iPhone," + String.valueOf(2));
     }
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index e4bfc42..0fdadf8 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -3364,7 +3364,7 @@
      * can use the same UUID to query our SDP server and discover which channel
      * to connect to. This SDP record will be removed when this socket is
      * closed, or if this application closes unexpectedly.
-     * <p>Use {@link BluetoothDevice#createRfcommSocketToServiceRecord} to
+     * <p>Use {@link BluetoothDevice#createInsecureRfcommSocketToServiceRecord} to
      * connect to this socket from another device using the same {@link UUID}.
      *
      * @param name service name for SDP record
diff --git a/framework/java/android/bluetooth/le/ScanFilter.java b/framework/java/android/bluetooth/le/ScanFilter.java
index ee65f16..bf902e8 100644
--- a/framework/java/android/bluetooth/le/ScanFilter.java
+++ b/framework/java/android/bluetooth/le/ScanFilter.java
@@ -742,11 +742,11 @@
          * address can be validated using {@link BluetoothAdapter#checkBluetoothAddress}.
          * <p>
          * The IRK is used to resolve a static address from a private address. The IRK must be
-         * provided in big endian byte order.
+         * provided in little endian byte order.
          *
          * @param deviceAddress the remote device Bluetooth address for the filter
          * @param addressType indication of the type of address
-         * @param irk non-null byte array representing the Identity Resolving Key
+         * @param irk non-null little endian byte array representing the Identity Resolving Key
          *
          * @throws IllegalArgumentException If the {@code deviceAddress} is invalid
          * @throws IllegalArgumentException if the {@code irk} is invalid length
@@ -777,9 +777,8 @@
          * format of "01:02:03:AB:CD:EF". The device address can be validated using {@link
          * BluetoothAdapter#checkBluetoothAddress}.
          * @param addressType indication of the type of address
-         * e.g. {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC}
-         * @param irk non-null byte array representing the Identity Resolving Address; nullable
-         * internally.
+         * @param irk non-null little endian byte array representing the Identity Resolving Key;
+         *            nullable internally.
          *
          * @throws IllegalArgumentException if the {@code deviceAddress} is invalid
          * @throws IllegalArgumentException if the {@code addressType} is not PUBLIC or RANDOM
diff --git a/system/Android.mk b/system/Android.mk
index a6a4c1a..1596e49 100644
--- a/system/Android.mk
+++ b/system/Android.mk
@@ -46,7 +46,6 @@
 	$(TARGET_OUT_EXECUTABLES)/bluetooth_stack_with_facade
 
 LOCAL_target_libraries := \
-	$(TARGET_OUT_SHARED_LIBRARIES)/android.system.suspend.control-V1-ndk.so \
 	$(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \
 	$(TARGET_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \
 	$(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \
diff --git a/system/blueberry/tests/gd/cert/gd_device.py b/system/blueberry/tests/gd/cert/gd_device.py
index 7fbc93c..44a22c6 100644
--- a/system/blueberry/tests/gd/cert/gd_device.py
+++ b/system/blueberry/tests/gd/cert/gd_device.py
@@ -491,8 +491,6 @@
 
         # Push test binaries
         self.push_or_die(os.path.join(get_gd_root(), "target", "bluetooth_stack_with_facade"), "system/bin")
-        self.push_or_die(
-            os.path.join(get_gd_root(), "target", "android.system.suspend.control-V1-ndk.so"), "system/lib64")
         self.push_or_die(os.path.join(get_gd_root(), "target", "libbluetooth_gd.so"), "system/lib64")
         self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++_unsecure.so"), "system/lib64")
         self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++.so"), "system/lib64")
@@ -529,7 +527,8 @@
         self.ensure_no_output(self.adb.shell("settings put global ble_scan_always_enabled 0"))
         self.adb.shell("cmd bluetooth_manager disable")
         device_bt_state = int(self.adb.shell("settings get global bluetooth_on"))
-        asserts.assert_equal(device_bt_state, 0, "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number))
+        asserts.assert_equal(device_bt_state, 0,
+                             "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number))
         logging.info("Bluetooth disabled on device %s %s" % (self.label, self.serial_number))
 
         # Start logcat logging
diff --git a/system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py b/system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py
index 899df00..24844ff 100644
--- a/system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py
+++ b/system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py
@@ -61,9 +61,10 @@
         # Enable full btsnoop log
         self.dut.adb.root()
         self.dut.adb.shell("setprop persist.bluetooth.btsnooplogmode full")
-        getprop_result = self.dut.adb.shell("getprop persist.bluetooth.btsnooplogmode") == "full"
-        if not getprop_result:
-            self.dut.log.warning("Failed to enable Bluetooth Hci Snoop Logging.")
+        getprop_result = self.dut.adb.getprop("persist.bluetooth.btsnooplogmode")
+        if getprop_result is None or ("full" not in getprop_result.lower()):
+            self.dut.log.warning(
+                "Failed to enable Bluetooth Hci Snoop Logging, getprop returned {}".format(getprop_result))
 
         self.ble = BleLib(dut=self.dut)
 
@@ -95,7 +96,10 @@
         # Make sure BLE is disabled and Bluetooth is disabled after test
         self.dut.sl4a.bluetoothDisableBLE()
         disable_bluetooth(self.dut.sl4a, self.dut.ed)
-        self.cert.rootservice.StopStack(facade_rootservice.StopStackRequest())
+        try:
+            self.cert.rootservice.StopStack(facade_rootservice.StopStackRequest())
+        except Exception:
+            logging.error("Failed to stop CERT stack")
 
         # TODO: split cert logcat logs into individual tests
         current_test_dir = get_current_context().get_full_output_path()
diff --git a/system/bta/gatt/bta_gattc_act.cc b/system/bta/gatt/bta_gattc_act.cc
index 63da73c..d170778 100644
--- a/system/bta/gatt/bta_gattc_act.cc
+++ b/system/bta/gatt/bta_gattc_act.cc
@@ -255,8 +255,7 @@
 
   tBTA_GATTC_RCB* p_clreg = bta_gattc_cl_get_regcb(p_msg->api_conn.client_if);
   if (!p_clreg) {
-    LOG(ERROR) << __func__
-               << ": Failed, unknown client_if=" << +p_msg->api_conn.client_if;
+    LOG_ERROR("Failed, unknown client_if=%d", +p_msg->api_conn.client_if);
     return;
   }
 
@@ -268,10 +267,10 @@
   tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_alloc_clcb(
       p_msg->api_conn.client_if, p_msg->api_conn.remote_bda,
       p_msg->api_conn.transport);
-  if (p_clcb != NULL) {
+  if (p_clcb != nullptr) {
     bta_gattc_sm_execute(p_clcb, event, p_msg);
   } else {
-    LOG(ERROR) << "No resources to open a new connection.";
+    LOG_ERROR("No resources to open a new connection.");
 
     bta_gattc_send_open_cback(p_clreg, GATT_NO_RESOURCES,
                               p_msg->api_conn.remote_bda, GATT_INVALID_CONN_ID,
@@ -367,7 +366,6 @@
                     p_data->api_conn.transport, p_data->api_conn.opportunistic,
                     p_data->api_conn.initiating_phys)) {
     LOG(ERROR) << "Connection open failure";
-
     bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_OPEN_FAIL_EVT, p_data);
     return;
   }
@@ -387,7 +385,7 @@
 static void bta_gattc_init_bk_conn(const tBTA_GATTC_API_OPEN* p_data,
                                    tBTA_GATTC_RCB* p_clreg) {
   if (!bta_gattc_mark_bg_conn(p_data->client_if, p_data->remote_bda, true)) {
-    LOG_WARN("Unable to find space for acceptlist connection mask");
+    LOG_WARN("Unable to find space for accept list connection mask");
     bta_gattc_send_open_cback(p_clreg, GATT_NO_RESOURCES, p_data->remote_bda,
                               GATT_INVALID_CONN_ID, BT_TRANSPORT_LE, 0);
     return;
@@ -396,8 +394,8 @@
   /* always call open to hold a connection */
   if (!GATT_Connect(p_data->client_if, p_data->remote_bda, false,
                     p_data->transport, false)) {
-    LOG(ERROR) << __func__
-               << " unable to connect to remote bd_addr=" << p_data->remote_bda;
+    LOG_ERROR("Unable to connect to remote bd_addr=%s",
+              p_data->remote_bda.ToString().c_str());
     bta_gattc_send_open_cback(p_clreg, GATT_ERROR, p_data->remote_bda,
                               GATT_INVALID_CONN_ID, BT_TRANSPORT_LE, 0);
     return;
@@ -406,7 +404,7 @@
   uint16_t conn_id;
   if (!GATT_GetConnIdIfConnected(p_data->client_if, p_data->remote_bda,
                                  &conn_id, p_data->transport)) {
-    LOG_WARN("Not a connected remote device");
+    LOG_INFO("Not a connected remote device yet");
     return;
   }
 
@@ -442,7 +440,9 @@
     if (GATT_CancelConnect(p_data->client_if, p_data->remote_bda, false)) {
       cb_data.status = GATT_SUCCESS;
     } else {
-      LOG(ERROR) << __func__ << ": failed";
+      LOG_ERROR("failed for client_if=%d, remote_bda=%s, is_direct=false",
+                static_cast<int>(p_data->client_if),
+                p_data->remote_bda.ToString().c_str());
     }
   }
   p_clreg = bta_gattc_cl_get_regcb(p_data->client_if);
@@ -577,16 +577,17 @@
   tBTA_GATTC cb_data = {
       .close =
           {
-              .client_if = p_clcb->p_rcb->client_if,
               .conn_id = p_clcb->bta_conn_id,
-              .reason = GATT_CONN_OK,
-              .remote_bda = p_clcb->bda,
               .status = GATT_SUCCESS,
+              .client_if = p_clcb->p_rcb->client_if,
+              .remote_bda = p_clcb->bda,
+              .reason = GATT_CONN_OK,
           },
   };
 
-  if (p_clcb->transport == BT_TRANSPORT_BR_EDR)
+  if (p_clcb->transport == BT_TRANSPORT_BR_EDR) {
     bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda);
+  }
 
   bta_gattc_clcb_dealloc(p_clcb);
 
diff --git a/system/bta/gatt/bta_gatts_act.cc b/system/bta/gatt/bta_gatts_act.cc
index 3cd7b34..3cd143d 100644
--- a/system/bta/gatt/bta_gatts_act.cc
+++ b/system/bta/gatt/bta_gatts_act.cc
@@ -489,18 +489,20 @@
 
   if (GATT_GetConnectionInfor(p_msg->hdr.layer_specific, &gatt_if, remote_bda,
                               &transport)) {
-    if (GATT_Disconnect(p_msg->hdr.layer_specific) != GATT_SUCCESS) {
-      LOG(ERROR) << __func__
-                 << ": fail conn_id=" << loghex(p_msg->hdr.layer_specific);
-    } else {
-      status = GATT_SUCCESS;
+    LOG_DEBUG("Disconnecting gatt_if=%d, remote_bda=%s, transport=%d", +gatt_if,
+              remote_bda.ToString().c_str(), transport);
+    status = GATT_Disconnect(p_msg->hdr.layer_specific);
+    if (status != GATT_SUCCESS) {
+      LOG_ERROR("fail conn_id=%d", +p_msg->hdr.layer_specific);
+      status = GATT_ERROR;
     }
 
     p_rcb = bta_gatts_find_app_rcb_by_app_if(gatt_if);
 
     if (p_rcb && p_rcb->p_cback) {
-      if (transport == BT_TRANSPORT_BR_EDR)
+      if (transport == BT_TRANSPORT_BR_EDR) {
         bta_sys_conn_close(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda);
+      }
 
       tBTA_GATTS bta_gatts;
       bta_gatts.status = status;
diff --git a/system/bta/hearing_aid/hearing_aid.cc b/system/bta/hearing_aid/hearing_aid.cc
index 61a83cd..0e48ae4 100644
--- a/system/bta/hearing_aid/hearing_aid.cc
+++ b/system/bta/hearing_aid/hearing_aid.cc
@@ -584,6 +584,7 @@
     }
   }
 
+  // Just take care phy update successful case to avoid loop excuting.
   void OnPhyUpdateEvent(uint16_t conn_id, uint8_t tx_phys, uint8_t rx_phys,
                         tGATT_STATUS status) {
     HearingDevice* hearingDevice = hearingDevices.FindByConnId(conn_id);
@@ -591,14 +592,19 @@
       DVLOG(2) << "Skipping unknown device, conn_id=" << loghex(conn_id);
       return;
     }
-    if (status == GATT_SUCCESS && tx_phys == PHY_LE_2M &&
-        rx_phys == PHY_LE_2M) {
+    if (status != GATT_SUCCESS) {
+      LOG(WARNING) << hearingDevice->address
+                   << " phy update fail with status: " << status;
+      return;
+    }
+    if (tx_phys == PHY_LE_2M && rx_phys == PHY_LE_2M) {
       LOG(INFO) << hearingDevice->address << " phy update to 2M successful";
       return;
     }
-    LOG(INFO) << hearingDevice->address
-              << " phy update to 2M fail, try again. status: " << status
-              << ", tx_phys: " << tx_phys << ", rx_phys: " << rx_phys;
+    LOG(INFO)
+        << hearingDevice->address
+        << " phy update successful but not target phy, try again. tx_phys: "
+        << tx_phys << ", rx_phys: " << rx_phys;
     BTM_BleSetPhy(hearingDevice->address, PHY_LE_2M, PHY_LE_2M, 0);
   }
 
diff --git a/system/bta/le_audio/state_machine.cc b/system/bta/le_audio/state_machine.cc
index bb6f8f0..2265f42 100644
--- a/system/bta/le_audio/state_machine.cc
+++ b/system/bta/le_audio/state_machine.cc
@@ -367,12 +367,12 @@
       do {
         auto ases_pair = leAudioDevice->GetAsesByCisId(ase->cis_id);
 
-        if (ases_pair.sink) {
+        if (ases_pair.sink && ases_pair.sink->active) {
           ases_pair.sink->cis_conn_hdl = conn_handles[i];
           ases_pair.sink->data_path_state =
               AudioStreamDataPathState::CIS_ASSIGNED;
         }
-        if (ases_pair.source) {
+        if (ases_pair.source && ases_pair.source->active) {
           ases_pair.source->cis_conn_hdl = conn_handles[i];
           ases_pair.source->data_path_state =
               AudioStreamDataPathState::CIS_ASSIGNED;
diff --git a/system/btif/src/btif_gatt_client.cc b/system/btif/src/btif_gatt_client.cc
index 393c2a8..2ebad3f 100644
--- a/system/btif/src/btif_gatt_client.cc
+++ b/system/btif/src/btif_gatt_client.cc
@@ -344,12 +344,15 @@
         else
           transport = BT_TRANSPORT_BR_EDR;
         break;
+      default:
+        LOG_ERROR("Unknown device type %d", +device_type);
+        break;
     }
   }
 
   // Connect!
-  LOG_INFO("%s Transport=%d, device type=%d, address type =%d, phy=%d",
-           __func__, transport, device_type, addr_type, initiating_phys);
+  LOG_INFO("Transport=%d, device type=%d, address type =%d, phy=%d", transport,
+           device_type, addr_type, initiating_phys);
   BTA_GATTC_Open(client_if, address, is_direct, transport, opportunistic,
                  initiating_phys);
 }
@@ -365,11 +368,14 @@
 }
 
 void btif_gattc_close_impl(int client_if, RawAddress address, int conn_id) {
+  LOG_INFO("client_if=%d, conn_id=%d, address=%s", client_if, conn_id,
+           PRIVATE_ADDRESS(address));
   // Disconnect established connections
-  if (conn_id != 0)
+  if (conn_id != 0) {
     BTA_GATTC_Close(conn_id);
-  else
+  } else {
     BTA_GATTC_CancelOpen(client_if, address, true);
+  }
 
   // Cancel pending background connections (remove from acceptlist)
   BTA_GATTC_CancelOpen(client_if, address, false);
diff --git a/system/btif/src/btif_storage.cc b/system/btif/src/btif_storage.cc
index 42f9b31..865bcf9 100644
--- a/system/btif/src/btif_storage.cc
+++ b/system/btif/src/btif_storage.cc
@@ -945,6 +945,10 @@
 void btif_storage_load_consolidate_devices(void) {
   btif_bonded_devices_t bonded_devices;
   btif_in_fetch_bonded_devices(&bonded_devices, 1);
+  std::unordered_set<RawAddress> bonded_addresses;
+  for (uint16_t i = 0; i < bonded_devices.num_devices; i++) {
+    bonded_addresses.insert(bonded_devices.devices[i]);
+  }
 
   std::vector<std::pair<RawAddress, RawAddress>> consolidated_devices;
   for (uint16_t i = 0; i < bonded_devices.num_devices; i++) {
@@ -953,7 +957,9 @@
     if (btif_storage_get_ble_bonding_key(
             bonded_devices.devices[i], BTM_LE_KEY_PID, (uint8_t*)&key,
             sizeof(tBTM_LE_PID_KEYS)) == BT_STATUS_SUCCESS) {
-      if (bonded_devices.devices[i] != key.pid_key.identity_addr) {
+      if (bonded_devices.devices[i] != key.pid_key.identity_addr &&
+          bonded_addresses.find(key.pid_key.identity_addr) !=
+              bonded_addresses.end()) {
         LOG_INFO("found consolidated device %s %s",
                  bonded_devices.devices[i].ToString().c_str(),
                  key.pid_key.identity_addr.ToString().c_str());
diff --git a/system/common/metrics.cc b/system/common/metrics.cc
index be1d1b3..0664186 100644
--- a/system/common/metrics.cc
+++ b/system/common/metrics.cc
@@ -859,6 +859,7 @@
 }
 
 void LogManufacturerInfo(const RawAddress& address,
+                         android::bluetooth::AddressTypeEnum address_type,
                          android::bluetooth::DeviceInfoSrcEnum source_type,
                          const std::string& source_name,
                          const std::string& manufacturer,
@@ -875,16 +876,20 @@
   BytesField obfuscated_id_field(
       address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
       address.IsEmpty() ? 0 : obfuscated_id.size());
-  int ret = stats_write(BLUETOOTH_DEVICE_INFO_REPORTED, obfuscated_id_field,
-                        source_type, source_name.c_str(), manufacturer.c_str(),
-                        model.c_str(), hardware_version.c_str(),
-                        software_version.c_str(), metric_id);
+  int ret = stats_write(
+      BLUETOOTH_DEVICE_INFO_REPORTED, obfuscated_id_field, source_type,
+      source_name.c_str(), manufacturer.c_str(), model.c_str(),
+      hardware_version.c_str(), software_version.c_str(), metric_id,
+      address_type, address.address[5], address.address[4], address.address[3]);
   if (ret < 0) {
     LOG(WARNING) << __func__ << ": failed for " << address << ", source_type "
                  << source_type << ", source_name " << source_name
                  << ", manufacturer " << manufacturer << ", model " << model
                  << ", hardware_version " << hardware_version
-                 << ", software_version " << software_version << ", error "
+                 << ", software_version " << software_version
+                 << " MAC address type " << address_type
+                 << " MAC address prefix " << address.address[5] << " "
+                 << address.address[4] << " " << address.address[3] << ", error "
                  << ret;
   }
 }
diff --git a/system/common/metrics.h b/system/common/metrics.h
index 53cad5c..9d33e1b 100644
--- a/system/common/metrics.h
+++ b/system/common/metrics.h
@@ -487,6 +487,7 @@
  * @param software_version software version of this device
  */
 void LogManufacturerInfo(const RawAddress& address,
+                         android::bluetooth::AddressTypeEnum address_type,
                          android::bluetooth::DeviceInfoSrcEnum source_type,
                          const std::string& source_name,
                          const std::string& manufacturer,
diff --git a/system/gd/Android.bp b/system/gd/Android.bp
index ca4c2b0..de8a8a7 100644
--- a/system/gd/Android.bp
+++ b/system/gd/Android.bp
@@ -289,14 +289,16 @@
             shared_libs: [
                 "android.hardware.bluetooth@1.0",
                 "android.hardware.bluetooth@1.1",
-                "android.system.suspend.control-V1-ndk",
-                "android.system.suspend-V1-ndk",
                 "libbinder_ndk",
                 "libhidlbase",
                 "libutils",
                 "libcutils",
                 "libstatslog_bt",
             ],
+            static_libs: [
+                "android.system.suspend.control-V1-ndk",
+                "android.system.suspend-V1-ndk",
+            ],
         },
         host: {
             required: [
diff --git a/system/gd/hci/acl_manager/le_impl.h b/system/gd/hci/acl_manager/le_impl.h
index 0b82835..5ff169c 100644
--- a/system/gd/hci/acl_manager/le_impl.h
+++ b/system/gd/hci/acl_manager/le_impl.h
@@ -305,7 +305,7 @@
       return;
     }
 
-    canceled_connections_.erase(remote_address);
+    arm_on_resume_ = false;
     ready_to_unregister = true;
     remove_device_from_connect_list(remote_address);
 
@@ -390,7 +390,7 @@
       return;
     }
 
-    canceled_connections_.erase(remote_address);
+    arm_on_resume_ = false;
     ready_to_unregister = true;
     remove_device_from_connect_list(remote_address);
 
@@ -585,6 +585,7 @@
       return;
     }
     connect_list.erase(address_with_type);
+    connecting_le_.erase(address_with_type);
     direct_connections_.erase(address_with_type);
     register_with_address_manager();
     le_address_manager_->RemoveDeviceFromFilterAcceptList(
@@ -643,6 +644,10 @@
           connectability_state_machine_text(connectability_state_).c_str());
       return;
     }
+    if (connect_list.empty()) {
+      LOG_ERROR("Attempting to re-arm le connection state machine when filter accept list is empty");
+      return;
+    }
     AddressWithType empty(Address::kEmpty, AddressType::RANDOM_DEVICE_ADDRESS);
     connectability_state_ = ConnectabilityState::ARMING;
     connecting_le_ = connect_list;
@@ -795,7 +800,7 @@
     }
 
     if (pause_connection) {
-      canceled_connections_.insert(address_with_type);
+      arm_on_resume_ = true;
       return;
     }
 
@@ -811,7 +816,7 @@
         // If we added to filter accept list then the arming of the le state machine
         // must wait until the filter accept list command as completed
         if (add_to_connect_list) {
-          canceled_connections_.insert(address_with_type);
+          arm_on_resume_ = true;
           LOG_DEBUG("Deferred until filter accept list has completed");
         } else {
           handler_->CallOn(this, &le_impl::arm_connectability);
@@ -930,16 +935,16 @@
       le_address_manager_->AckPause(this);
       return;
     }
-    canceled_connections_ = connecting_le_;
+    arm_on_resume_ = !connecting_le_.empty();
     disarm_connectability();
   }
 
   void OnResume() override {  // bluetooth::hci::LeAddressManagerCallback
     pause_connection = false;
-    if (!canceled_connections_.empty()) {
+    if (arm_on_resume_) {
       arm_connectability();
     }
-    canceled_connections_.clear();
+    arm_on_resume_ = false;
     le_address_manager_->AckResume(this);
     check_for_unregister();
   }
@@ -987,7 +992,7 @@
   LeConnectionCallbacks* le_client_callbacks_ = nullptr;
   os::Handler* le_client_handler_ = nullptr;
   std::unordered_set<AddressWithType> connecting_le_;
-  std::unordered_set<AddressWithType> canceled_connections_;
+  bool arm_on_resume_;
   std::unordered_set<AddressWithType> direct_connections_;
   // Set of devices that will not be removed from connect list after direct connect timeout
   std::unordered_set<AddressWithType> background_connections_;
diff --git a/system/gd/hci/hci_metrics_logging.cc b/system/gd/hci/hci_metrics_logging.cc
index 80655d5..9c864ac 100644
--- a/system/gd/hci/hci_metrics_logging.cc
+++ b/system/gd/hci/hci_metrics_logging.cc
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
 #include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h>
 
 #include "common/strings.h"
@@ -512,7 +511,12 @@
       status = connection_complete_view.GetStatus();
 
       // besides log link layer connection events, also log remote device manufacturer info
-      log_remote_device_information(address, connection_handle, status, storage_module);
+      log_remote_device_information(
+          address,
+          android::bluetooth::ADDRESS_TYPE_PUBLIC,
+          connection_handle,
+          status,
+          storage_module);
       break;
     }
     case EventCode::CONNECTION_REQUEST: {
@@ -1048,7 +1052,11 @@
 }
 
 void log_remote_device_information(
-    const Address& address, uint32_t connection_handle, ErrorCode status, storage::StorageModule* storage_module) {
+    const Address& address,
+    android::bluetooth::AddressTypeEnum address_type,
+    uint32_t connection_handle,
+    ErrorCode status,
+    storage::StorageModule* storage_module) {
   if (address.IsEmpty()) {
     return;
   }
@@ -1059,6 +1067,7 @@
   sdp_di_vendor_id_source << "N:SDP::DIP::" << common::ToHexString(device.GetSdpDiVendorIdSource().value_or(0)).c_str();
   os::LogMetricManufacturerInfo(
       address,
+      address_type,
       android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL,
       sdp_di_vendor_id_source.str(),
       common::ToHexString(device.GetSdpDiManufacturer().value_or(0)).c_str(),
diff --git a/system/gd/hci/hci_metrics_logging.h b/system/gd/hci/hci_metrics_logging.h
index de463db..37a230a 100644
--- a/system/gd/hci/hci_metrics_logging.h
+++ b/system/gd/hci/hci_metrics_logging.h
@@ -15,6 +15,7 @@
  */
 
 #pragma once
+#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
 
 #include "hci/hci_packets.h"
 #include "storage/storage_module.h"
@@ -34,6 +35,10 @@
 void log_classic_pairing_other_hci_event(EventView packet);
 
 void log_remote_device_information(
-    const Address& address, uint32_t connection_handle, ErrorCode status, storage::StorageModule* storage_module);
+    const Address& address,
+    android::bluetooth::AddressTypeEnum address_type,
+    uint32_t connection_handle,
+    ErrorCode status,
+    storage::StorageModule* storage_module);
 }  // namespace hci
 }  // namespace bluetooth
\ No newline at end of file
diff --git a/system/gd/hci/le_advertising_manager.cc b/system/gd/hci/le_advertising_manager.cc
index 95979bf..0832c25 100644
--- a/system/gd/hci/le_advertising_manager.cc
+++ b/system/gd/hci/le_advertising_manager.cc
@@ -223,6 +223,7 @@
         id++;
       }
       if (id == num_instances_) {
+        LOG_WARN("Number of max instances %d reached", (uint16_t)num_instances_);
         return kInvalidId;
       }
       advertising_sets_[id].in_use = true;
@@ -1259,6 +1260,11 @@
           ErrorCodeText(status_view.GetStatus()).c_str());
     }
   }
+
+  void start_advertising_fail(int reg_id, AdvertisingCallback::AdvertisingStatus status) {
+    ASSERT(status != AdvertisingCallback::AdvertisingStatus::SUCCESS);
+    advertising_callbacks_->OnAdvertisingSetStarted(reg_id, kInvalidId, 0, status);
+  }
 };
 
 LeAdvertisingManager::LeAdvertisingManager() {
@@ -1298,16 +1304,26 @@
     if (config.own_address_type == hci::OwnAddressType::RESOLVABLE_OR_PUBLIC_ADDRESS ||
         config.own_address_type == hci::OwnAddressType::RESOLVABLE_OR_RANDOM_ADDRESS) {
       LOG_WARN("Peer address can not be empty");
+      CallOn(
+          pimpl_.get(), &impl::start_advertising_fail, reg_id, AdvertisingCallback::AdvertisingStatus::INTERNAL_ERROR);
       return kInvalidId;
     }
     if (config.advertising_type == hci::AdvertisingType::ADV_DIRECT_IND ||
         config.advertising_type == hci::AdvertisingType::ADV_DIRECT_IND_LOW) {
       LOG_WARN("Peer address can not be empty for directed advertising");
+      CallOn(
+          pimpl_.get(), &impl::start_advertising_fail, reg_id, AdvertisingCallback::AdvertisingStatus::INTERNAL_ERROR);
       return kInvalidId;
     }
   }
   AdvertiserId id = pimpl_->allocate_advertiser();
   if (id == kInvalidId) {
+    LOG_WARN("Number of max instances reached");
+    CallOn(
+        pimpl_.get(),
+        &impl::start_advertising_fail,
+        reg_id,
+        AdvertisingCallback::AdvertisingStatus::TOO_MANY_ADVERTISERS);
     return id;
   }
   GetHandler()->Post(common::BindOnce(
@@ -1338,29 +1354,43 @@
   if (config.directed) {
     if (config.peer_address == Address::kEmpty) {
       LOG_INFO("Peer address can not be empty for directed advertising");
+      CallOn(
+          pimpl_.get(), &impl::start_advertising_fail, reg_id, AdvertisingCallback::AdvertisingStatus::INTERNAL_ERROR);
       return kInvalidId;
     }
   }
   if (config.channel_map == 0) {
     LOG_INFO("At least one channel must be set in the map");
+    CallOn(pimpl_.get(), &impl::start_advertising_fail, reg_id, AdvertisingCallback::AdvertisingStatus::INTERNAL_ERROR);
     return kInvalidId;
   }
   if (!config.legacy_pdus) {
     if (config.connectable && config.scannable) {
       LOG_INFO("Extended advertising PDUs can not be connectable and scannable");
+      CallOn(
+          pimpl_.get(), &impl::start_advertising_fail, reg_id, AdvertisingCallback::AdvertisingStatus::INTERNAL_ERROR);
       return kInvalidId;
     }
     if (config.high_duty_directed_connectable) {
       LOG_INFO("Extended advertising PDUs can not be high duty cycle");
+      CallOn(
+          pimpl_.get(), &impl::start_advertising_fail, reg_id, AdvertisingCallback::AdvertisingStatus::INTERNAL_ERROR);
       return kInvalidId;
     }
   }
   if (config.interval_min > config.interval_max) {
     LOG_INFO("Advertising interval: min (%hu) > max (%hu)", config.interval_min, config.interval_max);
+    CallOn(pimpl_.get(), &impl::start_advertising_fail, reg_id, AdvertisingCallback::AdvertisingStatus::INTERNAL_ERROR);
     return kInvalidId;
   }
   AdvertiserId id = pimpl_->allocate_advertiser();
   if (id == kInvalidId) {
+    LOG_WARN("Number of max instances reached");
+    CallOn(
+        pimpl_.get(),
+        &impl::start_advertising_fail,
+        reg_id,
+        AdvertisingCallback::AdvertisingStatus::TOO_MANY_ADVERTISERS);
     return id;
   }
   CallOn(
diff --git a/system/gd/os/android/metrics.cc b/system/gd/os/android/metrics.cc
index 8286ad1..3be6188 100644
--- a/system/gd/os/android/metrics.cc
+++ b/system/gd/os/android/metrics.cc
@@ -355,6 +355,7 @@
 
 void LogMetricManufacturerInfo(
     const Address& address,
+    android::bluetooth::AddressTypeEnum address_type,
     android::bluetooth::DeviceInfoSrcEnum source_type,
     const std::string& source_name,
     const std::string& manufacturer,
@@ -374,11 +375,16 @@
       model.c_str(),
       hardware_version.c_str(),
       software_version.c_str(),
-      metric_id);
+      metric_id,
+      address_type,
+      address.address[5],
+      address.address[4],
+      address.address[3]);
   if (ret < 0) {
     LOG_WARN(
-        "Failed for %s, source_type %d, source_name %s, manufacturer %s, model %s, hardware_version %s, "
-        "software_version %s, error %d",
+        "Failed for %s, source_type %d, source_name %s, manufacturer %s, model %s, "
+        "hardware_version %s, "
+        "software_version %s, MAC address type %d MAC address prefix %d %d %d, error %d",
         address.ToString().c_str(),
         source_type,
         source_name.c_str(),
@@ -386,6 +392,10 @@
         model.c_str(),
         hardware_version.c_str(),
         software_version.c_str(),
+        address_type,
+        address.address[5],
+        address.address[4],
+        address.address[3],
         ret);
   }
 }
diff --git a/system/gd/os/host/metrics.cc b/system/gd/os/host/metrics.cc
index f83e59c..b175714 100644
--- a/system/gd/os/host/metrics.cc
+++ b/system/gd/os/host/metrics.cc
@@ -80,6 +80,7 @@
 
 void LogMetricManufacturerInfo(
     const Address& address,
+    android::bluetooth::AddressTypeEnum address_type,
     android::bluetooth::DeviceInfoSrcEnum source_type,
     const std::string& source_name,
     const std::string& manufacturer,
diff --git a/system/gd/os/linux/metrics.cc b/system/gd/os/linux/metrics.cc
index 926f545..37bd673 100644
--- a/system/gd/os/linux/metrics.cc
+++ b/system/gd/os/linux/metrics.cc
@@ -80,6 +80,7 @@
 
 void LogMetricManufacturerInfo(
     const Address& address,
+    android::bluetooth::AddressTypeEnum address_type,
     android::bluetooth::DeviceInfoSrcEnum source_type,
     const std::string& source_name,
     const std::string& manufacturer,
diff --git a/system/gd/os/metrics.h b/system/gd/os/metrics.h
index 73b9484..3b1ae51 100644
--- a/system/gd/os/metrics.h
+++ b/system/gd/os/metrics.h
@@ -245,6 +245,7 @@
  */
 void LogMetricManufacturerInfo(
     const hci::Address& address,
+    android::bluetooth::AddressTypeEnum address_type,
     android::bluetooth::DeviceInfoSrcEnum source_type,
     const std::string& source_name,
     const std::string& manufacturer,
diff --git a/system/main/shim/acl.cc b/system/main/shim/acl.cc
index 86edaa0..fc0c4b8 100644
--- a/system/main/shim/acl.cc
+++ b/system/main/shim/acl.cc
@@ -1338,12 +1338,16 @@
 void shim::legacy::Acl::AcceptLeConnectionFrom(
     const hci::AddressWithType& address_with_type, bool is_direct,
     std::promise<bool> promise) {
+  LOG_DEBUG("AcceptLeConnectionFrom %s",
+            PRIVATE_ADDRESS(address_with_type.GetAddress()));
   handler_->CallOn(pimpl_.get(), &Acl::impl::accept_le_connection_from,
                    address_with_type, is_direct, std::move(promise));
 }
 
 void shim::legacy::Acl::IgnoreLeConnectionFrom(
     const hci::AddressWithType& address_with_type) {
+  LOG_DEBUG("IgnoreLeConnectionFrom %s",
+            PRIVATE_ADDRESS(address_with_type.GetAddress()));
   handler_->CallOn(pimpl_.get(), &Acl::impl::ignore_le_connection_from,
                    address_with_type);
 }
diff --git a/system/main/shim/metrics_api.cc b/system/main/shim/metrics_api.cc
index 74784f8..99832be 100644
--- a/system/main/shim/metrics_api.cc
+++ b/system/main/shim/metrics_api.cc
@@ -128,13 +128,14 @@
 
 void LogMetricManufacturerInfo(
     const RawAddress& raw_address,
+    android::bluetooth::AddressTypeEnum address_type,
     android::bluetooth::DeviceInfoSrcEnum source_type,
     const std::string& source_name, const std::string& manufacturer,
     const std::string& model, const std::string& hardware_version,
     const std::string& software_version) {
   Address address = bluetooth::ToGdAddress(raw_address);
-  bluetooth::os::LogMetricManufacturerInfo(address, source_type, source_name,
-                                           manufacturer, model,
+  bluetooth::os::LogMetricManufacturerInfo(address, address_type, source_type,
+                                           source_name, manufacturer, model,
                                            hardware_version, software_version);
 }
 
diff --git a/system/main/shim/metrics_api.h b/system/main/shim/metrics_api.h
index 51ee8df..ce13876 100644
--- a/system/main/shim/metrics_api.h
+++ b/system/main/shim/metrics_api.h
@@ -202,7 +202,7 @@
  * @param software_version software version of this device
  */
 void LogMetricManufacturerInfo(
-    const RawAddress& address,
+    const RawAddress& address, android::bluetooth::AddressTypeEnum address_type,
     android::bluetooth::DeviceInfoSrcEnum source_type,
     const std::string& source_name, const std::string& manufacturer,
     const std::string& model, const std::string& hardware_version,
diff --git a/system/setup.py b/system/setup.py
index cdb76f8..597b9df 100644
--- a/system/setup.py
+++ b/system/setup.py
@@ -29,7 +29,7 @@
 install_requires = [
     'grpcio',
     'psutil',
-    'protobuf>=3.14.0',
+    'protobuf>=3.14.0, <4.0',
     'mobly',
 ]
 
diff --git a/system/stack/acl/ble_acl.cc b/system/stack/acl/ble_acl.cc
index 448dabd..a09012a 100644
--- a/system/stack/acl/ble_acl.cc
+++ b/system/stack/acl/ble_acl.cc
@@ -65,8 +65,6 @@
     return false;
   }
 
-  btm_ble_disable_resolving_list(BTM_BLE_RL_INIT, true);
-
   /* Tell BTM Acl management about the link */
   btm_acl_created(address_with_type.bda, handle, role, BT_TRANSPORT_LE);
 
@@ -154,12 +152,10 @@
   if (status != HCI_ERR_ADVERTISING_TIMEOUT) {
     btm_cb.ble_ctr_cb.set_connection_state_idle();
     btm_ble_clear_topology_mask(BTM_BLE_STATE_INIT_BIT);
-    btm_ble_disable_resolving_list(BTM_BLE_RL_INIT, true);
     connection_manager::on_connection_timed_out_from_shim(
         address_with_type.bda);
   } else {
     btm_cb.ble_ctr_cb.inq_var.adv_mode = BTM_BLE_ADV_DISABLE;
-    btm_ble_disable_resolving_list(BTM_BLE_RL_ADV, true);
   }
   btm_ble_update_mode_operation(HCI_ROLE_UNKNOWN, &address_with_type.bda,
                                 status);
diff --git a/system/stack/btm/btm_ble.cc b/system/stack/btm/btm_ble.cc
index 55d7097..9d313b3 100644
--- a/system/stack/btm/btm_ble.cc
+++ b/system/stack/btm/btm_ble.cc
@@ -65,7 +65,7 @@
     return bluetooth::shim::BTM_SecAddBleDevice(bd_addr, dev_type, addr_type);
   }
 
-  BTM_TRACE_DEBUG("%s: dev_type=0x%x", __func__, dev_type);
+  LOG_DEBUG("dev_type=0x%x", dev_type);
 
   tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
   if (!p_dev_rec) {
@@ -81,27 +81,27 @@
     p_dev_rec->conn_params.supervision_tout = BTM_BLE_CONN_PARAM_UNDEF;
     p_dev_rec->conn_params.peripheral_latency = BTM_BLE_CONN_PARAM_UNDEF;
 
-    BTM_TRACE_DEBUG("%s: Device added, handle=0x%x, p_dev_rec=%p, bd_addr=%s",
-                    __func__, p_dev_rec->ble_hci_handle, p_dev_rec,
-                    bd_addr.ToString().c_str());
+    LOG_DEBUG("Device added, handle=0x%x, p_dev_rec=%p, bd_addr=%s",
+              p_dev_rec->ble_hci_handle, p_dev_rec, bd_addr.ToString().c_str());
   }
 
   memset(p_dev_rec->sec_bd_name, 0, sizeof(tBTM_BD_NAME));
 
   p_dev_rec->device_type |= dev_type;
-  if (is_ble_addr_type_known(addr_type))
+  if (is_ble_addr_type_known(addr_type)) {
     p_dev_rec->ble.SetAddressType(addr_type);
-  else
+  } else {
     LOG_WARN(
         "Please do not update device record from anonymous le advertisement");
+  }
 
   /* sync up with the Inq Data base*/
   tBTM_INQ_INFO* p_info = BTM_InqDbRead(bd_addr);
   if (p_info) {
     p_info->results.ble_addr_type = p_dev_rec->ble.AddressType();
     p_info->results.device_type = p_dev_rec->device_type;
-    BTM_TRACE_DEBUG("InqDb  device_type =0x%x  addr_type=0x%x",
-                    p_info->results.device_type, p_info->results.ble_addr_type);
+    LOG_DEBUG("InqDb device_type =0x%x  addr_type=0x%x",
+              p_info->results.device_type, p_info->results.ble_addr_type);
   }
 }
 
diff --git a/system/stack/btm/btm_ble_bgconn.cc b/system/stack/btm/btm_ble_bgconn.cc
index 965e0d0..ef07cdb 100644
--- a/system/stack/btm/btm_ble_bgconn.cc
+++ b/system/stack/btm/btm_ble_bgconn.cc
@@ -206,10 +206,14 @@
     return false;
   }
 
-    return bluetooth::shim::ACL_AcceptLeConnectionFrom(
-        convert_to_address_with_type(address, btm_find_dev(address)),
-        /* is_direct */ false);
+  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(address);
+  if (p_dev_rec != NULL && p_dev_rec->device_type & BT_DEVICE_TYPE_BLE) {
+    p_dev_rec->ble.in_controller_list |= BTM_ACCEPTLIST_BIT;
+  }
 
+  return bluetooth::shim::ACL_AcceptLeConnectionFrom(
+      convert_to_address_with_type(address, p_dev_rec),
+      /* is_direct */ false);
 }
 
 /** Removes the device from acceptlist */
@@ -219,10 +223,14 @@
     return;
   }
 
-    bluetooth::shim::ACL_IgnoreLeConnectionFrom(
-        convert_to_address_with_type(address, btm_find_dev(address)));
-    return;
+  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(address);
+  if (p_dev_rec != NULL && p_dev_rec->device_type & BT_DEVICE_TYPE_BLE) {
+    p_dev_rec->ble.in_controller_list &= ~BTM_ACCEPTLIST_BIT;
+  }
 
+  bluetooth::shim::ACL_IgnoreLeConnectionFrom(
+      convert_to_address_with_type(address, p_dev_rec));
+  return;
 }
 
 /** Clear the acceptlist, end any pending acceptlist connections */
@@ -231,7 +239,5 @@
     LOG_WARN("Controller does not support Le");
     return;
   }
-
-    bluetooth::shim::ACL_IgnoreAllLeConnections();
-    return;
+  bluetooth::shim::ACL_IgnoreAllLeConnections();
 }
diff --git a/system/stack/btm/btm_ble_gap.cc b/system/stack/btm/btm_ble_gap.cc
index 25fcddd..76f6c6f 100644
--- a/system/stack/btm/btm_ble_gap.cc
+++ b/system/stack/btm/btm_ble_gap.cc
@@ -524,10 +524,6 @@
       p_inq->scan_type = (p_inq->scan_type == BTM_BLE_SCAN_MODE_NONE)
                              ? BTM_BLE_SCAN_MODE_ACTI
                              : p_inq->scan_type;
-      /* assume observe always not using acceptlist */
-      /* enable resolving list */
-      btm_ble_enable_resolving_list_for_platform(BTM_BLE_RL_SCAN);
-
       btm_send_hci_set_scan_params(
           p_inq->scan_type, (uint16_t)scan_interval, (uint16_t)scan_window,
           btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type, BTM_BLE_DEFAULT_SFP);
@@ -916,12 +912,6 @@
     address_type = p_i->inq_info.results.ble_addr_type;  // Random
   }
   btm_random_pseudo_to_identity_addr(&addr, &address_type);
-  if (address_type & BLE_ADDR_TYPE_ID_BIT) {
-#if (BLE_PRIVACY_SPT == TRUE)
-    LOG_INFO("Enable resolving list");
-    btm_ble_enable_resolving_list(BTM_BLE_RL_SCAN);
-#endif
-  }
   address_type &= ~BLE_ADDR_TYPE_ID_BIT;
   uint8_t options = 0;
   uint8_t cte_type = 7;
@@ -1111,9 +1101,6 @@
   tBLE_ADDR_TYPE ble_addr_type = to_ble_addr_type(address_type);
   if (ble_addr_type & BLE_ADDR_TYPE_ID_BIT) {
     btm_identity_addr_to_random_pseudo(&bda, &ble_addr_type, true);
-#if (BLE_PRIVACY_SPT == TRUE)
-    btm_ble_disable_resolving_list(BTM_BLE_RL_SCAN, true);
-#endif
   }
   int index = btm_ble_get_psync_index(adv_sid, bda);
   if (index == MAX_SYNC_TRANSACTION) {
@@ -1531,16 +1518,12 @@
         /* only do so for bonded device */
         if ((p_dev_rec = btm_find_or_alloc_dev(p_cb->direct_bda.bda)) != NULL &&
             p_dev_rec->ble.in_controller_list & BTM_RESOLVING_LIST_BIT) {
-          btm_ble_enable_resolving_list(BTM_BLE_RL_ADV);
           p_peer_addr_ptr = p_dev_rec->ble.identity_address_with_type.bda;
           *p_peer_addr_type = p_dev_rec->ble.identity_address_with_type.type;
           *p_own_addr_type = BLE_ADDR_RANDOM_ID;
           return evt_type;
         }
         /* otherwise fall though as normal directed adv */
-        else {
-          btm_ble_disable_resolving_list(BTM_BLE_RL_ADV, true);
-        }
       }
       /* direct adv mode does not have privacy, if privacy is not enabled  */
       *p_peer_addr_type = p_cb->direct_bda.type;
@@ -1833,8 +1816,6 @@
     /* start initial GAP mode adv timer */
     alarm_set_on_mloop(p_cb->fast_adv_timer, BTM_BLE_GAP_FAST_ADV_TIMEOUT_MS,
                        btm_ble_fast_adv_timer_timeout, NULL);
-  } else {
-    btm_ble_disable_resolving_list(BTM_BLE_RL_ADV, true);
   }
 
   /* set up stop advertising timer */
@@ -1918,8 +1899,6 @@
     /* start initial GAP mode adv timer */
     alarm_set_on_mloop(p_cb->fast_adv_timer, BTM_BLE_GAP_FAST_ADV_TIMEOUT_MS,
                        btm_ble_fast_adv_timer_timeout, NULL);
-  } else {
-    btm_ble_disable_resolving_list(BTM_BLE_RL_ADV, true);
   }
   return status;
 }
@@ -2021,8 +2000,6 @@
         BTM_BLE_SCAN_MODE_ACTI, BTM_BLE_LOW_LATENCY_SCAN_INT,
         BTM_BLE_LOW_LATENCY_SCAN_WIN,
         btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type, SP_ADV_ALL);
-    /* enable IRK list */
-    btm_ble_enable_resolving_list_for_platform(BTM_BLE_RL_SCAN);
     p_ble_cb->inq_var.scan_type = BTM_BLE_SCAN_MODE_ACTI;
     btm_ble_start_scan();
   } else if ((p_ble_cb->inq_var.scan_interval !=
@@ -3066,13 +3043,6 @@
   if (!btm_ble_adv_states_operation(btm_ble_topology_check, p_cb->evt_type))
     return BTM_WRONG_MODE;
 
-  /* To relax resolving list,  always have resolving list enabled, unless
-   * directed adv */
-  if (p_cb->evt_type != BTM_BLE_CONNECT_LO_DUTY_DIR_EVT &&
-      p_cb->evt_type != BTM_BLE_CONNECT_DIR_EVT)
-    /* enable resolving list is desired */
-    btm_ble_enable_resolving_list_for_platform(BTM_BLE_RL_ADV);
-
   btsnd_hcic_ble_set_adv_enable(BTM_BLE_ADV_ENABLE);
   p_cb->adv_mode = BTM_BLE_ADV_ENABLE;
   btm_ble_adv_states_operation(btm_ble_set_topology_mask, p_cb->evt_type);
diff --git a/system/stack/btm/btm_ble_int.h b/system/stack/btm/btm_ble_int.h
index 8ca11f7..25ab518 100644
--- a/system/stack/btm/btm_ble_int.h
+++ b/system/stack/btm/btm_ble_int.h
@@ -121,12 +121,7 @@
                                     tBTM_SEC_DEV_REC* p_dev_rec);
 
 extern void btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC& p_dev_rec);
-extern bool btm_ble_resolving_list_load_dev(
-    tBTM_SEC_DEV_REC* p_dev_rec);  // DEPRECATED
 extern void btm_ble_resolving_list_remove_dev(tBTM_SEC_DEV_REC* p_dev_rec);
-extern void btm_ble_enable_resolving_list(uint8_t);
-extern bool btm_ble_disable_resolving_list(uint8_t rl_mask, bool to_resume);
-extern void btm_ble_enable_resolving_list_for_platform(uint8_t rl_mask);
 extern void btm_ble_resolving_list_init(uint8_t max_irk_list_sz);
 
 extern void btm_ble_adv_init(void);
diff --git a/system/stack/btm/btm_ble_privacy.cc b/system/stack/btm/btm_ble_privacy.cc
index f5e2b78..b2f26fa 100644
--- a/system/stack/btm/btm_ble_privacy.cc
+++ b/system/stack/btm/btm_ble_privacy.cc
@@ -434,10 +434,9 @@
     BTM_VendorSpecificCommand(HCI_VENDOR_BLE_RPA_VSC,
                               BTM_BLE_META_REMOVE_IRK_LEN, param,
                               btm_ble_resolving_list_vsc_op_cmpl);
+    btm_ble_enq_resolving_list_pending(p_dev_rec->bd_addr,
+                                       BTM_BLE_META_REMOVE_IRK_ENTRY);
   }
-
-  btm_ble_enq_resolving_list_pending(p_dev_rec->bd_addr,
-                                     BTM_BLE_META_REMOVE_IRK_ENTRY);
   return BTM_CMD_STARTED;
 }
 
@@ -495,136 +494,10 @@
 
     BTM_VendorSpecificCommand(HCI_VENDOR_BLE_RPA_VSC, BTM_BLE_META_READ_IRK_LEN,
                               param, btm_ble_resolving_list_vsc_op_cmpl);
+
+    btm_ble_enq_resolving_list_pending(p_dev_rec->bd_addr,
+                                       BTM_BLE_META_READ_IRK_ENTRY);
   }
-
-  btm_ble_enq_resolving_list_pending(p_dev_rec->bd_addr,
-                                     BTM_BLE_META_READ_IRK_ENTRY);
-
-  return true;
-}
-
-/*******************************************************************************
- *
- * Function         btm_ble_disable_resolving_list
- *
- * Description      Disable LE Address resolution
- *
- * Returns          none
- *
- ******************************************************************************/
-bool btm_ble_disable_resolving_list(uint8_t rl_mask, bool to_resume) {
-  LOG_DEBUG("GD automatically disables Address Resolution list");
-  return true;
-}
-
-/*******************************************************************************
- *
- * Function         btm_ble_resolving_list_load_dev
- *
- * Description      This function adds a device which is using RPA into the
- *                  acceptlist.
- *
- * Parameters       pointer to device security record
- *
- * Returns          true if device added, otherwise falase.
- *
- ******************************************************************************/
-bool btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC* p_dev_rec) {
-  ASSERT_LOG(false,
-             "API is disabled...use signature <void(tBTM_SEC_DEV_REC&)>");
-
-  const uint8_t rl_state = btm_cb.ble_ctr_cb.rl_state;
-
-  if (controller_get_interface()->get_ble_resolving_list_max_size() == 0) {
-    BTM_TRACE_DEBUG(
-        "%s: Controller does not support RPA offloading or privacy 1.2",
-        __func__);
-    return false;
-  }
-
-  BTM_TRACE_DEBUG("%s: btm_cb.ble_ctr_cb.privacy_mode = %d", __func__,
-                  btm_cb.ble_ctr_cb.privacy_mode);
-
-  if (!p_dev_rec) {
-    BTM_TRACE_DEBUG("%s: No device security record", __func__);
-    return false;
-  }
-
-  /* only add RPA enabled device into resolving list */
-  if (controller_get_interface()->supports_ble_privacy()) {
-    if ((p_dev_rec->ble.key_type & (BTM_LE_KEY_PID | BTM_LE_KEY_LID)) == 0) {
-      BTM_TRACE_DEBUG("%s: privacy 1.2: Device not a RPA enabled device",
-                      __func__);
-      return false;
-    }
-  } else if ((p_dev_rec->ble.key_type & BTM_LE_KEY_PID) == 0) {
-    BTM_TRACE_DEBUG("%s: RPA offloading: Device not a RPA enabled device",
-                    __func__);
-    return false;
-  }
-
-  if ((p_dev_rec->ble.in_controller_list & BTM_RESOLVING_LIST_BIT) ||
-      btm_ble_brcm_find_resolving_pending_entry(p_dev_rec->bd_addr,
-                                                BTM_BLE_META_ADD_IRK_ENTRY)) {
-    BTM_TRACE_ERROR("%s: Device already in Resolving list", __func__);
-    return true;
-  }
-
-  if (btm_cb.ble_ctr_cb.resolving_list_avail_size == 0) {
-    return false;
-  }
-
-  if (rl_state && !btm_ble_disable_resolving_list(rl_state, false)) {
-    return false;
-  }
-
-  if (controller_get_interface()->supports_ble_privacy()) {
-    const Octet16& peer_irk = p_dev_rec->ble.keys.irk;
-    const Octet16& local_irk = btm_cb.devcb.id_keys.irk;
-
-    if (p_dev_rec->ble.identity_address_with_type.bda.IsEmpty()) {
-      p_dev_rec->ble.identity_address_with_type.bda = p_dev_rec->bd_addr;
-      p_dev_rec->ble.identity_address_with_type.type =
-          p_dev_rec->ble.AddressType();
-    }
-
-    BTM_TRACE_DEBUG(
-        "%s: adding device %s to controller resolving list", __func__,
-        p_dev_rec->ble.identity_address_with_type.bda.ToString().c_str());
-
-    // use identical IRK for now
-    btsnd_hcic_ble_add_device_resolving_list(
-        p_dev_rec->ble.identity_address_with_type.type,
-        p_dev_rec->ble.identity_address_with_type.bda, peer_irk, local_irk);
-
-    if (controller_get_interface()->supports_ble_set_privacy_mode()) {
-      BTM_TRACE_DEBUG("%s: adding device privacy mode", __func__);
-      btsnd_hcic_ble_set_privacy_mode(
-          p_dev_rec->ble.identity_address_with_type.type,
-          p_dev_rec->ble.identity_address_with_type.bda, 0x01);
-    }
-  } else {
-    uint8_t param[40] = {0};
-    uint8_t* p = param;
-
-    UINT8_TO_STREAM(p, BTM_BLE_META_ADD_IRK_ENTRY);
-    ARRAY_TO_STREAM(p, p_dev_rec->ble.keys.irk, OCTET16_LEN);
-    UINT8_TO_STREAM(p, p_dev_rec->ble.identity_address_with_type.type);
-    BDADDR_TO_STREAM(p, p_dev_rec->ble.identity_address_with_type.bda);
-
-    BTM_VendorSpecificCommand(HCI_VENDOR_BLE_RPA_VSC, BTM_BLE_META_ADD_IRK_LEN,
-                              param, btm_ble_resolving_list_vsc_op_cmpl);
-  }
-
-  btm_ble_enq_resolving_list_pending(p_dev_rec->bd_addr,
-                                     BTM_BLE_META_ADD_IRK_ENTRY);
-
-  /* if resolving list has been turned on, re-enable it */
-  if (rl_state)
-    btm_ble_enable_resolving_list(rl_state);
-  else
-    btm_ble_enable_resolving_list(BTM_BLE_RL_INIT);
-
   return true;
 }
 
@@ -707,12 +580,7 @@
  *
  ******************************************************************************/
 void btm_ble_resolving_list_remove_dev(tBTM_SEC_DEV_REC* p_dev_rec) {
-  uint8_t rl_mask = btm_cb.ble_ctr_cb.rl_state;
-
   BTM_TRACE_EVENT("%s", __func__);
-  if (rl_mask) {
-    if (!btm_ble_disable_resolving_list(rl_mask, false)) return;
-  }
 
   if ((p_dev_rec->ble.in_controller_list & BTM_RESOLVING_LIST_BIT) &&
       !btm_ble_brcm_find_resolving_pending_entry(
@@ -722,63 +590,6 @@
   } else {
     BTM_TRACE_DEBUG("Device not in resolving list");
   }
-
-  /* if resolving list has been turned on, re-enable it */
-  if (rl_mask) btm_ble_enable_resolving_list(rl_mask);
-}
-
-/*******************************************************************************
- *
- * Function         btm_ble_enable_resolving_list
- *
- * Description      enable LE resolve address list
- *
- * Returns          none
- *
- ******************************************************************************/
-void btm_ble_enable_resolving_list(uint8_t rl_mask) {
-  LOG_DEBUG("GD automatically enables Address Resolution list");
-}
-
-static bool is_on_resolving_list(void* data, void* context) {
-  tBTM_SEC_DEV_REC* p_dev = static_cast<tBTM_SEC_DEV_REC*>(data);
-  if ((p_dev->ble.in_controller_list & BTM_RESOLVING_LIST_BIT) &&
-      (p_dev->ble.in_controller_list & BTM_ACCEPTLIST_BIT))
-    return false;
-
-  return true;
-}
-
-/*******************************************************************************
- *
- * Function         btm_ble_enable_resolving_list_for_platform
- *
- * Description      enable/disable resolving list feature depending on if any
- *                  resolving list is empty and acceptlist is involoved in the
- *                  operation.
- *
- * Returns          none
- *
- ******************************************************************************/
-void btm_ble_enable_resolving_list_for_platform(uint8_t rl_mask) {
-  /* if controller does not support, skip */
-  if (controller_get_interface()->get_ble_resolving_list_max_size() == 0)
-    return;
-
-  if (btm_cb.ble_ctr_cb.wl_state == BTM_BLE_WL_IDLE) {
-    if (controller_get_interface()->get_ble_resolving_list_max_size() >
-        btm_cb.ble_ctr_cb.resolving_list_avail_size)
-      btm_ble_enable_resolving_list(rl_mask);
-    else
-      btm_ble_disable_resolving_list(rl_mask, true);
-    return;
-  }
-
-  list_node_t* n = list_foreach(btm_cb.sec_dev_rec, is_on_resolving_list, NULL);
-  if (n)
-    btm_ble_enable_resolving_list(rl_mask);
-  else
-    btm_ble_disable_resolving_list(rl_mask, true);
 }
 
 /*******************************************************************************
diff --git a/system/stack/btm/btm_dev.cc b/system/stack/btm/btm_dev.cc
index eeb37be..4067e3d 100644
--- a/system/stack/btm/btm_dev.cc
+++ b/system/stack/btm/btm_dev.cc
@@ -136,6 +136,9 @@
   list_remove(btm_cb.sec_dev_rec, p_dev_rec);
 }
 
+/** Removes the device from acceptlist */
+extern void BTM_AcceptlistRemove(const RawAddress& address);
+
 /** Free resources associated with the device associated with |bd_addr| address.
  *
  * *** WARNING ***
@@ -162,6 +165,12 @@
   if (p_dev_rec != NULL) {
     RawAddress bda = p_dev_rec->bd_addr;
 
+    if (p_dev_rec->ble.in_controller_list & BTM_ACCEPTLIST_BIT) {
+      LOG_INFO("Remove device %s from filter accept list before delete record",
+               PRIVATE_ADDRESS(bd_addr));
+      BTM_AcceptlistRemove(p_dev_rec->bd_addr);
+    }
+
     /* Clear out any saved BLE keys */
     btm_sec_clear_ble_keys(p_dev_rec);
     wipe_secrets_and_remove(p_dev_rec);
diff --git a/system/stack/gatt/connection_manager.cc b/system/stack/gatt/connection_manager.cc
index b2499b4..c6052c2 100644
--- a/system/stack/gatt/connection_manager.cc
+++ b/system/stack/gatt/connection_manager.cc
@@ -86,6 +86,7 @@
 /** background connection device from the list. Returns pointer to the device
  * record, or nullptr if not found */
 std::set<tAPP_ID> get_apps_connecting_to(const RawAddress& address) {
+  LOG_DEBUG("address=%s", address.ToString().c_str());
   auto it = bgconn_dev.find(address);
   return (it != bgconn_dev.end()) ? it->second.doing_bg_conn
                                   : std::set<tAPP_ID>();
@@ -94,6 +95,8 @@
 /** Add a device from the background connection list.  Returns true if device
  * added to the list, or already in list, false otherwise */
 bool background_connect_add(uint8_t app_id, const RawAddress& address) {
+  LOG_DEBUG("app_id=%d, address=%s", static_cast<int>(app_id),
+            address.ToString().c_str());
   if (bluetooth::shim::is_gd_l2cap_enabled()) {
     return L2CA_ConnectFixedChnl(L2CAP_ATT_CID, address);
   }
@@ -103,23 +106,30 @@
   if (it != bgconn_dev.end()) {
     // device already in the acceptlist, just add interested app to the list
     if (it->second.doing_bg_conn.count(app_id)) {
-      LOG(INFO) << "App id=" << loghex(app_id)
-                << "already doing background connection to " << address;
+      LOG_DEBUG("app_id=%d, already doing background connection to address=%s",
+                static_cast<int>(app_id), address.ToString().c_str());
       return true;
     }
 
     // Already in acceptlist ?
     if (anyone_connecting(it)) {
+      LOG_DEBUG("app_id=%d, address=%s, already in accept list",
+                static_cast<int>(app_id), address.ToString().c_str());
       in_acceptlist = true;
     }
   }
 
   if (!in_acceptlist) {
     // the device is not in the acceptlist
-    if (!BTM_AcceptlistAdd(address)) return false;
+    if (!BTM_AcceptlistAdd(address)) {
+      LOG_WARN("Failed to add device %s to accept list for app %d",
+               address.ToString().c_str(), static_cast<int>(app_id));
+      return false;
+    }
   }
 
-  // create endtry for address, and insert app_id.
+  // create entry for address, and insert app_id.
+  // new tAPPS_CONNECTING will be default constructed if not exist
   bgconn_dev[address].doing_bg_conn.insert(app_id);
   return true;
 }
@@ -127,8 +137,12 @@
 /** Removes all registrations for connection for given device.
  * Returns true if anything was removed, false otherwise */
 bool remove_unconditional(const RawAddress& address) {
+  LOG_DEBUG("address=%s", address.ToString().c_str());
   auto it = bgconn_dev.find(address);
-  if (it == bgconn_dev.end()) return false;
+  if (it == bgconn_dev.end()) {
+    LOG_WARN("address %s is not found", address.ToString().c_str());
+    return false;
+  }
 
   BTM_AcceptlistRemove(address);
   bgconn_dev.erase(it);
@@ -140,25 +154,41 @@
  * shim purposes.
  * Returns true if anything was removed, false otherwise */
 bool remove_unconditional_from_shim(const RawAddress& address) {
+  LOG_DEBUG("address=%s", address.ToString().c_str());
   auto it = bgconn_dev.find(address);
-  if (it == bgconn_dev.end()) return false;
+  if (it == bgconn_dev.end()) {
+    LOG_WARN("address %s is not found", address.ToString().c_str());
+    return false;
+  }
   bgconn_dev.erase(it);
   return true;
 }
 
 /** Remove device from the background connection device list or listening to
- * advertising list.  Returns true if device was on the list and was succesfully
- * removed */
+ * advertising list.  Returns true if device was on the list and was
+ * successfully removed */
 bool background_connect_remove(uint8_t app_id, const RawAddress& address) {
-  VLOG(2) << __func__;
+  LOG_DEBUG("app_id=%d, address=%s", static_cast<int>(app_id),
+            address.ToString().c_str());
   auto it = bgconn_dev.find(address);
-  if (it == bgconn_dev.end()) return false;
+  if (it == bgconn_dev.end()) {
+    LOG_WARN("address %s is not found", address.ToString().c_str());
+    return false;
+  }
 
-  if (!it->second.doing_bg_conn.erase(app_id)) return false;
+  if (!it->second.doing_bg_conn.erase(app_id)) {
+    LOG_WARN("Failed to remove background connection app %d for address %s",
+             static_cast<int>(app_id), address.ToString().c_str());
+    return false;
+  }
 
-  if (anyone_connecting(it)) return true;
+  if (anyone_connecting(it)) {
+    LOG_DEBUG("some device is still connecting, app_id=%d, address=%s",
+              static_cast<int>(app_id), address.ToString().c_str());
+    return true;
+  }
 
-  // no more apps interested - remove from acceptlist and delete record
+  // no more apps interested - remove from accept list and delete record
   BTM_AcceptlistRemove(address);
   bgconn_dev.erase(it);
   return true;
@@ -166,6 +196,7 @@
 
 /** deregister all related background connetion device. */
 void on_app_deregistered(uint8_t app_id) {
+  LOG_DEBUG("app_id=%d", static_cast<int>(app_id));
   auto it = bgconn_dev.begin();
   auto end = bgconn_dev.end();
   /* update the BG conn device list */
@@ -186,6 +217,7 @@
 
 static void remove_all_clients_with_pending_connections(
     const RawAddress& address) {
+  LOG_DEBUG("address=%s", address.ToString().c_str());
   auto it = bgconn_dev.find(address);
   while (it != bgconn_dev.end() && !it->second.doing_direct_conn.empty()) {
     uint8_t app_id = it->second.doing_direct_conn.begin()->first;
@@ -212,6 +244,8 @@
 }
 
 void wl_direct_connect_timeout_cb(uint8_t app_id, const RawAddress& address) {
+  LOG_DEBUG("app_id=%d, address=%s", static_cast<int>(app_id),
+            address.ToString().c_str());
   on_connection_timed_out(app_id, address);
 
   // TODO: this would free the timer, from within the timer callback, which is
@@ -222,6 +256,8 @@
 /** Add a device to the direcgt connection list.  Returns true if device
  * added to the list, false otherwise */
 bool direct_connect_add(uint8_t app_id, const RawAddress& address) {
+  LOG_DEBUG("app_id=%d, address=%s", static_cast<int>(app_id),
+            address.ToString().c_str());
   if (bluetooth::shim::is_gd_l2cap_enabled()) {
     return L2CA_ConnectFixedChnl(L2CAP_ATT_CID, address);
   }
@@ -274,6 +310,8 @@
 }
 
 bool direct_connect_remove(uint8_t app_id, const RawAddress& address) {
+  LOG_DEBUG("app_id=%d, address=%s", static_cast<int>(app_id),
+            address.ToString().c_str());
   auto it = bgconn_dev.find(address);
   if (it == bgconn_dev.end()) {
     LOG_WARN("Unable to find background connection to remove");
diff --git a/system/stack/gatt/gatt_api.cc b/system/stack/gatt/gatt_api.cc
index ded621b..b55e625 100644
--- a/system/stack/gatt/gatt_api.cc
+++ b/system/stack/gatt/gatt_api.cc
@@ -961,16 +961,17 @@
   bool status = false;
 
   tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, transport);
-  if (p_tcb != NULL) {
+  if (p_tcb != nullptr) {
     status = L2CA_SetLeGattTimeout(bd_addr, idle_tout);
 
-    if (idle_tout == GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP)
+    if (idle_tout == GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP) {
       L2CA_SetIdleTimeoutByBdAddr(
           p_tcb->peer_bda, GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP, BT_TRANSPORT_LE);
+    }
   }
 
-  VLOG(1) << __func__ << " idle_tout=" << idle_tout << ", status=" << +status
-          << " (1-OK 0-not performed)";
+  LOG_INFO("idle_timeout=%d, status=%d, (1-OK 0-not performed)", idle_tout,
+           +status);
 }
 
 /*******************************************************************************
@@ -1162,22 +1163,18 @@
   /* Make sure app is registered */
   tGATT_REG* p_reg = gatt_get_regcb(gatt_if);
   if (!p_reg) {
-    LOG(ERROR) << __func__
-               << ": Unable to find registered app gatt_if=" << +gatt_if;
+    LOG_ERROR("Unable to find registered app gatt_if=%d", +gatt_if);
     return false;
   }
 
   if (!is_direct && transport != BT_TRANSPORT_LE) {
-    LOG(ERROR) << __func__
-               << ": Unsupported transport for background connection gatt_if="
-               << +gatt_if;
+    LOG_WARN("Unsupported transport for background connection gatt_if=%d",
+             +gatt_if);
     return false;
   }
 
   if (opportunistic) {
-    LOG(INFO) << __func__
-              << ": Registered for opportunistic connection gatt_if="
-              << +gatt_if;
+    LOG_INFO("Registered for opportunistic connection gatt_if=%d", +gatt_if);
     return true;
   }
 
@@ -1193,20 +1190,27 @@
       //  RPA can rotate, causing address to "expire" in the background
       //  connection list. RPA is allowed for direct connect, as such request
       //  times out after 30 seconds
-      LOG(INFO) << __func__
-                << ": Unable to add RPA to background connection gatt_if="
-                << +gatt_if;
-      ret = true;
+      LOG_WARN("Unable to add RPA %s to background connection gatt_if=%d",
+               bd_addr.ToString().c_str(), +gatt_if);
+      ret = false;
     } else {
-      LOG_DEBUG("Adding to acceptlist device:%s", PRIVATE_ADDRESS(bd_addr));
+      LOG_DEBUG("Adding to accept list device:%s", PRIVATE_ADDRESS(bd_addr));
       ret = connection_manager::background_connect_add(gatt_if, bd_addr);
     }
   }
 
   tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, transport);
   // background connections don't necessarily create tcb
-  if (p_tcb && ret)
+  if (p_tcb && ret) {
     gatt_update_app_use_link_flag(p_reg->gatt_if, p_tcb, true, !is_direct);
+  } else {
+    if (p_tcb == nullptr) {
+      LOG_DEBUG("p_tcb is null");
+    }
+    if (!ret) {
+      LOG_DEBUG("Previous step returned false");
+    }
+  }
 
   return ret;
 }
@@ -1239,10 +1243,11 @@
       return false;
     }
 
-    if (is_direct)
+    if (is_direct) {
       return gatt_cancel_open(gatt_if, bd_addr);
-    else
+    } else {
       return gatt_auto_connect_dev_remove(p_reg->gatt_if, bd_addr);
+    }
   }
 
   VLOG(1) << " unconditional";
@@ -1283,11 +1288,14 @@
  *
  ******************************************************************************/
 tGATT_STATUS GATT_Disconnect(uint16_t conn_id) {
-  LOG(INFO) << __func__ << " conn_id=" << loghex(conn_id);
+  LOG_INFO("conn_id=%d", +conn_id);
 
   uint8_t tcb_idx = GATT_GET_TCB_IDX(conn_id);
   tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx);
-  if (!p_tcb) return GATT_ILLEGAL_PARAMETER;
+  if (!p_tcb) {
+    LOG_WARN("Cannot find TCB for connection %d", conn_id);
+    return GATT_ILLEGAL_PARAMETER;
+  }
 
   tGATT_IF gatt_if = GATT_GET_GATT_IF(conn_id);
   gatt_update_app_use_link_flag(gatt_if, p_tcb, false, true);
@@ -1351,6 +1359,6 @@
     status = true;
   }
 
-  VLOG(1) << __func__ << " status= " << +status;
+  LOG_DEBUG("status=%d", status);
   return status;
 }
diff --git a/system/stack/gatt/gatt_main.cc b/system/stack/gatt/gatt_main.cc
index 6b61708..f2d0637 100644
--- a/system/stack/gatt/gatt_main.cc
+++ b/system/stack/gatt/gatt_main.cc
@@ -290,26 +290,27 @@
  ******************************************************************************/
 bool gatt_update_app_hold_link_status(tGATT_IF gatt_if, tGATT_TCB* p_tcb,
                                       bool is_add) {
+  LOG_DEBUG("gatt_if=%d, is_add=%d, peer_bda=%s", +gatt_if, is_add,
+            p_tcb->peer_bda.ToString().c_str());
   auto& holders = p_tcb->app_hold_link;
 
-  VLOG(1) << __func__;
   if (is_add) {
     auto ret = holders.insert(gatt_if);
     if (ret.second) {
-      VLOG(1) << "added gatt_if=" << +gatt_if;
+      LOG_DEBUG("added gatt_if=%d", +gatt_if);
     } else {
-      VLOG(1) << "attempt to add already existing gatt_if=" << +gatt_if;
+      LOG_DEBUG("attempt to add already existing gatt_if=%d", +gatt_if);
     }
     return true;
   }
 
   //! is_add
   if (!holders.erase(gatt_if)) {
-    VLOG(1) << "attempt to remove nonexisting gatt_if=" << +gatt_if;
+    LOG_WARN("attempt to remove non-existing gatt_if=%d", +gatt_if);
     return false;
   }
 
-  VLOG(1) << "removed gatt_if=" << +gatt_if;
+  LOG_INFO("removed gatt_if=%d", +gatt_if);
   return true;
 }
 
@@ -326,16 +327,23 @@
  ******************************************************************************/
 void gatt_update_app_use_link_flag(tGATT_IF gatt_if, tGATT_TCB* p_tcb,
                                    bool is_add, bool check_acl_link) {
-  VLOG(1) << StringPrintf("%s: is_add=%d chk_link=%d", __func__, is_add,
-                          check_acl_link);
+  LOG_DEBUG("gatt_if=%d, is_add=%d chk_link=%d", +gatt_if, is_add,
+            check_acl_link);
 
-  if (!p_tcb) return;
+  if (!p_tcb) {
+    LOG_WARN("p_tcb is null");
+    return;
+  }
 
   // If we make no modification, i.e. kill app that was never connected to a
   // device, skip updating the device state.
-  if (!gatt_update_app_hold_link_status(gatt_if, p_tcb, is_add)) return;
+  if (!gatt_update_app_hold_link_status(gatt_if, p_tcb, is_add)) {
+    LOG_INFO("App status is not updated for gatt_if=%d", +gatt_if);
+    return;
+  }
 
   if (!check_acl_link) {
+    LOG_INFO("check_acl_link is false, no need to check");
     return;
   }
 
@@ -345,28 +353,37 @@
 
   if (is_add) {
     if (p_tcb->att_lcid == L2CAP_ATT_CID && is_valid_handle) {
-      VLOG(1) << "disable link idle timer";
+      LOG_INFO("disable link idle timer for %s",
+               p_tcb->peer_bda.ToString().c_str());
       /* acl link is connected disable the idle timeout */
       GATT_SetIdleTimeout(p_tcb->peer_bda, GATT_LINK_NO_IDLE_TIMEOUT,
                           p_tcb->transport);
+    } else {
+      LOG_INFO("invalid handle %d or dynamic CID %d", is_valid_handle,
+               p_tcb->att_lcid);
     }
   } else {
     if (p_tcb->app_hold_link.empty()) {
       // acl link is connected but no application needs to use the link
       if (p_tcb->att_lcid == L2CAP_ATT_CID && is_valid_handle) {
-
         /* Drop EATT before closing ATT */
         EattExtension::GetInstance()->Disconnect(p_tcb->peer_bda);
 
         /* for fixed channel, set the timeout value to
            GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP seconds */
-        VLOG(1) << " start link idle timer = "
-                << GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP << " sec";
+        LOG_INFO(
+            "GATT fixed channel is no longer useful, start link idle timer for "
+            "%d seconds",
+            GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP);
         GATT_SetIdleTimeout(p_tcb->peer_bda, GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP,
                             p_tcb->transport);
-      } else
+      } else {
         // disconnect the dynamic channel
+        LOG_INFO("disconnect GATT dynamic channel");
         gatt_disconnect(p_tcb);
+      }
+    } else {
+      LOG_INFO("is_add=false, but some app is still using the ACL link");
     }
   }
 }
diff --git a/system/stack/gatt/gatt_utils.cc b/system/stack/gatt/gatt_utils.cc
index 338b277..11a0f85 100644
--- a/system/stack/gatt/gatt_utils.cc
+++ b/system/stack/gatt/gatt_utils.cc
@@ -409,7 +409,7 @@
  ******************************************************************************/
 tGATT_TCB* gatt_find_tcb_by_addr(const RawAddress& bda,
                                  tBT_TRANSPORT transport) {
-  tGATT_TCB* p_tcb = NULL;
+  tGATT_TCB* p_tcb = nullptr;
   uint8_t i = 0;
 
   i = gatt_find_i_tcb_by_addr(bda, transport);
diff --git a/system/stack/hcic/hciblecmds.cc b/system/stack/hcic/hciblecmds.cc
index 6374202..25e66d6 100644
--- a/system/stack/hcic/hciblecmds.cc
+++ b/system/stack/hcic/hciblecmds.cc
@@ -593,73 +593,6 @@
   btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
 }
 
-void btsnd_hcic_ble_add_device_resolving_list(uint8_t addr_type_peer,
-                                              const RawAddress& bda_peer,
-                                              const Octet16& irk_peer,
-                                              const Octet16& irk_local) {
-  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
-  uint8_t* pp = (uint8_t*)(p + 1);
-
-  p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_ADD_DEV_RESOLVING_LIST;
-  p->offset = 0;
-
-  UINT16_TO_STREAM(pp, HCI_BLE_ADD_DEV_RESOLVING_LIST);
-  UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BLE_ADD_DEV_RESOLVING_LIST);
-  UINT8_TO_STREAM(pp, addr_type_peer);
-  BDADDR_TO_STREAM(pp, bda_peer);
-  ARRAY_TO_STREAM(pp, irk_peer.data(), HCIC_BLE_ENCRYPT_KEY_SIZE);
-  ARRAY_TO_STREAM(pp, irk_local.data(), HCIC_BLE_ENCRYPT_KEY_SIZE);
-
-  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
-}
-
-void btsnd_hcic_ble_rm_device_resolving_list(uint8_t addr_type_peer,
-                                             const RawAddress& bda_peer) {
-  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
-  uint8_t* pp = (uint8_t*)(p + 1);
-
-  p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_RM_DEV_RESOLVING_LIST;
-  p->offset = 0;
-
-  UINT16_TO_STREAM(pp, HCI_BLE_RM_DEV_RESOLVING_LIST);
-  UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BLE_RM_DEV_RESOLVING_LIST);
-  UINT8_TO_STREAM(pp, addr_type_peer);
-  BDADDR_TO_STREAM(pp, bda_peer);
-
-  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
-}
-
-void btsnd_hcic_ble_set_privacy_mode(uint8_t addr_type_peer,
-                                     const RawAddress& bda_peer,
-                                     uint8_t privacy_type) {
-  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
-  uint8_t* pp = (uint8_t*)(p + 1);
-
-  p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_SET_PRIVACY_MODE;
-  p->offset = 0;
-
-  UINT16_TO_STREAM(pp, HCI_BLE_SET_PRIVACY_MODE);
-  UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BLE_SET_PRIVACY_MODE);
-  UINT8_TO_STREAM(pp, addr_type_peer);
-  BDADDR_TO_STREAM(pp, bda_peer);
-  UINT8_TO_STREAM(pp, privacy_type);
-
-  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
-}
-
-void btsnd_hcic_ble_clear_resolving_list(void) {
-  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
-  uint8_t* pp = (uint8_t*)(p + 1);
-
-  p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CLEAR_RESOLVING_LIST;
-  p->offset = 0;
-
-  UINT16_TO_STREAM(pp, HCI_BLE_CLEAR_RESOLVING_LIST);
-  UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BLE_CLEAR_RESOLVING_LIST);
-
-  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
-}
-
 void btsnd_hcic_ble_read_resolvable_addr_peer(uint8_t addr_type_peer,
                                               const RawAddress& bda_peer) {
   BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
diff --git a/system/stack/include/gatt_api.h b/system/stack/include/gatt_api.h
index 33a6eae..b38e943 100644
--- a/system/stack/include/gatt_api.h
+++ b/system/stack/include/gatt_api.h
@@ -247,7 +247,7 @@
 /* max legth of an attribute value
 */
 #ifndef GATT_MAX_ATTR_LEN
-#define GATT_MAX_ATTR_LEN 600
+#define GATT_MAX_ATTR_LEN 512
 #endif
 
 /* default GATT MTU size over LE link
diff --git a/system/stack/include/hcimsgs.h b/system/stack/include/hcimsgs.h
index d35944a..6fe70a3 100644
--- a/system/stack/include/hcimsgs.h
+++ b/system/stack/include/hcimsgs.h
@@ -463,11 +463,6 @@
                                            uint16_t tx_octets,
                                            uint16_t tx_time);
 
-extern void btsnd_hcic_ble_add_device_resolving_list(uint8_t addr_type_peer,
-                                                     const RawAddress& bda_peer,
-                                                     const Octet16& irk_peer,
-                                                     const Octet16& irk_local);
-
 struct scanning_phy_cfg {
   uint8_t scan_type;
   uint16_t scan_int;
@@ -501,15 +496,6 @@
                                            uint8_t initiating_phys,
                                            EXT_CONN_PHY_CFG* phy_cfg);
 
-extern void btsnd_hcic_ble_rm_device_resolving_list(
-    tBLE_ADDR_TYPE addr_type_peer, const RawAddress& bda_peer);
-
-extern void btsnd_hcic_ble_set_privacy_mode(tBLE_ADDR_TYPE addr_type_peer,
-                                            const RawAddress& bda_peer,
-                                            uint8_t privacy_type);
-
-extern void btsnd_hcic_ble_clear_resolving_list(void);
-
 extern void btsnd_hcic_ble_read_resolvable_addr_peer(
     uint8_t addr_type_peer, const RawAddress& bda_peer);
 
diff --git a/system/stack/include/stack_metrics_logging.h b/system/stack/include/stack_metrics_logging.h
index 56921dd..158c98f 100644
--- a/system/stack/include/stack_metrics_logging.h
+++ b/system/stack/include/stack_metrics_logging.h
@@ -43,6 +43,7 @@
                        const char* attribute_value);
 
 void log_manufacturer_info(const RawAddress& address,
+                           android::bluetooth::AddressTypeEnum address_type,
                            android::bluetooth::DeviceInfoSrcEnum source_type,
                            const std::string& source_name,
                            const std::string& manufacturer,
diff --git a/system/stack/metrics/stack_metrics_logging.cc b/system/stack/metrics/stack_metrics_logging.cc
index 50f029f..4e23bd2 100644
--- a/system/stack/metrics/stack_metrics_logging.cc
+++ b/system/stack/metrics/stack_metrics_logging.cc
@@ -57,6 +57,7 @@
 }
 
 void log_manufacturer_info(const RawAddress& address,
+                           android::bluetooth::AddressTypeEnum address_type,
                            android::bluetooth::DeviceInfoSrcEnum source_type,
                            const std::string& source_name,
                            const std::string& manufacturer,
@@ -64,8 +65,8 @@
                            const std::string& hardware_version,
                            const std::string& software_version) {
   bluetooth::shim::LogMetricManufacturerInfo(
-      address, source_type, source_name, manufacturer, model, hardware_version,
-      software_version);
+      address, address_type, source_type, source_name, manufacturer, model,
+      hardware_version, software_version);
 }
 
 void log_counter_metrics(android::bluetooth::CodePathCounterKeyEnum key,
diff --git a/system/stack/sdp/sdp_utils.cc b/system/stack/sdp/sdp_utils.cc
index 44078ae..8e8f98f 100644
--- a/system/stack/sdp/sdp_utils.cc
+++ b/system/stack/sdp/sdp_utils.cc
@@ -273,8 +273,9 @@
       // [N - native]::SDP::[DIP - Device ID Profile]
       ss << "N:SDP::DIP::" << loghex(di_record.rec.vendor_id_source);
       log_manufacturer_info(
-          bda, android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL,
-          ss.str(), loghex(di_record.rec.vendor), loghex(di_record.rec.product),
+          bda, android::bluetooth::AddressTypeEnum::ADDRESS_TYPE_PUBLIC,
+          android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL, ss.str(),
+          loghex(di_record.rec.vendor), loghex(di_record.rec.product),
           loghex(di_record.rec.version), "");
 
       std::string bda_string = bda.ToString();
diff --git a/system/test/mock/mock_main_shim_metrics_api.cc b/system/test/mock/mock_main_shim_metrics_api.cc
index 25b3228..30aeeb1 100644
--- a/system/test/mock/mock_main_shim_metrics_api.cc
+++ b/system/test/mock/mock_main_shim_metrics_api.cc
@@ -165,13 +165,14 @@
 }
 void bluetooth::shim::LogMetricManufacturerInfo(
     const RawAddress& raw_address,
+    android::bluetooth::AddressTypeEnum address_type,
     android::bluetooth::DeviceInfoSrcEnum source_type,
     const std::string& source_name, const std::string& manufacturer,
     const std::string& model, const std::string& hardware_version,
     const std::string& software_version) {
   mock_function_count_map[__func__]++;
   test::mock::main_shim_metrics_api::LogMetricManufacturerInfo(
-      raw_address, source_type, source_name, manufacturer, model,
+      raw_address, address_type, source_type, source_name, manufacturer, model,
       hardware_version, software_version);
 }
 bool bluetooth::shim::CountCounterMetrics(int32_t key, int64_t count) {
diff --git a/system/test/mock/mock_main_shim_metrics_api.h b/system/test/mock/mock_main_shim_metrics_api.h
index 39f4e7f..b42529f 100644
--- a/system/test/mock/mock_main_shim_metrics_api.h
+++ b/system/test/mock/mock_main_shim_metrics_api.h
@@ -258,24 +258,27 @@
 // std::string& software_version Returns: void
 struct LogMetricManufacturerInfo {
   std::function<void(const RawAddress& raw_address,
+                     android::bluetooth::AddressTypeEnum address_type,
                      android::bluetooth::DeviceInfoSrcEnum source_type,
                      const std::string& source_name,
                      const std::string& manufacturer, const std::string& model,
                      const std::string& hardware_version,
                      const std::string& software_version)>
       body{[](const RawAddress& raw_address,
+              android::bluetooth::AddressTypeEnum address_type,
               android::bluetooth::DeviceInfoSrcEnum source_type,
               const std::string& source_name, const std::string& manufacturer,
               const std::string& model, const std::string& hardware_version,
               const std::string& software_version) {}};
   void operator()(const RawAddress& raw_address,
+                  android::bluetooth::AddressTypeEnum address_type,
                   android::bluetooth::DeviceInfoSrcEnum source_type,
                   const std::string& source_name,
                   const std::string& manufacturer, const std::string& model,
                   const std::string& hardware_version,
                   const std::string& software_version) {
-    body(raw_address, source_type, source_name, manufacturer, model,
-         hardware_version, software_version);
+    body(raw_address, address_type, source_type, source_name, manufacturer,
+         model, hardware_version, software_version);
   };
 };
 extern struct LogMetricManufacturerInfo LogMetricManufacturerInfo;
diff --git a/system/test/mock/mock_stack_btm_ble_privacy.cc b/system/test/mock/mock_stack_btm_ble_privacy.cc
index 49e29d2..e4d9c34 100644
--- a/system/test/mock/mock_stack_btm_ble_privacy.cc
+++ b/system/test/mock/mock_stack_btm_ble_privacy.cc
@@ -59,12 +59,8 @@
 struct btm_ble_remove_resolving_list_entry btm_ble_remove_resolving_list_entry;
 struct btm_ble_clear_resolving_list btm_ble_clear_resolving_list;
 struct btm_ble_read_resolving_list_entry btm_ble_read_resolving_list_entry;
-struct btm_ble_disable_resolving_list btm_ble_disable_resolving_list;
 struct btm_ble_resolving_list_load_dev btm_ble_resolving_list_load_dev;
 struct btm_ble_resolving_list_remove_dev btm_ble_resolving_list_remove_dev;
-struct btm_ble_enable_resolving_list btm_ble_enable_resolving_list;
-struct btm_ble_enable_resolving_list_for_platform
-    btm_ble_enable_resolving_list_for_platform;
 struct btm_ble_resolving_list_init btm_ble_resolving_list_init;
 
 }  // namespace stack_btm_ble_privacy
@@ -108,16 +104,6 @@
   return test::mock::stack_btm_ble_privacy::btm_ble_read_resolving_list_entry(
       p_dev_rec);
 }
-bool btm_ble_disable_resolving_list(uint8_t rl_mask, bool to_resume) {
-  mock_function_count_map[__func__]++;
-  return test::mock::stack_btm_ble_privacy::btm_ble_disable_resolving_list(
-      rl_mask, to_resume);
-}
-bool btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC* p_dev_rec) {
-  mock_function_count_map[__func__]++;
-  return test::mock::stack_btm_ble_privacy::btm_ble_resolving_list_load_dev(
-      p_dev_rec);
-}
 void btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC& p_dev_rec) {
   mock_function_count_map[__func__]++;
 }
@@ -126,15 +112,6 @@
   test::mock::stack_btm_ble_privacy::btm_ble_resolving_list_remove_dev(
       p_dev_rec);
 }
-void btm_ble_enable_resolving_list(uint8_t rl_mask) {
-  mock_function_count_map[__func__]++;
-  test::mock::stack_btm_ble_privacy::btm_ble_enable_resolving_list(rl_mask);
-}
-void btm_ble_enable_resolving_list_for_platform(uint8_t rl_mask) {
-  mock_function_count_map[__func__]++;
-  test::mock::stack_btm_ble_privacy::btm_ble_enable_resolving_list_for_platform(
-      rl_mask);
-}
 void btm_ble_resolving_list_init(uint8_t max_irk_list_sz) {
   mock_function_count_map[__func__]++;
   test::mock::stack_btm_ble_privacy::btm_ble_resolving_list_init(
diff --git a/system/test/mock/mock_stack_btm_ble_privacy.h b/system/test/mock/mock_stack_btm_ble_privacy.h
index 58ea637..35e82e5 100644
--- a/system/test/mock/mock_stack_btm_ble_privacy.h
+++ b/system/test/mock/mock_stack_btm_ble_privacy.h
@@ -116,24 +116,13 @@
 };
 extern struct btm_ble_read_resolving_list_entry
     btm_ble_read_resolving_list_entry;
-// Name: btm_ble_disable_resolving_list
-// Params: uint8_t rl_mask, bool to_resume
-// Returns: bool
-struct btm_ble_disable_resolving_list {
-  std::function<bool(uint8_t rl_mask, bool to_resume)> body{
-      [](uint8_t rl_mask, bool to_resume) { return false; }};
-  bool operator()(uint8_t rl_mask, bool to_resume) {
-    return body(rl_mask, to_resume);
-  };
-};
-extern struct btm_ble_disable_resolving_list btm_ble_disable_resolving_list;
 // Name: btm_ble_resolving_list_load_dev
 // Params: tBTM_SEC_DEV_REC* p_dev_rec
-// Returns: bool
+// Returns: void
 struct btm_ble_resolving_list_load_dev {
-  std::function<bool(tBTM_SEC_DEV_REC* p_dev_rec)> body{
-      [](tBTM_SEC_DEV_REC* p_dev_rec) { return false; }};
-  bool operator()(tBTM_SEC_DEV_REC* p_dev_rec) { return body(p_dev_rec); };
+  std::function<void(const tBTM_SEC_DEV_REC& p_dev_rec)> body{
+      [](const tBTM_SEC_DEV_REC& p_dev_rec) {}};
+  void operator()(const tBTM_SEC_DEV_REC& p_dev_rec) { body(p_dev_rec); };
 };
 extern struct btm_ble_resolving_list_load_dev btm_ble_resolving_list_load_dev;
 // Name: btm_ble_resolving_list_remove_dev
@@ -146,14 +135,6 @@
 };
 extern struct btm_ble_resolving_list_remove_dev
     btm_ble_resolving_list_remove_dev;
-// Name: btm_ble_enable_resolving_list
-// Params: uint8_t rl_mask
-// Returns: void
-struct btm_ble_enable_resolving_list {
-  std::function<void(uint8_t rl_mask)> body{[](uint8_t rl_mask) {}};
-  void operator()(uint8_t rl_mask) { body(rl_mask); };
-};
-extern struct btm_ble_enable_resolving_list btm_ble_enable_resolving_list;
 // Name: btm_ble_enable_resolving_list_for_platform
 // Params: uint8_t rl_mask
 // Returns: void
diff --git a/system/test/mock/mock_stack_hcic_hciblecmds.cc b/system/test/mock/mock_stack_hcic_hciblecmds.cc
index f0c43e7..0f8ee48 100644
--- a/system/test/mock/mock_stack_hcic_hciblecmds.cc
+++ b/system/test/mock/mock_stack_hcic_hciblecmds.cc
@@ -49,10 +49,7 @@
 struct btsnd_hcic_big_create_sync btsnd_hcic_big_create_sync;
 struct btsnd_hcic_big_term_sync btsnd_hcic_big_term_sync;
 struct btsnd_hcic_ble_add_acceptlist btsnd_hcic_ble_add_acceptlist;
-struct btsnd_hcic_ble_add_device_resolving_list
-    btsnd_hcic_ble_add_device_resolving_list;
 struct btsnd_hcic_ble_clear_acceptlist btsnd_hcic_ble_clear_acceptlist;
-struct btsnd_hcic_ble_clear_resolving_list btsnd_hcic_ble_clear_resolving_list;
 struct btsnd_hcic_ble_create_conn_cancel btsnd_hcic_ble_create_conn_cancel;
 struct btsnd_hcic_ble_create_ll_conn btsnd_hcic_ble_create_ll_conn;
 struct btsnd_hcic_ble_enh_rx_test btsnd_hcic_ble_enh_rx_test;
@@ -86,8 +83,6 @@
 struct btsnd_hcic_ble_receiver_test btsnd_hcic_ble_receiver_test;
 struct btsnd_hcic_ble_remove_from_acceptlist
     btsnd_hcic_ble_remove_from_acceptlist;
-struct btsnd_hcic_ble_rm_device_resolving_list
-    btsnd_hcic_ble_rm_device_resolving_list;
 struct btsnd_hcic_ble_set_addr_resolution_enable
     btsnd_hcic_ble_set_addr_resolution_enable;
 struct btsnd_hcic_ble_set_adv_data btsnd_hcic_ble_set_adv_data;
@@ -194,24 +189,12 @@
   test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_add_acceptlist(
       addr_type, bda, std::move(cb));
 }
-void btsnd_hcic_ble_add_device_resolving_list(uint8_t addr_type_peer,
-                                              const RawAddress& bda_peer,
-                                              const Octet16& irk_peer,
-                                              const Octet16& irk_local) {
-  mock_function_count_map[__func__]++;
-  test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_add_device_resolving_list(
-      addr_type_peer, bda_peer, irk_peer, irk_local);
-}
 void btsnd_hcic_ble_clear_acceptlist(
     base::OnceCallback<void(uint8_t*, uint16_t)> cb) {
   mock_function_count_map[__func__]++;
   test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_clear_acceptlist(
       std::move(cb));
 }
-void btsnd_hcic_ble_clear_resolving_list(void) {
-  mock_function_count_map[__func__]++;
-  test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_clear_resolving_list();
-}
 void btsnd_hcic_ble_create_conn_cancel(void) {
   mock_function_count_map[__func__]++;
   test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_create_conn_cancel();
@@ -359,12 +342,6 @@
   test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_remove_from_acceptlist(
       addr_type, bda, std::move(cb));
 }
-void btsnd_hcic_ble_rm_device_resolving_list(uint8_t addr_type_peer,
-                                             const RawAddress& bda_peer) {
-  mock_function_count_map[__func__]++;
-  test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_rm_device_resolving_list(
-      addr_type_peer, bda_peer);
-}
 void btsnd_hcic_ble_set_addr_resolution_enable(uint8_t addr_resolution_enable) {
   mock_function_count_map[__func__]++;
   test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_set_addr_resolution_enable(