Ignore dispatchProvideStructureForAutofill() when layout is being updated.

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
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a9c85f0..5c926f6 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -8065,6 +8065,10 @@
             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()) {