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

Commit 7f0c9599 authored by Michael Mikhail's avatar Michael Mikhail
Browse files

[a11y] Getting accessibility focus at pop up icon

When pop up icon is shown on the TTT receiver, the talkback says the name of the app playing.

Bug: 229561308
Test: Checked that Talkback says the icon name whenever we execute an adb command that pops up the icon.
Change-Id: I369999143488d5486c4e2c508ac182b870468765
parent d935aba9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(

        appIconView.contentDescription = appNameOverride ?: iconInfo.iconName
        appIconView.setImageDrawable(appIconDrawableOverride ?: iconInfo.icon)
        return appIconView.contentDescription.toString()
        return appIconView.contentDescription
    }

    /**
+4 −1
Original line number Diff line number Diff line
@@ -141,12 +141,13 @@ class MediaTttChipControllerReceiver @Inject constructor(

    override fun updateChipView(newChipInfo: ChipReceiverInfo, currentChipView: ViewGroup) {
        super.updateChipView(newChipInfo, currentChipView)
        setIcon(
        val iconName = setIcon(
                currentChipView,
                newChipInfo.routeInfo.clientPackageName,
                newChipInfo.appIconDrawableOverride,
                newChipInfo.appNameOverride
        )
        currentChipView.contentDescription = iconName
    }

    override fun animateChipIn(chipView: ViewGroup) {
@@ -159,6 +160,8 @@ class MediaTttChipControllerReceiver @Inject constructor(
                .alpha(1f)
                .setDuration(5.frames)
                .start()
        // Using withEndAction{} doesn't apply a11y focus when screen is unlocked.
        appIconView.postOnAnimation { chipView.requestAccessibilityFocus() }
        startRipple(chipView.requireViewById(R.id.ripple))
    }