Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66bd153e authored by Anton Potapov's avatar Anton Potapov
Browse files

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
parent 72c37464
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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),
+3 −3
Original line number Diff line number Diff line
@@ -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())
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -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)