From 8439ece7216a5540db1bb09a7e57b03eb3889711 Mon Sep 17 00:00:00 2001 From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Fri, 8 Jul 2022 23:13:21 +0200 Subject: [PATCH] Fix SystemWebView building issue and signin crash --- ...ow-building-without-enable_reporting.patch | 2 +- .../Enable-native-Android-autofill.patch | 13 +++++-- .../Remove-signin-and-sync-integrations.patch | 38 ++++++++++++++++++- 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/build/patches/Allow-building-without-enable_reporting.patch b/build/patches/Allow-building-without-enable_reporting.patch index e4000b76..0484c38a 100644 --- a/build/patches/Allow-building-without-enable_reporting.patch +++ b/build/patches/Allow-building-without-enable_reporting.patch @@ -33,7 +33,7 @@ diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw + enable_download_manager) : base::BindRepeating(&autofill::BrowserDriverInitHook, AwAutofillClient::FromWebContents(web_contents), - base::android::GetDefaultLocaleString()); + base::android::GetDefaultLocaleString(), diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc --- a/content/browser/devtools/protocol/network_handler.cc +++ b/content/browser/devtools/protocol/network_handler.cc diff --git a/build/patches/Enable-native-Android-autofill.patch b/build/patches/Enable-native-Android-autofill.patch index c83e7248..131b6948 100644 --- a/build/patches/Enable-native-Android-autofill.patch +++ b/build/patches/Enable-native-Android-autofill.patch @@ -15,7 +15,7 @@ See also: https://github.com/bromite/bromite/issues/547 Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - android_webview/browser/aw_contents.cc | 2 +- + android_webview/browser/aw_contents.cc | 5 +- chrome/android/BUILD.gn | 1 + .../settings/PasswordSettings.java | 81 ++++++++++++++++++- .../chromium/chrome/browser/tab/TabImpl.java | 50 ++++++++++++ @@ -37,12 +37,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../autofill/core/common/autofill_prefs.h | 2 + .../embedder_support/view/ContentView.java | 46 +++++++++++ .../chromium/ui/base/ViewAndroidDelegate.java | 8 ++ - 22 files changed, 310 insertions(+), 13 deletions(-) + 22 files changed, 312 insertions(+), 14 deletions(-) diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc --- a/android_webview/browser/aw_contents.cc +++ b/android_webview/browser/aw_contents.cc -@@ -339,7 +339,7 @@ void AwContents::InitAutofillIfNecessary(bool autocomplete_enabled) { +@@ -339,10 +339,11 @@ void AwContents::InitAutofillIfNecessary(bool autocomplete_enabled) { autofill_provider ? base::BindRepeating(&autofill::AndroidDriverInitHook, AwAutofillClient::FromWebContents(web_contents), @@ -50,7 +50,12 @@ diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw + enable_download_manager, /*enable_browser_autofill_manager*/ false) : base::BindRepeating(&autofill::BrowserDriverInitHook, AwAutofillClient::FromWebContents(web_contents), - base::android::GetDefaultLocaleString()); +- base::android::GetDefaultLocaleString()); ++ base::android::GetDefaultLocaleString(), ++ /*enable_secondary_autofill_manager*/ false); + + ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( + web_contents, AwAutofillClient::FromWebContents(web_contents), diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn diff --git a/build/patches/Remove-signin-and-sync-integrations.patch b/build/patches/Remove-signin-and-sync-integrations.patch index cd69b0a5..1103d0e9 100644 --- a/build/patches/Remove-signin-and-sync-integrations.patch +++ b/build/patches/Remove-signin-and-sync-integrations.patch @@ -72,6 +72,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../tabbed_mode/TabbedRootUiCoordinator.java | 19 -- .../browser/tasks/ReturnToChromeUtil.java | 9 +- chrome/browser/BUILD.gn | 11 - + ...mobile_identity_consistency_field_trial.cc | 15 +- chrome/browser/feed/android/BUILD.gn | 1 - .../chrome/browser/feed/FeedFeatures.java | 2 - .../browser/firstrun/MobileFreProgress.java | 4 +- @@ -106,7 +107,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../signin/SystemAccountManagerDelegate.java | 25 +-- .../net/HttpNegotiateAuthenticator.java | 88 +------- .../chromoting/base/OAuthTokenFetcher.java | 2 - - 87 files changed, 82 insertions(+), 2085 deletions(-) + 88 files changed, 85 insertions(+), 2097 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn @@ -3246,6 +3247,41 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn "upgrade_detector/get_installed_version.cc", "upgrade_detector/get_installed_version.h", "upgrade_detector/installed_version_monitor.h", +diff --git a/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.cc b/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.cc +--- a/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.cc ++++ b/chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.cc +@@ -5,28 +5,19 @@ + #include "chrome/browser/android/signin/fre_mobile_identity_consistency_field_trial.h" + #include "base/android/jni_android.h" + #include "base/android/jni_string.h" +-#include "chrome/browser/signin/services/android/jni_headers/FREMobileIdentityConsistencyFieldTrial_jni.h" + + namespace fre_mobile_identity_consistency_field_trial { + + std::string GetFREFieldTrialGroup() { +- JNIEnv* env = base::android::AttachCurrentThread(); +- base::android::ScopedJavaLocalRef group = +- Java_FREMobileIdentityConsistencyFieldTrial_getFirstRunTrialGroup(env); +- return base::android::ConvertJavaStringToUTF8(env, group); ++ return std::string(); + } + + bool IsFREFieldTrialEnabled() { +- JNIEnv* env = base::android::AttachCurrentThread(); +- return Java_FREMobileIdentityConsistencyFieldTrial_isEnabled(env); ++ return false; + } + + std::string GetFREVariationsFieldTrialGroup() { +- JNIEnv* env = base::android::AttachCurrentThread(); +- base::android::ScopedJavaLocalRef group = +- Java_FREMobileIdentityConsistencyFieldTrial_getFirstRunVariationsTrialGroup( +- env); +- return base::android::ConvertJavaStringToUTF8(env, group); ++ return std::string(); + } + + } // namespace fre_mobile_identity_consistency_field_trial diff --git a/chrome/browser/feed/android/BUILD.gn b/chrome/browser/feed/android/BUILD.gn --- a/chrome/browser/feed/android/BUILD.gn +++ b/chrome/browser/feed/android/BUILD.gn