diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 4f0aa32f59bb2..9ab6775310f4f 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -3887,6 +3887,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
private Drawable mDefaultFocusHighlight;
private Drawable mDefaultFocusHighlightCache;
private boolean mDefaultFocusHighlightSizeChanged;
+ /**
+ * True if the default focus highlight is needed on the target device.
+ */
+ private static boolean sUseDefaultFocusHighlight;
private String mTransitionName;
@@ -4464,6 +4468,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
sAutoFocusableOffUIThreadWontNotifyParents = targetSdkVersion < Build.VERSION_CODES.O;
+ sUseDefaultFocusHighlight = context.getResources().getBoolean(
+ com.android.internal.R.bool.config_useDefaultFocusHighlight);
+
sCompatibilityDone = true;
}
}
@@ -19677,7 +19684,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
final boolean hasFocusStateSpecified = background == null || !background.isStateful()
|| !background.hasFocusStateSpecified();
return !isInTouchMode() && getDefaultFocusHighlightEnabled() && hasFocusStateSpecified
- && isAttachedToWindow();
+ && isAttachedToWindow() && sUseDefaultFocusHighlight;
}
/**
diff --git a/core/res/res/values-television/config.xml b/core/res/res/values-television/config.xml
index 78eeee99150a6..d62b93efc1a19 100644
--- a/core/res/res/values-television/config.xml
+++ b/core/res/res/values-television/config.xml
@@ -36,4 +36,7 @@
0x55
+
+
+ false
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index e85f5602b79e6..27a4d5c2f5afa 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2830,4 +2830,7 @@
specified name exists on the device, autofill will be disabled by default.
-->
+
+
+ true
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 907294d744f7b..1dd8227edafda 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -427,6 +427,7 @@
+