Prevent automatic Talkback "Detected text" announcement.
That announcement was pronounced because the focusable element `id/device_container` had all its visible elements `id/title` and `id/title_icon` marked with `importantForAccessibility=no`, so the Talkback fell back to it's AI features to describe the element content. 1. Removed `importantForAccessibility="no"` by default from the title element. 2. Set `focusable="true"` for the device container and `focusable="false"` for title and subtitle to make screen reader announce the device container as one entity as per https://developer.android.com/guide/topics/ui/accessibility/principles#content-groups 3. When the seekbar is visible hide the rest of the content from the accessibility tree with `updateContainerContentA11yImportance` method. Flag: EXEMPT bugfix Bug: b/374862206 Fix: b/374862206 Test: atest SystemUiRoboTests:MediaOutputAdapterLegacyTest, accessibility with Talkback. Change-Id: Ifb3613af91ffb71e901e45903328b245e2a4b414
Loading
Please register or sign in to comment