Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0dde3a3b authored by timpeng's avatar timpeng Committed by tim peng
Browse files

[Fix] prevent Talkback from reading out Bluetooth ImageView ContentDescription

- set View.IMPORTANT_FOR_ACCESSIBILITY_NO to ImageView

Bug: 128396030
Test: RunSettingsRoboTests
Change-Id: I267921057ede734a3c9be7087f34c96631e04859
parent 0ea58e74
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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));
        }