Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/spatialaudio/ui/composable/SpatialAudioPopup.kt +3 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.volume.panel.component.spatialaudio.ui.composable import android.view.Gravity import androidx.annotation.VisibleForTesting import androidx.compose.foundation.basicMarquee import androidx.compose.material3.LocalContentColor import androidx.compose.material3.MaterialTheme Loading Loading @@ -71,7 +72,8 @@ constructor( } @Composable private fun Content(dialog: SystemUIDialog) { @VisibleForTesting fun Content(dialog: SystemUIDialog) { val isAvailable by viewModel.isAvailable.collectAsStateWithLifecycle() if (!isAvailable) { Loading packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/ui/viewmodel/SpatialAudioViewModel.kt +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ constructor( .toViewModel( isChecked = isEnabled is SpatialAudioEnabledModel.SpatialAudioEnabled, isHeadTrackingAvailable = isAvailable is SpatialAudioAvailabilityModel.SpatialAudio, isAvailable is SpatialAudioAvailabilityModel.HeadTracking, ) .copy(label = context.getString(R.string.volume_panel_spatial_audio_title)) } Loading @@ -69,7 +69,7 @@ constructor( // head tracking availability means there are three possible states for the spatial // audio: disabled, enabled regular, enabled with head tracking. // Show popup in this case instead of a togglealbe button. it is SpatialAudioAvailabilityModel.SpatialAudio it is SpatialAudioAvailabilityModel.HeadTracking } .stateIn(scope, SharingStarted.Eagerly, false) Loading packages/SystemUI/tests/utils/src/com/android/systemui/animation/DialogTransitionAnimatorKosmos.kt +2 −2 Original line number Diff line number Diff line Loading @@ -16,16 +16,16 @@ package com.android.systemui.animation import android.content.applicationContext import com.android.systemui.jank.interactionJankMonitor import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture import com.android.systemui.kosmos.testCase val Kosmos.dialogTransitionAnimator by Fixture { fakeDialogTransitionAnimator( // The main thread is checked in a bunch of places inside the different transitions // animators, so we have to pass the real main executor here. mainExecutor = testCase.context.mainExecutor, mainExecutor = applicationContext.mainExecutor, interactionJankMonitor = interactionJankMonitor, ) } packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/popup/ui/composable/VolumePanelPopupKosmos.kt 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.volume.panel.component.popup.ui.composable import com.android.systemui.animation.dialogTransitionAnimator import com.android.systemui.kosmos.Kosmos import com.android.systemui.statusbar.phone.systemUIDialogFactory val Kosmos.volumePanelPopup: VolumePanelPopup by Kosmos.Fixture { VolumePanelPopup(systemUIDialogFactory, dialogTransitionAnimator) } Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/spatialaudio/ui/composable/SpatialAudioPopup.kt +3 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.volume.panel.component.spatialaudio.ui.composable import android.view.Gravity import androidx.annotation.VisibleForTesting import androidx.compose.foundation.basicMarquee import androidx.compose.material3.LocalContentColor import androidx.compose.material3.MaterialTheme Loading Loading @@ -71,7 +72,8 @@ constructor( } @Composable private fun Content(dialog: SystemUIDialog) { @VisibleForTesting fun Content(dialog: SystemUIDialog) { val isAvailable by viewModel.isAvailable.collectAsStateWithLifecycle() if (!isAvailable) { Loading
packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/ui/viewmodel/SpatialAudioViewModel.kt +2 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ constructor( .toViewModel( isChecked = isEnabled is SpatialAudioEnabledModel.SpatialAudioEnabled, isHeadTrackingAvailable = isAvailable is SpatialAudioAvailabilityModel.SpatialAudio, isAvailable is SpatialAudioAvailabilityModel.HeadTracking, ) .copy(label = context.getString(R.string.volume_panel_spatial_audio_title)) } Loading @@ -69,7 +69,7 @@ constructor( // head tracking availability means there are three possible states for the spatial // audio: disabled, enabled regular, enabled with head tracking. // Show popup in this case instead of a togglealbe button. it is SpatialAudioAvailabilityModel.SpatialAudio it is SpatialAudioAvailabilityModel.HeadTracking } .stateIn(scope, SharingStarted.Eagerly, false) Loading
packages/SystemUI/tests/utils/src/com/android/systemui/animation/DialogTransitionAnimatorKosmos.kt +2 −2 Original line number Diff line number Diff line Loading @@ -16,16 +16,16 @@ package com.android.systemui.animation import android.content.applicationContext import com.android.systemui.jank.interactionJankMonitor import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture import com.android.systemui.kosmos.testCase val Kosmos.dialogTransitionAnimator by Fixture { fakeDialogTransitionAnimator( // The main thread is checked in a bunch of places inside the different transitions // animators, so we have to pass the real main executor here. mainExecutor = testCase.context.mainExecutor, mainExecutor = applicationContext.mainExecutor, interactionJankMonitor = interactionJankMonitor, ) }
packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/popup/ui/composable/VolumePanelPopupKosmos.kt 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.volume.panel.component.popup.ui.composable import com.android.systemui.animation.dialogTransitionAnimator import com.android.systemui.kosmos.Kosmos import com.android.systemui.statusbar.phone.systemUIDialogFactory val Kosmos.volumePanelPopup: VolumePanelPopup by Kosmos.Fixture { VolumePanelPopup(systemUIDialogFactory, dialogTransitionAnimator) }