Commit 14bdf30e authored by Fabian Henneke's avatar Fabian Henneke Committed by Commit Bot

Disable UrlBar augmented Autofill on Android Q+

Marks the UrlBar as having Autofill type NONE, which disables both
standard and augmented Autofill from triggering when the user
interacts with the URl bar.

Android Q introduced the concept of a system-level augmented Autofill
service that replies to fill requests if the user-level standard
Autofill service is unable to, e.g., when the request is triggered
on a view labeled with importantForAutofill="no". Once an Autofill
session is captured by the augmented Autofill service, the standard
Autofill service is no longer invoked until the session ends or the
user initiates a manual Autofill request.

As Chrome's URL bar is marked not important for Autofill to prevent
third-party Autofill services from showing fill UI on it, interactions
with it frequently trigger augmented Autofill, which results in the
user-configured Autofill service no longer being called on web forms.
Moreover, since views representing web form fields are not native
Android views, they also lack the context menu action with which the
user could perform a manual Autofill request and escape the augmented
Autofill capture.

With an Autofill type of AUTOFILL_TYPE_NONE, the URL bar no longer
triggers any Autofill actions, which prevents this scenario.

A side effect is that the manual Autofill action on the URL bar is no
longer available. However, as real-world Autofill services were found to
offer no fill suggestions when invoked manually on current versions of
Chrome, this is only a theoretical concern.

Bug: 1103555
Change-Id: Ib4089a33db4c674175ccb5ce381dbd703428237c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522078Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Commit-Queue: Fabian Henneke <fabian.henneke@gmail.com>
Cr-Commit-Position: refs/heads/master@{#827588}
parent 0666b951
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.omnibox; package org.chromium.chrome.browser.omnibox;
import android.content.Context; import android.content.Context;
import android.os.Build;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.ViewStructure; import android.view.ViewStructure;
...@@ -31,4 +32,16 @@ public class UrlBarApi26 extends UrlBar { ...@@ -31,4 +32,16 @@ public class UrlBarApi26 extends UrlBar {
super.onProvideAutofillStructure(structure, autofillFlags); super.onProvideAutofillStructure(structure, autofillFlags);
mRequestingAutofillStructure = false; mRequestingAutofillStructure = false;
} }
@Override
public int getAutofillType() {
// https://crbug.com/1103555: Prevent augmented autofill service from taking over the
// session by disabling both standard and augmented autofill on versions of Android
// where both are supported.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
return AUTOFILL_TYPE_NONE;
} else {
return super.getAutofillType();
}
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment