[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
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user