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

Commit f5a0d099 authored by Jiaquan He's avatar Jiaquan He
Browse files

Opt out default focus highlight for TV.

Test: Checked that the default focus highlight doesn't show on TV.
Bug: 37160940
Change-Id: Id3719ce1aa602ba6792cc94c9fa034670509cda0
parent 8e3b1a63
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3874,6 +3874,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;
@@ -4448,6 +4452,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;
        }
    }
@@ -19607,7 +19614,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;
    }
    /**
+3 −0
Original line number Diff line number Diff line
@@ -36,4 +36,7 @@
    <!-- The default gravity for the picture-in-picture window.
         Currently, this maps to Gravity.BOTTOM | Gravity.RIGHT -->
    <integer name="config_defaultPictureInPictureGravity">0x55</integer>

    <!-- Whether the device uses the default focus highlight when focus state isn't specified. -->
    <bool name="config_useDefaultFocusHighlight">false</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -2833,4 +2833,7 @@
          specified name exists on the device, autofill will be disabled by default.
    -->
    <string name="config_defaultAutofillService" translatable="false"></string>

    <!-- Whether the device uses the default focus highlight when focus state isn't specified. -->
    <bool name="config_useDefaultFocusHighlight">true</bool>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -427,6 +427,7 @@
  <java-symbol type="integer" name="config_mdc_initial_max_retry" />
  <java-symbol type="integer" name="config_keepPreloadsMinDays" />
  <java-symbol type="bool" name="config_hasPermanentDpad" />
  <java-symbol type="bool" name="config_useDefaultFocusHighlight" />

  <java-symbol type="color" name="tab_indicator_text_v4" />