diff options
author | Sumit Deshmukh <quic_sumitd@quicinc.com> | 2023-03-14 20:36:29 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2023-03-14 08:12:16 -0700 |
commit | d797e3b1bb58c2c48adb6816d96e575ebf4ff1c5 (patch) | |
tree | 0cdd616d9f8c8d9aacb1e6bcd0a00ee10d0fc8c7 | |
parent | 0fece8a14ed42c24ffe64b4ae21614a2f2dd7e37 (diff) |
Csip: Remove set completely for privacy enabled devices.
Sometimes device group is not removed from the list of
device groups if there are privacy enabled DUMO devices.
This change completely removes original device group
which was added in database during group discovery.
Change-Id: If832df9db3ce7853d9730986c9660ad0b8662214
-rw-r--r-- | src/com/android/bluetooth/csip/CsipSetCoordinatorService.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/com/android/bluetooth/csip/CsipSetCoordinatorService.java b/src/com/android/bluetooth/csip/CsipSetCoordinatorService.java index a77233eae..7c0f60a36 100644 --- a/src/com/android/bluetooth/csip/CsipSetCoordinatorService.java +++ b/src/com/android/bluetooth/csip/CsipSetCoordinatorService.java @@ -752,6 +752,11 @@ public class CsipSetCoordinatorService extends ProfileService { } catch (IndexOutOfBoundsException e) { Log.e(TAG, "Invalid Group- No device found : " + e); mCurrentSetDisc = null; + // Debug logs + for (DeviceGroup dGroup: mCoordinatedSets) { + Log.i(TAG, " Set ID: " + dGroup.getDeviceGroupId() + + " Members: " + dGroup.getDeviceGroupMembers()); + } return; } if (mIsOptScanStarted) { @@ -902,16 +907,23 @@ public class CsipSetCoordinatorService extends ProfileService { Log.i(TAG, "Last device unpaired. Removing Device Group from database"); mCoordinatedSets.remove(cSet); setSirkMap.remove(setId); + if (getCoordinatedSet(setId, false) == null) { + Log.i(TAG, "Set " + setId + " removed completely"); + } return; } } - cSet = getCoordinatedSet(setId, true); - if (cSet != null) { - cSet.getDeviceGroupMembers().remove(device); - if (cSet.getDeviceGroupMembers().size() == 0) { + DeviceGroup cSet1 = getCoordinatedSet(setId, true); + if (cSet1 != null) { + cSet1.getDeviceGroupMembers().remove(device); + if (cSet1.getDeviceGroupMembers().size() == 0) { Log.i(TAG, "Last device unpaired. Removing Device Group from database"); mCoordinatedSets.remove(cSet); + setSirkMap.remove(setId); + if (getCoordinatedSet(setId, false) == null) { + Log.i(TAG, "Set " + setId + " removed completely"); + } } } } |