diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java index 60537a4ca3ec3..6c18b4560d294 100644 --- a/core/java/android/service/autofill/AutofillService.java +++ b/core/java/android/service/autofill/AutofillService.java @@ -496,9 +496,9 @@ import android.view.autofill.AutofillValue; * *

Apps that use standard Android widgets support autofill out-of-the-box and need to do * very little to improve their user experience (annotating autofillable views and providing - * autofill hints). However, some apps do their own rendering and the rendered content may - * contain semantic structure that needs to be surfaced to the autofill framework. The platform - * exposes APIs to achieve this, however it could take some time until these apps implement + * autofill hints). However, some apps (typically browsers) do their own rendering and the rendered + * content may contain semantic structure that needs to be surfaced to the autofill framework. The + * platform exposes APIs to achieve this, however it could take some time until these apps implement * autofill support. * *

To enable autofill for such apps the platform provides a compatibility mode in which the @@ -521,15 +521,33 @@ import android.view.autofill.AutofillValue; * <meta-data android:name="android.autofill" android:resource="@xml/autofillservice" /> * </service> * - *

In the XML file you can specify one or more packages for which to enable compatibility + *

In the XML file you can specify one or more packages for which to enable compatibility * mode. Below is a sample meta-data declaration: * *

 <autofill-service xmlns:android="http://schemas.android.com/apk/res/android">
  *     <compatibility-package android:name="foo.bar.baz" android:maxLongVersionCode="1000000000"/>
  * </autofill-service>
* - *

When using compatibility mode, the {@link SaveInfo.Builder#setFlags(int) SaveInfo flags} - * automatically include {@link SaveInfo#FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE}. + *

Notice that compatibility mode has limitations such as: + *

*/ public abstract class AutofillService extends Service { private static final String TAG = "AutofillService"; diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 1d62eb7b76415..e6b2a3522fd1a 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -2151,11 +2151,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState if (saveTriggerId != null) { writeLog(MetricsEvent.AUTOFILL_EXPLICIT_SAVE_TRIGGER_DEFINITION); } - int flags = saveInfo.getFlags(); - if (mCompatMode) { - flags |= SaveInfo.FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE; - } - mSaveOnAllViewsInvisible = (flags & SaveInfo.FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE) != 0; + mSaveOnAllViewsInvisible = + (saveInfo.getFlags() & SaveInfo.FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE) != 0; // We only need to track views if we want to save once they become invisible. if (mSaveOnAllViewsInvisible) {