Merge "Put all text content in the node's text" into udc-dev am: 5d0e1903b6 am: 1a999d5ad6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22861777

Change-Id: I37bd0e1c44554aa96aac7913766013db1f9049b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Fabian Kozynski
2023-04-27 16:01:39 +00:00
committed by Automerger Merge Worker

View File

@@ -385,6 +385,11 @@ open class QSTileViewImpl @JvmOverloads constructor(
super.onInitializeAccessibilityNodeInfo(info)
// Clear selected state so it is not announce by talkback.
info.isSelected = false
info.text = if (TextUtils.isEmpty(secondaryLabel.text)) {
"${label.text}"
} else {
"${label.text}, ${secondaryLabel.text}"
}
if (lastDisabledByPolicy) {
info.addAction(
AccessibilityNodeInfo.AccessibilityAction(
@@ -402,12 +407,6 @@ open class QSTileViewImpl @JvmOverloads constructor(
accessibilityClass
}
if (Switch::class.java.name == accessibilityClass) {
val label = resources.getString(
if (tileState) R.string.switch_bar_on else R.string.switch_bar_off)
// Set the text here for tests in
// android.platform.test.scenario.sysui.quicksettings. Can be removed when
// UiObject2 has a new getStateDescription() API and tests are updated.
info.text = label
info.isChecked = tileState
info.isCheckable = true
if (isLongClickable) {