From 3129f5e2c2c1f0ed058854dde75b4310dcc9f967 Mon Sep 17 00:00:00 2001 From: uazo <29201891+uazo@users.noreply.github.com> Date: Sun, 24 Oct 2021 23:06:27 +0200 Subject: [PATCH] fix potential crash on android M (#1512) --- build/patches/Enable-android-autofill.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build/patches/Enable-android-autofill.patch b/build/patches/Enable-android-autofill.patch index fa73de6f..280967e6 100644 --- a/build/patches/Enable-android-autofill.patch +++ b/build/patches/Enable-android-autofill.patch @@ -14,9 +14,9 @@ Subject: Enable android autofill chrome/browser/ui/tab_helpers.cc | 6 +- .../autofill/core/common/autofill_prefs.cc | 5 ++ .../autofill/core/common/autofill_prefs.h | 1 + - .../embedder_support/view/ContentView.java | 48 ++++++++++++++- + .../embedder_support/view/ContentView.java | 48 +++++++++++++++ .../chromium/ui/base/ViewAndroidDelegate.java | 8 +++ - 13 files changed, 220 insertions(+), 3 deletions(-) + 13 files changed, 221 insertions(+), 2 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn @@ -401,16 +401,16 @@ diff --git a/components/embedder_support/android/java/src/org/chromium/component /** * The containing view for {@link WebContents} that exists in the Android UI hierarchy and exposes * the various {@link View} functionality to it. -@@ -83,7 +89,7 @@ public class ContentView extends FrameLayout +@@ -82,6 +88,8 @@ public class ContentView extends FrameLayout + */ public static ContentView createContentView(Context context, @Nullable EventOffsetHandler eventOffsetHandler, @Nullable WebContents webContents) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { -- return new ContentViewApi23(context, eventOffsetHandler, webContents); ++ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) + return new ContentViewWithAutofill(context, eventOffsetHandler, webContents); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + return new ContentViewApi23(context, eventOffsetHandler, webContents); } - return new ContentView(context, eventOffsetHandler, webContents); - } -@@ -549,4 +555,44 @@ public class ContentView extends FrameLayout +@@ -549,4 +557,44 @@ public class ContentView extends FrameLayout if (wcax != null) wcax.onProvideVirtualStructure(structure, false); } }