diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 5ea5b0e834a40..29632af0bf086 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -7171,6 +7171,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, boolean blocked = forAutoFill ? isAutoFillBlocked() : isAssistBlocked(); if (!blocked) { if (forAutoFill) { + // The auto-fill id needs to be unique, but its value doesn't matter, + // so it's better to reuse the accessibility id to save space. + structure.setAutoFillId(getAccessibilityViewId()); // NOTE: flags are not currently supported, hence 0 onProvideAutoFillStructure(structure, 0); onProvideAutoFillVirtualStructure(structure, 0);