Loading packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -1816,16 +1816,6 @@ flag { is_fixed_read_only: true } flag { name: "always_compose_qs_ui_fragment" namespace: "systemui" description: "Have QQS and QS scenes in the Compose fragment always composed, not just when it should be visible." bug: "389985793" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "move_transition_animation_layer" namespace: "systemui" Loading packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt +59 −85 Original line number Diff line number Diff line Loading @@ -282,14 +282,10 @@ constructor( private fun Content(modifier: Modifier = Modifier) { PlatformTheme(isDarkTheme = if (notificationShadeBlur()) isSystemInDarkTheme() else true) { ProvideShortcutHelperIndication(interactionsConfig = interactionsConfig()) { // TODO(b/389985793): Make sure that there is no coroutine work or recompositions // happening when alwaysCompose is true but isQsVisibleAndAnyShadeExpanded is false. if (alwaysCompose || viewModel.isQsVisibleAndAnyShadeExpanded) { Box( modifier = modifier .thenIf(alwaysCompose) { Modifier.layout { measurable, constraints -> .layout { measurable, constraints -> measurable.measure(constraints).run { layout(width, height) { if (viewModel.isQsVisibleAndAnyShadeExpanded) { Loading @@ -298,7 +294,6 @@ constructor( } } } } .graphicsLayer { alpha = viewModel.viewAlpha } .thenIf(!Flags.notificationShadeBlur()) { Modifier.offset { Loading @@ -319,7 +314,6 @@ constructor( } } } } /** * STL that contains both QQS (tiles) and QS (brightness, tiles, footer actions), but no Edit Loading Loading @@ -371,7 +365,6 @@ constructor( snapshotFlow { viewModel.expansionState }.map { it.progress }, ) } if (alwaysCompose) { // Normally, the Edit mode will stop if the composable leaves, but if the shade // is closed, because we are always composed, we don't stop edit mode. launch { Loading @@ -382,7 +375,6 @@ constructor( } } } } launch { snapshotFlow { viewModel.isQsFullyExpanded } .collect { Loading @@ -394,12 +386,12 @@ constructor( } SceneTransitionLayout(state = sceneState, modifier = Modifier.fillMaxSize()) { scene(QuickSettings, alwaysCompose = alwaysCompose) { scene(QuickSettings, alwaysCompose = true) { LaunchedEffect(Unit) { viewModel.onQSOpen() } Element(QuickSettings.rootElementKey, Modifier) { QuickSettingsElement() } } scene(QuickQuickSettings, alwaysCompose = alwaysCompose) { scene(QuickQuickSettings, alwaysCompose = true) { LaunchedEffect(Unit) { viewModel.onQQSOpen() } // Cannot pass the element modifier in because the top element has a `testTag` // and this would overwrite it. Loading Loading @@ -754,7 +746,6 @@ constructor( // listening whenever this is composed. When always compose is true, we // listen if we are visible and not fully expanded val isListening: () -> Boolean = if (alwaysCompose) { remember(viewModel) { derivedStateOf { viewModel.isQsVisibleAndAnyShadeExpanded && Loading @@ -763,9 +754,6 @@ constructor( } } .let { state -> { state.value } } } else { { true } } QuickQuickSettings( viewModel = viewModel.quickQuickSettingsViewModel, Loading Loading @@ -830,7 +818,6 @@ constructor( ) { if (viewModel.isQsEnabled) { Element(Elements.QuickSettingsContent, modifier = Modifier.weight(1f)) { if (alwaysCompose) { // scrollState never changes LaunchedEffect(Unit) { snapshotFlow { viewModel.isQsFullyCollapsed } Loading @@ -840,12 +827,7 @@ constructor( } } } } else { DisposableEffect(Unit) { lifecycleScope.launch { scrollState.scrollTo(0) } onDispose { lifecycleScope.launch { scrollState.scrollTo(0) } } } } Column( modifier = Modifier.fillMaxSize() Loading Loading @@ -919,7 +901,6 @@ constructor( // compose is true, we look a the second condition and we'll // listen if QS is visible AND we are not fully collapsed. val isListening: () -> Boolean = if (alwaysCompose) { remember(viewModel) { derivedStateOf { viewModel.isQsVisibleAndAnyShadeExpanded && Loading @@ -931,9 +912,6 @@ constructor( } } .let { state -> { state.value } } } else { { true } } TileGrid( viewModel = containerViewModel.tileGridViewModel, Loading Loading @@ -1061,7 +1039,6 @@ constructor( println("qqsPositionOnScreen", rect) } println("QQS visible", qqsVisible.value) println("Always composed", alwaysCompose) println("bottom QS padding", bottomContentPadding) if (::viewModel.isInitialized) { printSection("View Model") { viewModel.dump(this@run, args) } Loading Loading @@ -1561,9 +1538,6 @@ private fun interactionsConfig() = surfaceCornerRadius = 16.dp, ) private inline val alwaysCompose get() = Flags.alwaysComposeQsUiFragment() /** * Forces the configuration and themes to be dark theme. This is needed in order to have * [colorResource] retrieve the dark mode colors. Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -1816,16 +1816,6 @@ flag { is_fixed_read_only: true } flag { name: "always_compose_qs_ui_fragment" namespace: "systemui" description: "Have QQS and QS scenes in the Compose fragment always composed, not just when it should be visible." bug: "389985793" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "move_transition_animation_layer" namespace: "systemui" Loading
packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt +59 −85 Original line number Diff line number Diff line Loading @@ -282,14 +282,10 @@ constructor( private fun Content(modifier: Modifier = Modifier) { PlatformTheme(isDarkTheme = if (notificationShadeBlur()) isSystemInDarkTheme() else true) { ProvideShortcutHelperIndication(interactionsConfig = interactionsConfig()) { // TODO(b/389985793): Make sure that there is no coroutine work or recompositions // happening when alwaysCompose is true but isQsVisibleAndAnyShadeExpanded is false. if (alwaysCompose || viewModel.isQsVisibleAndAnyShadeExpanded) { Box( modifier = modifier .thenIf(alwaysCompose) { Modifier.layout { measurable, constraints -> .layout { measurable, constraints -> measurable.measure(constraints).run { layout(width, height) { if (viewModel.isQsVisibleAndAnyShadeExpanded) { Loading @@ -298,7 +294,6 @@ constructor( } } } } .graphicsLayer { alpha = viewModel.viewAlpha } .thenIf(!Flags.notificationShadeBlur()) { Modifier.offset { Loading @@ -319,7 +314,6 @@ constructor( } } } } /** * STL that contains both QQS (tiles) and QS (brightness, tiles, footer actions), but no Edit Loading Loading @@ -371,7 +365,6 @@ constructor( snapshotFlow { viewModel.expansionState }.map { it.progress }, ) } if (alwaysCompose) { // Normally, the Edit mode will stop if the composable leaves, but if the shade // is closed, because we are always composed, we don't stop edit mode. launch { Loading @@ -382,7 +375,6 @@ constructor( } } } } launch { snapshotFlow { viewModel.isQsFullyExpanded } .collect { Loading @@ -394,12 +386,12 @@ constructor( } SceneTransitionLayout(state = sceneState, modifier = Modifier.fillMaxSize()) { scene(QuickSettings, alwaysCompose = alwaysCompose) { scene(QuickSettings, alwaysCompose = true) { LaunchedEffect(Unit) { viewModel.onQSOpen() } Element(QuickSettings.rootElementKey, Modifier) { QuickSettingsElement() } } scene(QuickQuickSettings, alwaysCompose = alwaysCompose) { scene(QuickQuickSettings, alwaysCompose = true) { LaunchedEffect(Unit) { viewModel.onQQSOpen() } // Cannot pass the element modifier in because the top element has a `testTag` // and this would overwrite it. Loading Loading @@ -754,7 +746,6 @@ constructor( // listening whenever this is composed. When always compose is true, we // listen if we are visible and not fully expanded val isListening: () -> Boolean = if (alwaysCompose) { remember(viewModel) { derivedStateOf { viewModel.isQsVisibleAndAnyShadeExpanded && Loading @@ -763,9 +754,6 @@ constructor( } } .let { state -> { state.value } } } else { { true } } QuickQuickSettings( viewModel = viewModel.quickQuickSettingsViewModel, Loading Loading @@ -830,7 +818,6 @@ constructor( ) { if (viewModel.isQsEnabled) { Element(Elements.QuickSettingsContent, modifier = Modifier.weight(1f)) { if (alwaysCompose) { // scrollState never changes LaunchedEffect(Unit) { snapshotFlow { viewModel.isQsFullyCollapsed } Loading @@ -840,12 +827,7 @@ constructor( } } } } else { DisposableEffect(Unit) { lifecycleScope.launch { scrollState.scrollTo(0) } onDispose { lifecycleScope.launch { scrollState.scrollTo(0) } } } } Column( modifier = Modifier.fillMaxSize() Loading Loading @@ -919,7 +901,6 @@ constructor( // compose is true, we look a the second condition and we'll // listen if QS is visible AND we are not fully collapsed. val isListening: () -> Boolean = if (alwaysCompose) { remember(viewModel) { derivedStateOf { viewModel.isQsVisibleAndAnyShadeExpanded && Loading @@ -931,9 +912,6 @@ constructor( } } .let { state -> { state.value } } } else { { true } } TileGrid( viewModel = containerViewModel.tileGridViewModel, Loading Loading @@ -1061,7 +1039,6 @@ constructor( println("qqsPositionOnScreen", rect) } println("QQS visible", qqsVisible.value) println("Always composed", alwaysCompose) println("bottom QS padding", bottomContentPadding) if (::viewModel.isInitialized) { printSection("View Model") { viewModel.dump(this@run, args) } Loading Loading @@ -1561,9 +1538,6 @@ private fun interactionsConfig() = surfaceCornerRadius = 16.dp, ) private inline val alwaysCompose get() = Flags.alwaysComposeQsUiFragment() /** * Forces the configuration and themes to be dark theme. This is needed in order to have * [colorResource] retrieve the dark mode colors. Loading