diff options
| author | 2024-04-24 17:31:27 +0000 | |
|---|---|---|
| committer | 2024-04-24 17:31:27 +0000 | |
| commit | e407396e29be04f2523b8f15e655ca786fafc20b (patch) | |
| tree | c46b44128821110511d481fe6dc3cfa27cb38ddd | |
| parent | 26d9dcb8ca0cf03abb0b704c0ffb69d19221179c (diff) | |
Update device entry icon label and a11y action
Previously there was no content description so
the device entry icon was announced as unlabled.
Update the a11y action for the device entry
icon to accurately represent a longpress, not
a click.
Fixes: 336313562
Flag: ACONFIG com.android.systemui.device_entry_udfps_refactor NEXTFOOD
Test: manually enable a11y and select device entry icon. observe
the correct label & hint is announced.
Change-Id: I91fef201f56636cdb0c8306a665ab4f6acbadac7
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt | 2 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt index f46a207b273a..cccb93c56d94 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt @@ -128,6 +128,8 @@ object DeviceEntryIconViewBinder { view.getIconState(viewModel.type, viewModel.useAodVariant), /* merge */ false ) + fgIconView.contentDescription = + fgIconView.resources.getString(viewModel.type.contentDescriptionResId) fgIconView.imageTintList = ColorStateList.valueOf(viewModel.tint) fgIconView.setPadding( viewModel.padding, diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt index af1d0df92652..2735aed3ba4d 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt @@ -68,12 +68,12 @@ constructor( object : AccessibilityDelegate() { private val accessibilityAuthenticateHint = AccessibilityNodeInfo.AccessibilityAction( - AccessibilityNodeInfoCompat.ACTION_CLICK, + AccessibilityNodeInfoCompat.ACTION_LONG_CLICK, resources.getString(R.string.accessibility_authenticate_hint) ) private val accessibilityEnterHint = AccessibilityNodeInfo.AccessibilityAction( - AccessibilityNodeInfoCompat.ACTION_CLICK, + AccessibilityNodeInfoCompat.ACTION_LONG_CLICK, resources.getString(R.string.accessibility_enter_hint) ) override fun onInitializeAccessibilityNodeInfo( @@ -261,10 +261,10 @@ constructor( return lockIconState } - enum class IconType { - LOCK, - UNLOCK, - FINGERPRINT, + enum class IconType(val contentDescriptionResId: Int) { + LOCK(R.string.accessibility_lock_icon), + UNLOCK(R.string.accessibility_unlock_button), + FINGERPRINT(R.string.accessibility_fingerprint_label), } enum class AccessibilityHintType { |