From 54b644e46e45cb524e3ae9bd5f32298e6e6a0bd8 Mon Sep 17 00:00:00 2001 From: hughchen Date: Mon, 25 Nov 2019 14:48:46 +0800 Subject: [PATCH] Use new api to disconnect all bt profiles Fixes: 141582844 Test: make -j42 RunSettingsLibRoboTests Change-Id: I432c12b60016d2230df625155d3c76dbba926077 Merged-In: I432c12b60016d2230df625155d3c76dbba926077 --- .../android/settingslib/bluetooth/CachedBluetoothDevice.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 9a16825fe1f3b..a12832d3aa348 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -163,9 +163,7 @@ public class CachedBluetoothDevice implements Comparable public void disconnect() { synchronized (mProfileLock) { - for (LocalBluetoothProfile profile : mProfiles) { - disconnect(profile); - } + mLocalAdapter.disconnectAllEnabledProfiles(mDevice); } // Disconnect PBAP server in case its connected // This is to ensure all the profiles are disconnected as some CK/Hs do not