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

Commit b066a1d6 authored by Arthur Hung's avatar Arthur Hung Committed by Android (Google) Code Review
Browse files

Merge "Revert "Clear default focus highlight when lost window focus or re-enter touch mode""

parents 6a4b8ff6 9b81e4ea
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -24515,9 +24515,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * Set the current default focus highlight.
     * @param highlight the highlight drawable, or {@code null} if it's no longer needed.
     * @hide
     */
    void setDefaultFocusHighlight(Drawable highlight) {
    private void setDefaultFocusHighlight(Drawable highlight) {
        mDefaultFocusHighlight = highlight;
        mDefaultFocusHighlightSizeChanged = true;
        if (highlight != null) {
+1 −14
Original line number Diff line number Diff line
@@ -3815,13 +3815,6 @@ public final class ViewRootImpl implements ViewParent,
                if (mAttachInfo.mTooltipHost != null) {
                    mAttachInfo.mTooltipHost.hideTooltip();
                }
                if (!hasWindowFocus) {
                    // Clear focus highlight if its window lost focus.
                    final View focused = mView.findFocus();
                    if (focused != null) {
                        focused.setDefaultFocusHighlight(null);
                    }
                }
            }

            // Note: must be done after the focus change callbacks,
@@ -5853,13 +5846,7 @@ public final class ViewRootImpl implements ViewParent,
            // be when the window is first being added, and mFocused isn't
            // set yet.
            final View focused = mView.findFocus();
            if (focused == null) {
                return false;
            }

            // Clear default focus highlight if it entered touch mode.
            focused.setDefaultFocusHighlight(null);
            if (!focused.isFocusableInTouchMode()) {
            if (focused != null && !focused.isFocusableInTouchMode()) {
                final ViewGroup ancestorToTakeFocus = findAncestorToTakeFocusInTouchMode(focused);
                if (ancestorToTakeFocus != null) {
                    // there is an ancestor that wants focus after its