summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author SongFerng Wang <songferngwang@google.com> 2022-09-13 01:02:35 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-09-13 01:02:35 +0000
commit2de34a740c672fd7f6cbf97f2754d98230c88aac (patch)
treed80f39614aa358052ec45d42471e1837ff67be36
parent924207c4b966404767644d3238f37012c59bb945 (diff)
parent0928b5d16e45527386a46cd658c8bc9762985218 (diff)
Merge "Add more log for analysis" into tm-qpr-dev
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java1
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java6
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CsipDeviceManager.java3
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;
}
}