Merge "Don't generate VIEW_TEXT_CHANGED events when the TextView is not laid out."
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 2a42232..522be81 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -10209,7 +10209,7 @@
}
// ContentCapture
- if (isImportantForContentCapture() && isTextEditable()) {
+ if (isLaidOut() && isImportantForContentCapture() && isTextEditable()) {
final ContentCaptureManager cm = mContext.getSystemService(ContentCaptureManager.class);
if (cm != null && cm.isContentCaptureEnabled()) {
// TODO(b/111276913): pass flags when edited by user / add CTS test