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

Commit a3c7dccb authored by Chelsea Hao's avatar Chelsea Hao Committed by Android (Google) Code Review
Browse files

Merge "Handle cases where one buds has a streaming source and the other one...

Merge "Handle cases where one buds has a streaming source and the other one has a paused source." into main
parents 1d30e5ef 9bcecce4
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -473,9 +473,8 @@ public class AudioStreamMediaService extends Service {
                        .setSmallIcon(com.android.settingslib.R.drawable.ic_bt_le_audio_sharing)
                        .setStyle(mediaStyle)
                        .setContentText(getString(
                                (isAnyDeviceReceiverPaused() || isAllDeviceHysteresis())
                                        ? BROADCAST_STREAM_PAUSED_TEXT
                                        : BROADCAST_LISTENING_NOW_TEXT))
                                isAnyDeviceStreaming() ? BROADCAST_LISTENING_NOW_TEXT
                                        : BROADCAST_STREAM_PAUSED_TEXT))
                        .setSilent(true);
        return notificationBuilder.build();
    }
+6 −4
Original line number Diff line number Diff line
@@ -616,16 +616,18 @@ public class AudioStreamsProgressCategoryController extends BasePreferenceContro
                    handleSourceFromQrCodeIfExists();
                    Map<BluetoothDevice, List<BluetoothLeBroadcastReceiveState>> sources =
                            mAudioStreamsHelper.getAllSourcesByDevice();
                    getStreamSourcesByDevice(sources).forEach(
                            (device, stateList) ->
                                    stateList.forEach(
                                            state -> handleSourceStreaming(device, state)));
                    if (mHysteresisModeFixAvailable) {
                        getPausedSourcesByDevice(sources).forEach(
                                (device, stateList) ->
                                        stateList.forEach(
                                                state -> handleSourcePaused(device, state)));
                    }
                    // If a source is streaming in one device and paused in another, we handle the
                    // source as it's streaming
                    getStreamSourcesByDevice(sources).forEach(
                            (device, stateList) ->
                                    stateList.forEach(
                                            state -> handleSourceStreaming(device, state)));
                    if (DEBUG) {
                        Log.d(TAG, "startScanning()");
                    }