Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediainput/MediaInputModule.kt 0 → 100644 +44 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 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.mediainput import com.android.systemui.volume.panel.component.mediainput.domain.MediaInputAvailabilityCriteria import com.android.systemui.volume.panel.component.mediainput.ui.composable.MediaInputComponent import com.android.systemui.volume.panel.component.shared.model.VolumePanelComponents import com.android.systemui.volume.panel.domain.ComponentAvailabilityCriteria import com.android.systemui.volume.panel.shared.model.VolumePanelUiComponent import dagger.Binds import dagger.Module import dagger.multibindings.IntoMap import dagger.multibindings.StringKey /** Dagger module, that provides media input Volume Panel UI functionality. */ @Module interface MediaInputModule { @Binds @IntoMap @StringKey(VolumePanelComponents.MEDIA_INPUT) fun bindVolumePanelUiComponent(component: MediaInputComponent): VolumePanelUiComponent @Binds @IntoMap @StringKey(VolumePanelComponents.MEDIA_INPUT) fun bindComponentAvailabilityCriteria( criteria: MediaInputAvailabilityCriteria ): ComponentAvailabilityCriteria } packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediainput/ui/composable/MediaInputComponent.kt 0 → 100644 +37 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 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.mediainput.ui.composable import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.android.systemui.volume.panel.component.mediainput.ui.viewmodel.MediaInputViewModel import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope import com.android.systemui.volume.panel.ui.composable.ComposeVolumePanelUiComponent import com.android.systemui.volume.panel.ui.composable.VolumePanelComposeScope import javax.inject.Inject @VolumePanelScope class MediaInputComponent @Inject constructor(private val viewModel: MediaInputViewModel) : ComposeVolumePanelUiComponent { @Composable override fun VolumePanelComposeScope.Content(modifier: Modifier) { // TODO(b/378513663): Implement the content of media input component Text(text = "Media Input") } } packages/SystemUI/src/com/android/systemui/volume/dialog/domain/interactor/DesktopAudioTileDetailsFeatureInteractor.kt +7 −4 Original line number Original line Diff line number Diff line Loading @@ -17,18 +17,21 @@ package com.android.systemui.volume.dialog.domain.interactor package com.android.systemui.volume.dialog.domain.interactor import android.content.Context import android.content.Context import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.qs.flags.QsDetailedView import com.android.systemui.qs.flags.QsDetailedView import com.android.systemui.res.R import com.android.systemui.res.R import com.android.systemui.volume.dialog.dagger.scope.VolumeDialogPluginScope import javax.inject.Inject import javax.inject.Inject @VolumeDialogPluginScope @SysUISingleton class DesktopAudioTileDetailsFeatureInteractor class DesktopAudioTileDetailsFeatureInteractor @Inject @Inject constructor(@Application private val context: Context) { constructor(@Application private val context: Context) { fun isEnabled(): Boolean { private val isEnabled = return QsDetailedView.isEnabled && QsDetailedView.isEnabled && context.resources.getBoolean(R.bool.config_enableDesktopAudioTileDetailsView) context.resources.getBoolean(R.bool.config_enableDesktopAudioTileDetailsView) fun isEnabled(): Boolean { return isEnabled } } } } packages/SystemUI/src/com/android/systemui/volume/panel/component/mediainput/domain/MediaInputAvailabilityCriteria.kt 0 → 100644 +35 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 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.mediainput.domain import com.android.systemui.volume.dialog.domain.interactor.DesktopAudioTileDetailsFeatureInteractor import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope import com.android.systemui.volume.panel.domain.ComponentAvailabilityCriteria import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flowOf @VolumePanelScope class MediaInputAvailabilityCriteria @Inject constructor( private val desktopAudioTileDetailsFeatureInteractor: DesktopAudioTileDetailsFeatureInteractor ) : ComponentAvailabilityCriteria { override fun isAvailable(): Flow<Boolean> = flowOf(desktopAudioTileDetailsFeatureInteractor.isEnabled()) } packages/SystemUI/src/com/android/systemui/volume/panel/component/mediainput/ui/viewmodel/MediaInputViewModel.kt 0 → 100644 +25 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 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.mediainput.ui.viewmodel import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope import javax.inject.Inject @VolumePanelScope class MediaInputViewModel @Inject constructor() { // TODO(b/378513663): Implement the content of media input view model } Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediainput/MediaInputModule.kt 0 → 100644 +44 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 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.mediainput import com.android.systemui.volume.panel.component.mediainput.domain.MediaInputAvailabilityCriteria import com.android.systemui.volume.panel.component.mediainput.ui.composable.MediaInputComponent import com.android.systemui.volume.panel.component.shared.model.VolumePanelComponents import com.android.systemui.volume.panel.domain.ComponentAvailabilityCriteria import com.android.systemui.volume.panel.shared.model.VolumePanelUiComponent import dagger.Binds import dagger.Module import dagger.multibindings.IntoMap import dagger.multibindings.StringKey /** Dagger module, that provides media input Volume Panel UI functionality. */ @Module interface MediaInputModule { @Binds @IntoMap @StringKey(VolumePanelComponents.MEDIA_INPUT) fun bindVolumePanelUiComponent(component: MediaInputComponent): VolumePanelUiComponent @Binds @IntoMap @StringKey(VolumePanelComponents.MEDIA_INPUT) fun bindComponentAvailabilityCriteria( criteria: MediaInputAvailabilityCriteria ): ComponentAvailabilityCriteria }
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediainput/ui/composable/MediaInputComponent.kt 0 → 100644 +37 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 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.mediainput.ui.composable import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.android.systemui.volume.panel.component.mediainput.ui.viewmodel.MediaInputViewModel import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope import com.android.systemui.volume.panel.ui.composable.ComposeVolumePanelUiComponent import com.android.systemui.volume.panel.ui.composable.VolumePanelComposeScope import javax.inject.Inject @VolumePanelScope class MediaInputComponent @Inject constructor(private val viewModel: MediaInputViewModel) : ComposeVolumePanelUiComponent { @Composable override fun VolumePanelComposeScope.Content(modifier: Modifier) { // TODO(b/378513663): Implement the content of media input component Text(text = "Media Input") } }
packages/SystemUI/src/com/android/systemui/volume/dialog/domain/interactor/DesktopAudioTileDetailsFeatureInteractor.kt +7 −4 Original line number Original line Diff line number Diff line Loading @@ -17,18 +17,21 @@ package com.android.systemui.volume.dialog.domain.interactor package com.android.systemui.volume.dialog.domain.interactor import android.content.Context import android.content.Context import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.qs.flags.QsDetailedView import com.android.systemui.qs.flags.QsDetailedView import com.android.systemui.res.R import com.android.systemui.res.R import com.android.systemui.volume.dialog.dagger.scope.VolumeDialogPluginScope import javax.inject.Inject import javax.inject.Inject @VolumeDialogPluginScope @SysUISingleton class DesktopAudioTileDetailsFeatureInteractor class DesktopAudioTileDetailsFeatureInteractor @Inject @Inject constructor(@Application private val context: Context) { constructor(@Application private val context: Context) { fun isEnabled(): Boolean { private val isEnabled = return QsDetailedView.isEnabled && QsDetailedView.isEnabled && context.resources.getBoolean(R.bool.config_enableDesktopAudioTileDetailsView) context.resources.getBoolean(R.bool.config_enableDesktopAudioTileDetailsView) fun isEnabled(): Boolean { return isEnabled } } } }
packages/SystemUI/src/com/android/systemui/volume/panel/component/mediainput/domain/MediaInputAvailabilityCriteria.kt 0 → 100644 +35 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 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.mediainput.domain import com.android.systemui.volume.dialog.domain.interactor.DesktopAudioTileDetailsFeatureInteractor import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope import com.android.systemui.volume.panel.domain.ComponentAvailabilityCriteria import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flowOf @VolumePanelScope class MediaInputAvailabilityCriteria @Inject constructor( private val desktopAudioTileDetailsFeatureInteractor: DesktopAudioTileDetailsFeatureInteractor ) : ComponentAvailabilityCriteria { override fun isAvailable(): Flow<Boolean> = flowOf(desktopAudioTileDetailsFeatureInteractor.isEnabled()) }
packages/SystemUI/src/com/android/systemui/volume/panel/component/mediainput/ui/viewmodel/MediaInputViewModel.kt 0 → 100644 +25 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2025 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.mediainput.ui.viewmodel import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope import javax.inject.Inject @VolumePanelScope class MediaInputViewModel @Inject constructor() { // TODO(b/378513663): Implement the content of media input view model }