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

Commit 06ef2a7a authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

LeAudioService: Add groupId to the LeAudioGroupDescriptor

This is just for the loging purposes.

Bug: 369599302
Test: atest LeAudioServiceTest
Flag: Exempt, no functional change
Change-Id: I127cc89a0295b4c4054b0c9c646cf5edd28fafec
parent defb2b18
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -237,7 +237,8 @@ public class LeAudioService extends ProfileService {
    }

    private static class LeAudioGroupDescriptor {
        LeAudioGroupDescriptor(boolean isInbandRingtonEnabled) {
        LeAudioGroupDescriptor(int groupId, boolean isInbandRingtonEnabled) {
            mGroupId = groupId;
            mIsConnected = false;
            mActiveState = ACTIVE_STATE_INACTIVE;
            mAllowedSinkContexts = BluetoothLeAudio.CONTEXTS_ALL;
@@ -254,6 +255,7 @@ public class LeAudioService extends ProfileService {
            mInactivatedDueToContextType = false;
        }

        Integer mGroupId;
        Boolean mIsConnected;
        Boolean mHasFallbackDeviceWhenGettingInactive;
        Integer mDirection;
@@ -287,11 +289,17 @@ public class LeAudioService extends ProfileService {
            if ((state != ACTIVE_STATE_ACTIVE)
                    && (state != ACTIVE_STATE_INACTIVE)
                    && (state != ACTIVE_STATE_GETTING_ACTIVE)) {
                Log.e(TAG, "LeAudioGroupDescriptor.setActiveState: Invalid state set: " + state);
                Log.e(
                        TAG,
                        ("LeAudioGroupDescriptor.setActiveState (groupId: " + mGroupId + "):")
                                + ("Invalid state set: " + state));
                return;
            }

            Log.d(TAG, "LeAudioGroupDescriptor.setActiveState: " + mActiveState + " -> " + state);
            Log.d(
                    TAG,
                    ("LeAudioGroupDescriptor.setActiveState (groupId: " + mGroupId + "): ")
                            + (mActiveState + " -> " + state));
            mActiveState = state;
        }

@@ -311,7 +319,9 @@ public class LeAudioService extends ProfileService {
        void updateAllowedContexts(Integer allowedSinkContexts, Integer allowedSourceContexts) {
            Log.d(
                    TAG,
                    "LeAudioGroupDescriptor.mAllowedSinkContexts: "
                    "LeAudioGroupDescriptor.mAllowedSinkContexts (groupId: "
                            + mGroupId
                            + "): "
                            + mAllowedSinkContexts
                            + " -> "
                            + allowedSinkContexts
@@ -4733,7 +4743,7 @@ public class LeAudioService extends ProfileService {

            LeAudioGroupDescriptor groupDescriptor = getGroupDescriptor(groupId);
            if (groupDescriptor == null) {
                mGroupDescriptors.put(groupId, new LeAudioGroupDescriptor(false));
                mGroupDescriptors.put(groupId, new LeAudioGroupDescriptor(groupId, false));
            }
            groupDescriptor = getGroupDescriptor(groupId);
            if (groupDescriptor == null) {