diff options
| author | 2023-04-27 14:33:38 +0000 | |
|---|---|---|
| committer | 2023-04-27 14:33:38 +0000 | |
| commit | 5d0e1903b6fb74c96dce2a47046ea5e67e77d29f (patch) | |
| tree | 61d7ff3f67c0f37a3d9328c5a0cd343cdde0bfd6 | |
| parent | 05492401525d6f16cbcf65e0d5136c60226aee19 (diff) | |
| parent | b5d358480af466aaebd9c4af498d361471404cd3 (diff) | |
Merge "Put all text content in the node's text" into udc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt index 4a3199850e0f..b80668379e49 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt @@ -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) { |