Disable focus search failures during a layout

If focus changes during a layout and FocusFinder cannot find the
next view, it may call LayoutManager's focus failed method, which
may add new views. This is a problem because we are essentially
calling layout inside a layout which is tricky to handle for any
layout manager.

This CL changes RecyclerView to ignore focus search request that
arrives during a layout or smooth scroll if FocusFinder cannot
find the next view.

When a View gains focus, we run the same checks (already) so that
RecyclerView will not jump around while trying to make the View
visible.

Bug: 18840571
Change-Id: I07c7c8ebcdb5f4d5a064f62caf8ab97e19983426
1 file changed