Merge "Don't crash during layout of non-attached but focused view" into pi-dev
am: 62bb0802f9
Change-Id: I5b091f4fc17586a80934bbea0437323f794d6465
This commit is contained in:
@@ -20700,7 +20700,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
if (canTakeFocus()) {
|
if (canTakeFocus()) {
|
||||||
// We have a robust focus, so parents should no longer be wanting focus.
|
// We have a robust focus, so parents should no longer be wanting focus.
|
||||||
clearParentsWantFocus();
|
clearParentsWantFocus();
|
||||||
} else if (!getViewRootImpl().isInLayout()) {
|
} else if (getViewRootImpl() == null || !getViewRootImpl().isInLayout()) {
|
||||||
// This is a weird case. Most-likely the user, rather than ViewRootImpl, called
|
// This is a weird case. Most-likely the user, rather than ViewRootImpl, called
|
||||||
// layout. In this case, there's no guarantee that parent layouts will be evaluated
|
// layout. In this case, there's no guarantee that parent layouts will be evaluated
|
||||||
// and thus the safest action is to clear focus here.
|
// and thus the safest action is to clear focus here.
|
||||||
|
|||||||
Reference in New Issue
Block a user