Browse Source

Clean and remove unused patches

master
wchen342 2 years ago
parent
commit
2a911fcb83
Signed by untrusted user: wchen342 GPG Key ID: 720B70365E800508
  1. 2635
      patches/Other/debug-fix.patch
  2. 88
      patches/src-fix/fix-extra-safe-browsing.patch
  3. 75
      patches/src-fix/fix-safe-browsing-prefs.patch
  4. 4
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch

2635
patches/Other/debug-fix.patch

File diff suppressed because it is too large

88
patches/src-fix/fix-extra-safe-browsing.patch

@ -1,88 +0,0 @@
From: Wengling Chen <[email protected]>
Date: Mon, 13 Jan 2020 23:03:53 -0500
Subject: Extra fix for build without safe browsing
---
chrome/android/BUILD.gn | 1 -
chrome/android/chrome_java_sources.gni | 1 -
chrome/android/java/src/org/chromium/chrome/browser/settings/sync/SyncAndServicesPreferences.java | 8 ++------
chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java | 3 +--
4 files changed, 3 insertions(+), 10 deletions(-)
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -2780,7 +2780,6 @@ generate_jni("chrome_jni_headers") {
"java/src/org/chromium/chrome/browser/rappor/RapporServiceBridge.java",
"java/src/org/chromium/chrome/browser/rlz/RevenueStats.java",
"java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java",
- "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java",
"java/src/org/chromium/chrome/browser/search_engines/TemplateUrlServiceFactory.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/NotificationManager.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/SendTabToSelfAndroidBridge.java",
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -1315,7 +1315,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/rappor/RapporServiceBridge.java",
"java/src/org/chromium/chrome/browser/rlz/RevenueStats.java",
"java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java",
- "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java",
"java/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceMetrics.java",
"java/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceNotification.java",
"java/src/org/chromium/chrome/browser/search_engines/TemplateUrlServiceFactory.java",
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/sync/SyncAndServicesPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/sync/SyncAndServicesPreferences.java
@@ -45,7 +45,6 @@ import org.chromium.chrome.browser.metri
import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.profiles.Profile;
-import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge;
import org.chromium.chrome.browser.settings.ChromeBasePreference;
import org.chromium.chrome.browser.settings.ChromeSwitchPreference;
import org.chromium.chrome.browser.settings.ManagedPreferenceDelegate;
@@ -374,8 +373,6 @@ public class SyncAndServicesPreferences
} else if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
mPrefServiceBridge.setBoolean(
Pref.PASSWORD_MANAGER_LEAK_DETECTION_ENABLED, (boolean) newValue);
- } else if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- SafeBrowsingBridge.setSafeBrowsingExtendedReportingEnabled((boolean) newValue);
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED, (boolean) newValue);
} else if (PREF_USAGE_AND_CRASH_REPORTING.equals(key)) {
@@ -669,8 +666,7 @@ public class SyncAndServicesPreferences
private void updateLeakDetectionAndSafeBrowsingReportingPreferences() {
boolean safe_browsing_enabled = mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED);
mSafeBrowsingReporting.setEnabled(safe_browsing_enabled);
- mSafeBrowsingReporting.setChecked(safe_browsing_enabled
- && SafeBrowsingBridge.isSafeBrowsingExtendedReportingEnabled());
+ mSafeBrowsingReporting.setChecked(false);
if (mPasswordLeakDetection == null) return; // Early exit without leak detection to update.
@@ -700,7 +696,7 @@ public class SyncAndServicesPreferences
return mPrefServiceBridge.isManagedPreference(Pref.SEARCH_SUGGEST_ENABLED);
}
if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- return SafeBrowsingBridge.isSafeBrowsingExtendedReportingManaged();
+ return false;
}
if (PREF_SAFE_BROWSING.equals(key)) {
return mPrefServiceBridge.isManagedPreference(Pref.SAFE_BROWSING_ENABLED);
--- a/chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java
@@ -20,7 +20,6 @@ import org.chromium.base.task.PostTask;
import org.chromium.base.task.TaskRunner;
import org.chromium.base.task.TaskTraits;
import org.chromium.chrome.browser.ChromeActivity;
-import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge;
import org.chromium.chrome.browser.share.ShareHelper;
import org.chromium.chrome.browser.share.ShareParams;
import org.chromium.content_public.browser.WebContents;
@@ -198,7 +197,7 @@ public class ShareServiceImpl implements
for (SharedFile file : files) {
RecordHistogram.recordSparseHistogram(
- "WebShare.Unverified", SafeBrowsingBridge.umaValueForFile(file.name));
+ "WebShare.Unverified", 1);
}
for (SharedFile file : files) {

75
patches/src-fix/fix-safe-browsing-prefs.patch

@ -3,14 +3,15 @@ Date: Fri, 10 Jan 2020 18:01:56 -0500
Subject: Fix build error caused by the removal of safe_browsing_prefs.h
---
android_webview/browser/aw_browser_context.cc | 2 -
android_webview/browser/safe_browsing/aw_safe_browsing_blocking_page.cc | 10 ++---
android_webview/browser/aw_browser_context.cc | 2
android_webview/browser/safe_browsing/aw_safe_browsing_blocking_page.cc | 10 ++--
chrome/android/BUILD.gn | 1
chrome/android/chrome_java_sources.gni | 1
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java | 19 ++--------
chrome/browser/android/preferences/prefs.h | 2 -
weblayer/browser/browser_context_impl.cc | 2 -
7 files changed, 10 insertions(+), 27 deletions(-)
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java | 21 ----------
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java | 19 +--------
chrome/browser/android/preferences/prefs.h | 2
weblayer/browser/browser_context_impl.cc | 2
8 files changed, 12 insertions(+), 46 deletions(-)
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@ -154,3 +155,65 @@ Subject: Fix build error caused by the removal of safe_browsing_prefs.h
security_state::RegisterProfilePrefs(pref_registry);
language::LanguagePrefs::RegisterProfilePrefs(pref_registry);
translate::TranslatePrefs::RegisterProfilePrefs(pref_registry);
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java
@@ -28,7 +28,6 @@ import org.chromium.chrome.browser.prefe
import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
import org.chromium.chrome.browser.privacy.settings.PrivacyPreferencesManager;
import org.chromium.chrome.browser.profiles.Profile;
-import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge;
import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate;
import org.chromium.chrome.browser.signin.UnifiedConsentServiceBridge;
import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
@@ -158,17 +157,9 @@ public class GoogleServicesSettings
String key = preference.getKey();
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
- } else if (PREF_SAFE_BROWSING.equals(key)) {
- mPrefServiceBridge.setBoolean(Pref.SAFE_BROWSING_ENABLED, (boolean) newValue);
- // Toggling the safe browsing preference impacts the leak detection and the
- // safe browsing reporting preferences as well.
- PostTask.postTask(UiThreadTaskTraits.DEFAULT,
- this::updateLeakDetectionAndSafeBrowsingReportingPreferences);
} else if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
mPrefServiceBridge.setBoolean(
Pref.PASSWORD_MANAGER_LEAK_DETECTION_ENABLED, (boolean) newValue);
- } else if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- SafeBrowsingBridge.setSafeBrowsingExtendedReportingEnabled((boolean) newValue);
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED, (boolean) newValue);
} else if (PREF_USAGE_AND_CRASH_REPORTING.equals(key)) {
@@ -191,7 +182,6 @@ public class GoogleServicesSettings
mSearchSuggestions.setChecked(mPrefServiceBridge.getBoolean(Pref.SEARCH_SUGGEST_ENABLED));
mNavigationError.setChecked(
mPrefServiceBridge.getBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED));
- mSafeBrowsing.setChecked(mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED));
updateLeakDetectionAndSafeBrowsingReportingPreferences();
@@ -217,10 +207,9 @@ public class GoogleServicesSettings
* its appearance needs to be updated. The same goes for safe browsing reporting.
*/
private void updateLeakDetectionAndSafeBrowsingReportingPreferences() {
- boolean safe_browsing_enabled = mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED);
+ boolean safe_browsing_enabled = false;
mSafeBrowsingReporting.setEnabled(safe_browsing_enabled);
- mSafeBrowsingReporting.setChecked(safe_browsing_enabled
- && SafeBrowsingBridge.isSafeBrowsingExtendedReportingEnabled());
+ mSafeBrowsingReporting.setChecked(safe_browsing_enabled);
boolean has_token_for_leak_check = PasswordUIView.hasAccountForLeakCheckRequest();
boolean leak_detection_enabled =
@@ -247,12 +236,6 @@ public class GoogleServicesSettings
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
return mPrefServiceBridge.isManagedPreference(Pref.SEARCH_SUGGEST_ENABLED);
}
- if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- return SafeBrowsingBridge.isSafeBrowsingExtendedReportingManaged();
- }
- if (PREF_SAFE_BROWSING.equals(key)) {
- return mPrefServiceBridge.isManagedPreference(Pref.SAFE_BROWSING_ENABLED);
- }
if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
return mPrefServiceBridge.isManagedPreference(
Pref.PASSWORD_MANAGER_LEAK_DETECTION_ENABLED);

4
patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch

@ -641,7 +641,7 @@ Subject: Remove dependency on com.google.android.gms.vision,
@@ -8,9 +8,6 @@ import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GoogleApiAvailability;
-
@ -649,7 +649,7 @@ Subject: Remove dependency on com.google.android.gms.vision,
import org.chromium.base.Log;
import org.chromium.mojo.bindings.InterfaceRequest;
@@ -55,23 +52,6 @@ public class BarcodeDetectionProviderImp
public static BarcodeDetectionProvider create() {
Context ctx = ContextUtils.getApplicationContext();
- if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(ctx)

Loading…
Cancel
Save