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

Commit 35880ea7 authored by Santiago Seifert's avatar Santiago Seifert Committed by Android (Google) Code Review
Browse files

Merge "Use group icon in device chip for group routing sessions" into main

parents 9d277a3c 46691064
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -354,10 +354,21 @@ constructor(

                    activeDevice =
                        routingSession?.let {
                            val icon = if (it.selectedRoutes.size > 1) {
                                context.getDrawable(
                                        com.android.settingslib.R.drawable.ic_media_group_device)
                            } else {
                                connectedDevice?.icon // Single route. We don't change the icon.
                            }
                            // For a remote session, always use the current device from
                            // LocalMediaManager. Override with routing session name if available to
                            // show dynamic group name.
                            connectedDevice?.copy(name = it.name ?: connectedDevice.name)
                            // LocalMediaManager. Override with routing session information if
                            // available:
                            //   - Name: To show the dynamic group name.
                            //   - Icon: To show the group icon if there's more than one selected
                            //           route.
                            connectedDevice?.copy(
                                    name = it.name ?: connectedDevice.name,
                                    icon = icon)
                        } ?: MediaDeviceData(
                            enabled = false,
                            icon = context.getDrawable(R.drawable.ic_media_home_devices),