summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beth Thibodeau <ethibodeau@google.com> 2024-08-12 11:59:57 -0500
committer Beth Thibodeau <ethibodeau@google.com> 2024-08-12 12:08:15 -0500
commit1e01da69e49716cb283598a0fd3d6f83d99b4522 (patch)
treef94bfcd241e7303512727815f249845e0b417c9d
parentebf8e0c827222dba658e971fdc9462f90c6d51ea (diff)
[flexiglass] Use actual media host locations
- Remove initial size setup in MediaCarousel (width would always be 0 there) - Do update location in MediaHierarchyManager so we calculate a new size when moving to a different host - Remove minimum size workaround as it is no longer needed Fixes: 340215986 Flag: com.android.systemui.scene_container Test: manual - play media from multiple apps, verify carousel and controls work as expected Change-Id: Ic846d4b2bb7c09fa465ce76a2a1aecf9f49eac98
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaCarousel.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaHierarchyManager.kt1
3 files changed, 0 insertions, 12 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaCarousel.kt b/packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaCarousel.kt
index 26ab10b459d8..82febe6d9da6 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaCarousel.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaCarousel.kt
@@ -25,7 +25,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.layout
-import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.viewinterop.AndroidView
import com.android.compose.animation.scene.MovableElementKey
@@ -56,16 +55,8 @@ fun SceneScope.MediaCarousel(
return
}
- val density = LocalDensity.current
val mediaHeight = dimensionResource(R.dimen.qs_media_session_height_expanded)
- val layoutWidth = 0
- val layoutHeight = with(density) { mediaHeight.toPx() }.toInt()
-
- // Notify controller to size the carousel for the current space
- mediaHost.measurementInput = MeasurementInput(layoutWidth, layoutHeight)
- carouselController.setSceneContainerSize(layoutWidth, layoutHeight)
-
MovableElement(
key = MediaCarousel.Elements.Content,
modifier = modifier.height(mediaHeight).fillMaxWidth()
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt
index c5d7b25827ea..46c5c188344e 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt
@@ -888,8 +888,6 @@ constructor(
heightInSceneContainerPx = height
mediaCarouselScrollHandler.playerWidthPlusPadding =
width + context.resources.getDimensionPixelSize(R.dimen.qs_media_padding)
- mediaContent.minimumWidth = widthInSceneContainerPx
- mediaContent.minimumHeight = heightInSceneContainerPx
updatePlayers(recreateMedia = true)
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaHierarchyManager.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaHierarchyManager.kt
index 88a28bf998da..091b886c7ba4 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaHierarchyManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaHierarchyManager.kt
@@ -1210,7 +1210,6 @@ constructor(
(onCommunalNotDreaming && qsExpansion == 0.0f) || onCommunalDreamingAndShadeExpanding
val location =
when {
- mediaFlags.isSceneContainerEnabled() -> desiredLocation
dreamOverlayActive && dreamMediaComplicationActive -> LOCATION_DREAM_OVERLAY
onCommunal -> LOCATION_COMMUNAL_HUB
(qsExpansion > 0.0f || inSplitShade) && !onLockscreen -> LOCATION_QS