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

Commit 24e78d72 authored by Adam Powell's avatar Adam Powell
Browse files

Fix a bug in View#hasFocusable with new auto-focusable behavior

Check resolved focusability for hasFocusable and not just the
configured value.

Bug: 34855238
Test: CTS
Change-Id: I57af9e6c3a0ccd07058bcd0b2256a14878b8707c
parent 4a0ae490
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -6409,7 +6409,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        if ((mViewFlags & VISIBILITY_MASK) != VISIBLE) {
            return false;
        }
        return allowAutoFocus ? getFocusable() != NOT_FOCUSABLE : getFocusable() == FOCUSABLE;
        return (allowAutoFocus
                ? getFocusable() != NOT_FOCUSABLE
                : getFocusable() == FOCUSABLE) && isFocusable();
    }
    /**
+2 −1
Original line number Diff line number Diff line
@@ -1114,7 +1114,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        }

        // TODO This should probably be super.hasFocusable, but that would change behavior
        if (allowAutoFocus ? getFocusable() != NOT_FOCUSABLE : getFocusable() == FOCUSABLE) {
        if ((allowAutoFocus ? getFocusable() != NOT_FOCUSABLE : getFocusable() == FOCUSABLE)
                && isFocusable()) {
            return true;
        }