From fb0c7ad00c97ea9d64009abf6ade8fe3c99d6623 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 --- .../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 0095692336e72..833c4ac07633d 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -241,9 +241,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