summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Anton Potapov <apotapov@google.com> 2024-05-03 13:39:40 +0100
committer Anton Potapov <apotapov@google.com> 2024-05-03 13:39:40 +0100
commit66bd153ec4042c99ce0295f71c7e7cbf40cb47fc (patch)
tree2664b31937f08e60e12f402156a7e3c1223f7965
parent72c374646769904ffa08869e7b27c73ca4faed4e (diff)
Fix Media Output a11y click action
Flag: aconfig new_volume_panel NEXTFOOD Test: manual on the phone with voice controls and switch access turned on Fixes: 338522472 Fixes: 338523734 Change-Id: I25958087b54d448d379b21184dbd5f00729f4780
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediaoutput/ui/composable/MediaOutputComponent.kt5
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputActionsInteractor.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/ui/viewmodel/MediaOutputViewModel.kt2
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)