From 0dde3a3b345509a9c031c0981dd3705a03049d18 Mon Sep 17 00:00:00 2001 From: timpeng Date: Fri, 12 Apr 2019 16:53:56 +0800 Subject: [PATCH] [Fix] prevent Talkback from reading out Bluetooth ImageView ContentDescription - set View.IMPORTANT_FOR_ACCESSIBILITY_NO to ImageView Bug: 128396030 Test: RunSettingsRoboTests Change-Id: I267921057ede734a3c9be7087f34c96631e04859 --- .../android/settings/bluetooth/BluetoothDevicePreference.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java index ec5381c1c9f..74d3b6a0594 100644 --- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java +++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java @@ -29,6 +29,7 @@ import android.text.Html; import android.text.TextUtils; import android.util.Pair; import android.util.TypedValue; +import android.view.View; import android.widget.ImageView; import androidx.annotation.VisibleForTesting; @@ -170,6 +171,8 @@ public final class BluetoothDevicePreference extends GearPreference implements final ImageView imageView = (ImageView) view.findViewById(android.R.id.icon); if (imageView != null) { imageView.setContentDescription(contentDescription); + // Set property to prevent Talkback from reading out. + imageView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); imageView.setElevation( getContext().getResources().getDimension(R.dimen.bt_icon_elevation)); }