Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a07ac9e0 authored by Yiyi Shen's avatar Yiyi Shen Committed by Android (Google) Code Review
Browse files

Merge "Add some debugging logs for CSIP logic" into main

parents c7e97206 ced95503
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -134,6 +134,8 @@ public class CsipDeviceManager {
            // Do nothing if GroupId has been assigned
            if (!isValidGroupId(cachedDevice.getGroupId())) {
                final int newGroupId = getBaseGroupId(cachedDevice.getDevice());
                log("updateCsipDevices: propose new group id " + newGroupId + " for device "
                        + cachedDevice.getDevice());
                // Do nothing if there is no GroupId on Bluetooth device
                if (isValidGroupId(newGroupId)) {
                    cachedDevice.setGroupId(newGroupId);
+15 −1
Original line number Diff line number Diff line
@@ -358,6 +358,9 @@ public class LocalBluetoothProfileManager {
                    && mProfile instanceof CsipSetCoordinatorProfile;

            if (isAshaProfile && (newState == BluetoothProfile.STATE_CONNECTED)) {
                if (DEBUG) {
                    Log.d(TAG, "onReceive, hearing aid profile connected, check hisyncid");
                }
                // Check if the HiSyncID has being initialized
                if (cachedDevice.getHiSyncId() == BluetoothHearingAid.HI_SYNC_ID_INVALID) {
                    long newHiSyncId = getHearingAidProfile().getHiSyncId(cachedDevice.getDevice());
@@ -375,7 +378,9 @@ public class LocalBluetoothProfileManager {
            }

            if (isHapClientOrLeAudioProfile && newState == BluetoothProfile.STATE_CONNECTED) {

                if (DEBUG) {
                    Log.d(TAG, "onReceive, hap/lea profile connected, check hearing aid info");
                }
                // Checks if both profiles are connected to the device. Hearing aid info need
                // to be retrieved from these profiles separately.
                if (cachedDevice.isConnectedLeAudioHearingAidDevice()) {
@@ -389,10 +394,16 @@ public class LocalBluetoothProfileManager {
            }

            if (isCsipProfile && (newState == BluetoothProfile.STATE_CONNECTED)) {
                if (DEBUG) {
                    Log.d(TAG, "onReceive, csip profile connected, check group id");
                }
                // Check if the GroupID has being initialized
                if (cachedDevice.getGroupId() == BluetoothCsipSetCoordinator.GROUP_ID_INVALID) {
                    final Map<Integer, ParcelUuid> groupIdMap = getCsipSetCoordinatorProfile()
                            .getGroupUuidMapByDevice(cachedDevice.getDevice());
                    if (DEBUG) {
                        Log.d(TAG, "csip group uuid map = " + groupIdMap);
                    }
                    if (groupIdMap != null) {
                        for (Map.Entry<Integer, ParcelUuid> entry: groupIdMap.entrySet()) {
                            if (entry.getValue().equals(BluetoothUuid.CAP)) {
@@ -431,6 +442,9 @@ public class LocalBluetoothProfileManager {
                        mProfile.getProfileId());
            }
            if (needDispatchProfileConnectionState) {
                if (DEBUG) {
                    Log.d(TAG, "needDispatchProfileConnectionState");
                }
                cachedDevice.refresh();
                mEventManager.dispatchProfileConnectionStateChanged(cachedDevice, newState,
                        mProfile.getProfileId());