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

Commit b9c64aaf authored by Grzegorz Kolodziejczyk's avatar Grzegorz Kolodziejczyk Committed by Gerrit Code Review
Browse files

Merge "Protect group from changing its integrity"

parents 52b501db 33b43ec2
Loading
Loading
Loading
Loading
+22 −19
Original line number Diff line number Diff line
@@ -1512,6 +1512,7 @@ public class LeAudioService extends ProfileService {
            int src_audio_location = stackEvent.valueInt4;
            int available_contexts = stackEvent.valueInt5;

            synchronized (mGroupLock) {
                LeAudioGroupDescriptor descriptor = getGroupDescriptor(groupId);
                if (descriptor != null) {
                    if (descriptor.mIsActive) {
@@ -1519,13 +1520,15 @@ public class LeAudioService extends ProfileService {
                                updateActiveDevices(groupId, descriptor.mDirection, direction,
                                descriptor.mIsActive);
                        if (!descriptor.mIsActive) {
                        notifyGroupStatusChanged(groupId, BluetoothLeAudio.GROUP_STATUS_INACTIVE);
                            notifyGroupStatusChanged(groupId,
                                    BluetoothLeAudio.GROUP_STATUS_INACTIVE);
                        }
                    }
                    descriptor.mDirection = direction;
                } else {
                    Log.e(TAG, "no descriptors for group: " + groupId);
                }
            }
        } else if (stackEvent.type == LeAudioStackEvent.EVENT_TYPE_SINK_AUDIO_LOCATION_AVAILABLE) {
            Objects.requireNonNull(stackEvent.device,
                    "Device should never be null, event: " + stackEvent);
@@ -2226,6 +2229,7 @@ public class LeAudioService extends ProfileService {
            Log.d(TAG, "Removing device " + device + " grom group " + groupId);
        }

        synchronized (mGroupLock) {
            LeAudioGroupDescriptor groupDescriptor = getGroupDescriptor(groupId);
            if (DBG) {
                Log.d(TAG, "Lost lead device is " + groupDescriptor.mLostLeadDeviceWhileStreaming);
@@ -2234,7 +2238,6 @@ public class LeAudioService extends ProfileService {
                clearLostDevicesWhileStreaming(groupDescriptor);
            }

        synchronized (mGroupLock) {
            LeAudioDeviceDescriptor deviceDescriptor = getDeviceDescriptor(device);
            if (deviceDescriptor == null) {
                Log.e(TAG, "handleGroupNodeRemoved: No valid descriptor for device: " + device);