View already checks if its layout is being updated when calling
notifyEnterOrExitForAutoFillIfNeeded(), but that doesn't prevent apps crashing
when the autofill process was triggered by another view.
Test: existing CtsAutoFillServiceTestCases pass
Fixes:
38198484
change-Id: I8e9435ddc4cf21fb648d39aace93f3af0e1fdf4f
boolean forAutofill, @AutofillFlags int flags) {
if (forAutofill) {
structure.setAutofillId(getAutofillId());
+ if (!isLaidOut()) {
+ Log.w(VIEW_LOG_TAG, "dispatchProvideAutofillStructure(): not laid out, ignoring");
+ return;
+ }
onProvideAutofillStructure(structure, flags);
onProvideAutofillVirtualStructure(structure, flags);
} else if (!isAssistBlocked()) {