Commit 4dd095b4 authored by Fabian Henneke's avatar Fabian Henneke Committed by Commit Bot

Revert "Cancel augmented Autofill session when URL bar loses focus"

This reverts commit 444aad95.

Reason for revert: Tests in Canary confirm that the CL does not achieve the intended improvement of Autofill reliability.

Original change's description:
> Cancel augmented Autofill session when URL bar loses focus
>
> Since Android Q, views that are labeled with importantForAutofill=no
> can still trigger the augmented Autofill service. If this happens, no
> ordinary Autofill requests will be triggered anymore for as long as the
> Autofill session remains active. This prevents the user-configured
> Autofill service from running on web contents if the user's first
> interaction is with the URL bar.
>
> This issue is resolved by canceling the current Autofill session when
> the URL bar loses focus.
>
> R=​dmazzoni@chromium.org, michaelbai@chromium.org
>
> Bug: 1103555
> Change-Id: If06c15f4c397107c284c4de757f58c3aeb939cf0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2302636
> Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
> Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#808524}

TBR=dmazzoni@chromium.org,michaelbai@chromium.org,yusufo@chromium.org,agrieve@chromium.org,fabian.henneke@gmail.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1103555
Change-Id: If9fd24b8153256ec8a08d7dd724141e7e338887b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2430861
Commit-Queue: Fabian Henneke <fabian.henneke@gmail.com>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827595}
parent f0f2e383
...@@ -11,14 +11,12 @@ import android.content.pm.ApplicationInfo; ...@@ -11,14 +11,12 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Build; import android.os.Build;
import android.view.autofill.AutofillManager;
import android.view.Display; import android.view.Display;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
import org.chromium.base.StrictModeContext; import org.chromium.base.StrictModeContext;
import org.chromium.base.annotations.VerifiesOnO; import org.chromium.base.annotations.VerifiesOnO;
import org.chromium.base.ContextUtils;
/** /**
* Utility class to use new APIs that were added in O (API level 26). These need to exist in a * Utility class to use new APIs that were added in O (API level 26). These need to exist in a
...@@ -72,13 +70,4 @@ public final class ApiHelperForO { ...@@ -72,13 +70,4 @@ public final class ApiHelperForO {
return context.createContextForSplit(name); return context.createContextForSplit(name);
} }
} }
/** See {@link AutofillManager@cancel()}. */
public static void cancelAutofillSession() {
AutofillManager autofillManager = ContextUtils.getApplicationContext().getSystemService(
AutofillManager.class);
if (autofillManager != null) {
autofillManager.cancel();
}
}
} }
...@@ -39,7 +39,6 @@ import org.chromium.base.Callback; ...@@ -39,7 +39,6 @@ import org.chromium.base.Callback;
import org.chromium.base.Log; import org.chromium.base.Log;
import org.chromium.base.SysUtils; import org.chromium.base.SysUtils;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.base.compat.ApiHelperForO;
import org.chromium.base.metrics.RecordUserAction; import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.browser.WindowDelegate; import org.chromium.chrome.browser.WindowDelegate;
import org.chromium.ui.KeyboardVisibilityDelegate; import org.chromium.ui.KeyboardVisibilityDelegate;
...@@ -288,14 +287,6 @@ public abstract class UrlBar extends AutocompleteEditText { ...@@ -288,14 +287,6 @@ public abstract class UrlBar extends AutocompleteEditText {
mPendingScroll = false; mPendingScroll = false;
} }
fixupTextDirection(); fixupTextDirection();
if (!focused && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
// https://crbug.com/1103555: On Android Q+, the URL bar can trigger augmented
// Autofill, which disables ordinary Autofill requests for the duration of the
// Autofill session. This is worked around by canceling the session when the user
// focuses another view.
ApiHelperForO.cancelAutofillSession();
}
} }
/** /**
......
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