diff options
3 files changed, 9 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 3ca94dba027e..a5f3df9f628d 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -398,6 +398,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> * @param id the group id from the CSIP. */ public void setGroupId(int id) { + Log.d(TAG, this.getDevice().getAnonymizedAddress() + " set GroupId " + id); mGroupId = id; } diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java index 26a208026411..5662ce6bd808 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java @@ -357,8 +357,12 @@ public class CachedBluetoothDeviceManager { * {@code false}. */ public synchronized boolean shouldPairByCsip(BluetoothDevice device, int groupId) { - if (mOngoingSetMemberPair != null || device.getBondState() != BluetoothDevice.BOND_NONE + boolean isOngoingSetMemberPair = mOngoingSetMemberPair != null; + int bondState = device.getBondState(); + if (isOngoingSetMemberPair || bondState != BluetoothDevice.BOND_NONE || !mCsipDeviceManager.isExistedGroupId(groupId)) { + Log.d(TAG, "isOngoingSetMemberPair: " + isOngoingSetMemberPair + + " , device.getBondState: " + bondState); return false; } diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CsipDeviceManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CsipDeviceManager.java index 9b38238ca8b8..d5de3f0525a0 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CsipDeviceManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CsipDeviceManager.java @@ -102,9 +102,12 @@ public class CsipDeviceManager { } private CachedBluetoothDevice getCachedDevice(int groupId) { + log("getCachedDevice: groupId: " + groupId); for (int i = mCachedDevices.size() - 1; i >= 0; i--) { CachedBluetoothDevice cachedDevice = mCachedDevices.get(i); if (cachedDevice.getGroupId() == groupId) { + log("getCachedDevice: found cachedDevice with the groupId: " + + cachedDevice.getDevice().getAnonymizedAddress()); return cachedDevice; } } |