diff options
| author | 2024-05-07 10:15:21 +0000 | |
|---|---|---|
| committer | 2024-05-07 10:15:21 +0000 | |
| commit | ad25084d91836667df940d4c4764b362d16dc70c (patch) | |
| tree | 95a7b33ba814aade5a30173ea1ad4f4f289fe56d | |
| parent | 15eb2eef6fdfa4343259cd869b5f75fb81a3d399 (diff) | |
| parent | 66bd153ec4042c99ce0295f71c7e7cbf40cb47fc (diff) | |
Merge "Fix Media Output a11y click action" into main
3 files changed, 8 insertions, 5 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediaoutput/ui/composable/MediaOutputComponent.kt b/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediaoutput/ui/composable/MediaOutputComponent.kt index 6f2ed8178801..ded63a107e70 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediaoutput/ui/composable/MediaOutputComponent.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediaoutput/ui/composable/MediaOutputComponent.kt @@ -86,7 +86,10 @@ constructor( modifier = Modifier.fillMaxWidth().height(80.dp).semantics { liveRegion = LiveRegionMode.Polite - this.onClick(label = clickLabel) { false } + this.onClick(label = clickLabel) { + viewModel.onBarClick(null) + true + } }, color = MaterialTheme.colorScheme.surface, shape = RoundedCornerShape(28.dp), diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputActionsInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputActionsInteractor.kt index 22c053099ac5..199bc3b78dd2 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputActionsInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputActionsInteractor.kt @@ -33,15 +33,15 @@ constructor( private val mediaOutputDialogManager: MediaOutputDialogManager, ) { - fun onBarClick(sessionWithPlaybackState: SessionWithPlaybackState?, expandable: Expandable) { + fun onBarClick(sessionWithPlaybackState: SessionWithPlaybackState?, expandable: Expandable?) { if (sessionWithPlaybackState?.isPlaybackActive == true) { mediaOutputDialogManager.createAndShowWithController( sessionWithPlaybackState.session.packageName, false, - expandable.dialogController() + expandable?.dialogController() ) } else { - mediaOutputDialogManager.createAndShowForSystemRouting(expandable.dialogController()) + mediaOutputDialogManager.createAndShowForSystemRouting(expandable?.dialogController()) } } diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/ui/viewmodel/MediaOutputViewModel.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/ui/viewmodel/MediaOutputViewModel.kt index 192e0ec76132..be3a529d9a75 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/ui/viewmodel/MediaOutputViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/ui/viewmodel/MediaOutputViewModel.kt @@ -143,7 +143,7 @@ constructor( null, ) - fun onBarClick(expandable: Expandable) { + fun onBarClick(expandable: Expandable?) { uiEventLogger.log(VolumePanelUiEvent.VOLUME_PANEL_MEDIA_OUTPUT_CLICKED) val result = sessionWithPlaybackState.value actionsInteractor.onBarClick((result as? Result.Data)?.data, expandable) |