[Fix] prevent Talkback from reading out Bluetooth ImageView ContentDescription am: 0dde3a3b34

am: df2ab2663e

Change-Id: Ie65357baf9d84295826afe392087f01c5446045c
This commit is contained in:
timpeng
2019-05-02 01:56:34 -07:00
committed by android-build-merger

View File

@@ -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));
}