Browse Source

Merge pull request #4 from wchen342/master

Update to 77.0.3865.90-1
tags/78.0.3904.97-1
wchen342 2 years ago
committed by GitHub
parent
commit
ce71b8cffd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 1094 additions and 387 deletions
  1. +6
    -1
      CHANGELOG.md
  2. +2
    -0
      android_flags.release.gn
  3. +3
    -2
      build.sh
  4. +420
    -150
      domain_sub_2.list
  5. +2
    -1
      misc/android_studio_setup.sh
  6. +1
    -2
      patches/Vanadium/0020-disable-media-router-media-remoting-by-default.patch
  7. +2
    -4
      patches/Vanadium/0021-disable-media-router-by-default.patch
  8. +2
    -2
      patches/android-prune-domain-fix.patch
  9. +1
    -1
      patches/series
  10. +375
    -0
      patches/src-fix/fix-closure-compiler-minify-error.patch
  11. +0
    -40
      patches/src-fix/fix-redefinition-error.patch
  12. +9
    -9
      patches/ungoogled-chromium-android/change-package-name-chromium.patch
  13. +1
    -1
      patches/ungoogled-chromium-android/disable-context-search-by-default.patch
  14. +5
    -5
      patches/ungoogled-chromium-android/remove-gcm-client.patch
  15. +5
    -5
      patches/ungoogled-chromium-android/remove-gms-auth.patch
  16. +43
    -70
      patches/ungoogled-chromium-android/remove-gms-base-tasks.patch
  17. +7
    -7
      patches/ungoogled-chromium-android/remove-gms-cast.patch
  18. +8
    -8
      patches/ungoogled-chromium-android/remove-gms-fido-iid-instantapps-location.patch
  19. +1
    -1
      patches/ungoogled-chromium-android/remove-gms-flags-places-stats.patch
  20. +62
    -33
      patches/ungoogled-chromium-android/remove-gms-gcm.patch
  21. +128
    -35
      patches/ungoogled-chromium-android/remove-gms-vision-clearcut-phenotype.patch
  22. +9
    -8
      patches/ungoogled-chromium-android/remove-play-core.patch
  23. +2
    -2
      pruning_2.list

+ 6
- 1
CHANGELOG.md View File

@ -28,4 +28,9 @@
* Change default setting of contextual search to false
# 76.0.3809.132-1
* No change
* No change
# 77.0.3865.90-1
* Update patches to new version
* Update GN to latest commit
* Minor fixes

+ 2
- 0
android_flags.release.gn View File

@ -1,7 +1,9 @@
blink_symbol_level=0
enable_ac3_eac3_audio_demuxing=true
enable_iterator_debugging=false
enable_swiftshader=false
fatal_linker_warnings=false
is_debug=false
is_official_build=true
proprietary_codecs=true
symbol_level=0

+ 3
- 2
build.sh View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eux -o pipefail
chromium_version=76.0.3809.132
chromium_version=77.0.3865.90
target=monochrome_public_apk
webview_target=system_webview_apk
@ -59,7 +59,7 @@ git fetch --depth 1 --no-tags origin "${libsync_commit}"
git reset --hard FETCH_HEAD
popd
gn_commit=9bd94208ec741659d5126b990fdccd35a5c30b1f
gn_commit=bbc9dd04ea881b4bc0c36a1ff4ccc65111bab250
mv src/tools/gn src/tools/gn.bak
git clone https://gn.googlesource.com/gn src/tools/gn
pushd src/tools/gn
@ -110,6 +110,7 @@ tar xjf android-rebuilds/android-ndk-r18b-linux-x86_64.tar.bz2 -C android-ndk
# remove data_space.h, patch native_window.h
mv android-ndk/android-ndk-r18b/sysroot/usr/include/android/data_space.h android-ndk/android-ndk-r18b/sysroot/usr/include/android/data_space.h.bak
patch -p1 --ignore-whitespace -i patches/ndk-native-window.patch --no-backup-if-mismatch
# Create symbol links to sdk folders
# The rebuild sdk has a different folder structure from the checked out version, so it is easier to create symbol links
# Old aapt no longer works. Need to use Maven version until a rebuild of SDK 29 exists.


+ 420
- 150
domain_sub_2.list
File diff suppressed because it is too large
View File


+ 2
- 1
misc/android_studio_setup.sh View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eux -o pipefail
chromium_version=76.0.3809.132
chromium_version=77.0.3865.90
target=monochrome_public_apk
#target=system_webview_apk
@ -42,4 +42,5 @@ cat ../android_flags.debug.gn ../android_flags.gn > ${output_folder}/args.gn
tools/gn/out/gn gen ${output_folder} --fail-on-unused-args
# Generate gradle files
# autoninja needs a patch to remove the usage of vpython; also need psutil package
python build/android/gradle/generate_gradle.py --target //chrome/android:${target} --output-directory ${output_folder}

+ 1
- 2
patches/Vanadium/0020-disable-media-router-media-remoting-by-default.patch View File

@ -8,10 +8,9 @@ Subject: [PATCH 20/30] disable media router media remoting by default
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/chrome/browser/profiles/profile.cc b/src/chrome/browser/profiles/profile.cc
index e56624c60f42..dc2479bc4ad0 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -210,7 +210,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
@@ -223,7 +223,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
prefs::kMediaRouterFirstRunFlowAcknowledged,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);


+ 2
- 4
patches/Vanadium/0021-disable-media-router-by-default.patch View File

@ -9,10 +9,9 @@ Subject: [PATCH 21/30] disable media router by default
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/chrome/browser/media/router/media_router_feature.cc b/src/chrome/browser/media/router/media_router_feature.cc
index 9c42d30ecd22..e773dd54ad9e 100644
--- a/chrome/browser/media/router/media_router_feature.cc
+++ b/chrome/browser/media/router/media_router_feature.cc
@@ -58,17 +58,16 @@ const PrefService::Preference* GetMediaRouterPref(
@@ -57,17 +57,16 @@ const PrefService::Preference* GetMediaRouterPref(
bool MediaRouterEnabled(content::BrowserContext* context) {
#if defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
@ -39,10 +38,9 @@ index 9c42d30ecd22..e773dd54ad9e 100644
return false;
#endif // defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/src/chrome/browser/profiles/profile_impl.cc b/src/chrome/browser/profiles/profile_impl.cc
index 86ffb0c6cfc3..e32f0e7b83fe 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -435,7 +435,7 @@ void ProfileImpl::RegisterProfilePrefs(
@@ -437,7 +437,7 @@ void ProfileImpl::RegisterProfilePrefs(
registry->RegisterStringPref(
prefs::kPrintPreviewDefaultDestinationSelectionRules, std::string());
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);


+ 2
- 2
patches/android-prune-domain-fix.patch View File

@ -28,7 +28,7 @@ author: Wengling Chen <[email protected]>
build/android/tests/symbolize/liba.so
build/android/tests/symbolize/libb.so
build/linux/sysroot_scripts/debian-archive-sid-stable.gpg
@@ -3553,7 +3552,6 @@ third_party/angle/third_party/glmark2/src/data/models/cat.3ds
@@ -3582,7 +3581,6 @@ third_party/angle/third_party/glmark2/src/data/models/cat.3ds
third_party/angle/third_party/glmark2/src/data/models/cube.3ds
third_party/angle/third_party/glmark2/src/data/models/horse.3ds
third_party/angle/third_party/vulkan-loader/src/loader/loader.aps
@ -36,7 +36,7 @@ author: Wengling Chen <[email protected]>
third_party/blink/manual_tests/WebKitSite.webarchive
third_party/blink/manual_tests/accessibility/resources/AppletTest.class
third_party/blink/manual_tests/plugins/test.swf
@@ -13288,11 +13286,8 @@ third_party/hunspell/fuzz/bdict_corpus/en-US-7-1.bdic
@@ -13326,11 +13324,8 @@ third_party/hunspell/fuzz/bdict_corpus/en-US-7-1.bdic
third_party/hunspell/fuzz/bdict_corpus/en-US-8-0.bdic
third_party/hunspell/fuzz/bdict_corpus/f95048cdc0fc231dd712bad106578a9eeecd869b
third_party/hunspell/fuzz/bdict_corpus/fda69541054125551c41ab3e591e0482405ca2dc


+ 1
- 1
patches/series View File

@ -1,6 +1,6 @@
src-fix/android-rlz-fix-missing-variable.patch
src-fix/fix-redefinition-error.patch
src-fix/fix-null-mInstanceID.patch
src-fix/fix-closure-compiler-minify-error.patch
Vanadium/0020-disable-media-router-media-remoting-by-default.patch
Vanadium/0021-disable-media-router-by-default.patch
ungoogled-chromium-android/change-package-name-chromium.patch


+ 375
- 0
patches/src-fix/fix-closure-compiler-minify-error.patch View File

@ -0,0 +1,375 @@
description: prevent closure compiler from files not found error
author: Wengling Chen <[email protected]>
---
ui/webui/resources/js/assert.js | 6 +--
.../resources/js/cr/ui/focus_outline_manager.js | 2 +-
ui/webui/resources/js/i18n_behavior.js | 5 +--
ui/webui/resources/js/load_time_data.js | 7 +--
ui/webui/resources/js/parse_html_subset.js | 2 +-
ui/webui/resources/js/promise_resolver.js | 4 +-
ui/webui/resources/js/util.js | 52 ++++++++++------------
ui/webui/resources/js/web_ui_listener_behavior.js | 4 +-
8 files changed, 34 insertions(+), 48 deletions(-)
diff --git a/ui/webui/resources/js/assert.js b/ui/webui/resources/js/assert.js
--- a/ui/webui/resources/js/assert.js
+++ b/ui/webui/resources/js/assert.js
@@ -15,7 +15,7 @@
* @param {string=} opt_message A message to show on failure.
* @return {T} A non-null |condition|.
*/
-/* #export */ function assert(condition, opt_message) {
+function assert(condition, opt_message) {
if (!condition) {
let message = 'Assertion failed';
if (opt_message) {
@@ -57,7 +57,7 @@
*
* @param {string=} opt_message A message to show when this is hit.
*/
-/* #export */ function assertNotReached(opt_message) {
+function assertNotReached(opt_message) {
assert(false, opt_message || 'Unreachable code hit');
}
@@ -68,7 +68,7 @@
* @return {T}
* @template T
*/
-/* #export */ function assertInstanceof(value, type, opt_message) {
+function assertInstanceof(value, type, opt_message) {
// We don't use assert immediately here so that we avoid constructing an error
// message if we don't have to.
if (!(value instanceof type)) {
diff --git a/ui/webui/resources/js/cr/ui/focus_outline_manager.js b/ui/webui/resources/js/cr/ui/focus_outline_manager.js
--- a/ui/webui/resources/js/cr/ui/focus_outline_manager.js
+++ b/ui/webui/resources/js/cr/ui/focus_outline_manager.js
@@ -27,7 +27,7 @@ cr.define('cr.ui', function() {
* it.
*
*/
- /* #export */ class FocusOutlineManager {
+ class FocusOutlineManager {
/**
* @param {!Document} doc The document to attach the focus outline manager
* to.
diff --git a/ui/webui/resources/js/i18n_behavior.js b/ui/webui/resources/js/i18n_behavior.js
--- a/ui/webui/resources/js/i18n_behavior.js
+++ b/ui/webui/resources/js/i18n_behavior.js
@@ -10,11 +10,8 @@
* handled by a C++ templatizer.
*/
-// #import {parseHtmlSubset} from './parse_html_subset.m.js';
-// #import {loadTimeData, SanitizeInnerHtmlOpts} from './load_time_data.m.js';
-
/** @polymerBehavior */
-/* #export */ const I18nBehavior = {
+const I18nBehavior = {
properties: {
/**
* The language the UI is presented in. Used to signal dynamic language
diff --git a/ui/webui/resources/js/load_time_data.js b/ui/webui/resources/js/load_time_data.js
--- a/ui/webui/resources/js/load_time_data.js
+++ b/ui/webui/resources/js/load_time_data.js
@@ -14,9 +14,6 @@
* change if the page is re-opened later.
*/
-// #import {assert} from './assert.m.js';
-// #import {parseHtmlSubset} from './parse_html_subset.m.js';
-
/**
* @typedef {{
* substitutions: (Array<string>|undefined),
@@ -24,10 +21,10 @@
* tags: (Array<string>|undefined),
* }}
*/
-/* #export */ let SanitizeInnerHtmlOpts;
+let SanitizeInnerHtmlOpts;
// eslint-disable-next-line no-var
-/* #export */ /** @type {!LoadTimeData} */ var loadTimeData;
+/** @type {!LoadTimeData} */ var loadTimeData;
// Expose this type globally as a temporary work around until
// https://github.com/google/closure-compiler/issues/544 is fixed.
diff --git a/ui/webui/resources/js/parse_html_subset.js b/ui/webui/resources/js/parse_html_subset.js
--- a/ui/webui/resources/js/parse_html_subset.js
+++ b/ui/webui/resources/js/parse_html_subset.js
@@ -12,7 +12,7 @@
* @throws {Error} In case of non supported markup.
* @return {DocumentFragment} A document fragment containing the DOM tree.
*/
-/* #export */ const parseHtmlSubset = (function() {
+const parseHtmlSubset = (function() {
'use strict';
const allowedAttributes = {
diff --git a/ui/webui/resources/js/promise_resolver.js b/ui/webui/resources/js/promise_resolver.js
--- a/ui/webui/resources/js/promise_resolver.js
+++ b/ui/webui/resources/js/promise_resolver.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// #import {assertNotReached} from './assert.m.js';
-
/**
* @fileoverview PromiseResolver is a helper class that allows creating a
* Promise that will be fulfilled (resolved or rejected) some time later.
@@ -20,7 +18,7 @@
/** @template T */
// eslint-disable-next-line no-var
-/* #export */ var PromiseResolver = class {
+var PromiseResolver = class {
constructor() {
/** @private {function(T=): void} */
this.resolve_;
diff --git a/ui/webui/resources/js/util.js b/ui/webui/resources/js/util.js
--- a/ui/webui/resources/js/util.js
+++ b/ui/webui/resources/js/util.js
@@ -2,16 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// #import {assertInstanceof} from './assert.m.js';
-// #import {dispatchSimpleEvent} from './cr.m.js';
-// <include src="assert.js">
-
/**
* Alias for document.getElementById. Found elements must be HTMLElements.
* @param {string} id The ID of the element to find.
* @return {HTMLElement} The found element or null if not found.
*/
-/* #export */ function $(id) {
+function $(id) {
// Disable getElementById restriction here, since we are instructing other
// places to re-use the $() that is defined here.
// eslint-disable-next-line no-restricted-properties
@@ -26,7 +22,7 @@
* @param {string} id The ID of the element to find.
* @return {Element} The found element or null if not found.
*/
-/* #export */ function getSVGElement(id) {
+function getSVGElement(id) {
// Disable getElementById restriction here, since it is not suitable for SVG
// elements.
// eslint-disable-next-line no-restricted-properties
@@ -38,7 +34,7 @@
* @return {?Element} The currently focused element (including elements that are
* behind a shadow root), or null if nothing is focused.
*/
-/* #export */ function getDeepActiveElement() {
+function getDeepActiveElement() {
let a = document.activeElement;
while (a && a.shadowRoot && a.shadowRoot.activeElement) {
a = a.shadowRoot.activeElement;
@@ -55,7 +51,7 @@
* other users. It's removed right away so it doesn't clutter the DOM.
* @param {string} msg The text to be pronounced.
*/
-/* #export */ function announceAccessibleMessage(msg) {
+function announceAccessibleMessage(msg) {
const element = document.createElement('div');
element.setAttribute('aria-live', 'polite');
element.style.position = 'fixed';
@@ -74,7 +70,7 @@
* @param {Location} location The URL to generate the CSS url for.
* @return {Object} Dictionary containing name value pairs for URL
*/
-/* #export */ function parseQueryParams(location) {
+function parseQueryParams(location) {
const params = {};
const query = unescape(location.search.substring(1));
const vars = query.split('&');
@@ -93,7 +89,7 @@
* @param {string} value The query parameter value.
* @return {string} The constructed new URL.
*/
-/* #export */ function setQueryParam(location, key, value) {
+function setQueryParam(location, key, value) {
const query = parseQueryParams(location);
query[encodeURIComponent(key)] = encodeURIComponent(value);
@@ -110,7 +106,7 @@
* @param {string} className A class to search for.
* @return {Element} A node with class of |className| or null if none is found.
*/
-/* #export */ function findAncestorByClass(el, className) {
+function findAncestorByClass(el, className) {
return /** @type {Element} */ (findAncestor(el, function(el) {
return el.classList && el.classList.contains(className);
}));
@@ -123,7 +119,7 @@
* nodes.
* @return {Node} The found ancestor or null if not found.
*/
-/* #export */ function findAncestor(node, predicate) {
+function findAncestor(node, predicate) {
let last = false;
while (node != null && !(last = predicate(node))) {
node = node.parentNode;
@@ -139,7 +135,7 @@
* @param {function(Event):boolean=} opt_allowDragStart Unless this function
* is defined and returns true, the ondragstart event will be surpressed.
*/
-/* #export */ function disableTextSelectAndDrag(
+function disableTextSelectAndDrag(
opt_allowSelectStart, opt_allowDragStart) {
// Disable text selection.
document.onselectstart = function(e) {
@@ -160,7 +156,7 @@
* Check the directionality of the page.
* @return {boolean} True if Chrome is running an RTL UI.
*/
-/* #export */ function isRTL() {
+function isRTL() {
return document.documentElement.dir == 'rtl';
}
@@ -171,7 +167,7 @@
* @param {string} id The identifier name.
* @return {!HTMLElement} the Element.
*/
-/* #export */ function getRequiredElement(id) {
+function getRequiredElement(id) {
return assertInstanceof(
$(id), HTMLElement, 'Missing required element: ' + id);
}
@@ -185,7 +181,7 @@
* context object for querySelector.
* @return {!HTMLElement} the Element.
*/
-/* #export */ function queryRequiredElement(selectors, opt_context) {
+function queryRequiredElement(selectors, opt_context) {
const element = (opt_context || document).querySelector(selectors);
return assertInstanceof(
element, HTMLElement, 'Missing required element: ' + selectors);
@@ -248,7 +244,7 @@
* @param {string} value The value of the param.
* @return {string} The new URL.
*/
-/* #export */ function appendParam(url, key, value) {
+function appendParam(url, key, value) {
const param = encodeURIComponent(key) + '=' + encodeURIComponent(value);
if (url.indexOf('?') == -1) {
@@ -263,7 +259,7 @@
* @param {string} className The class name to use.
* @return {Element} The created element.
*/
-/* #export */ function createElementWithClassName(type, className) {
+function createElementWithClassName(type, className) {
const elm = document.createElement(type);
elm.className = className;
return elm;
@@ -278,7 +274,7 @@
* transitionend to happen. If not specified, it is fetched from |el|
* using the transitionDuration style value.
*/
-/* #export */ function ensureTransitionEndEvent(el, opt_timeOut) {
+function ensureTransitionEndEvent(el, opt_timeOut) {
if (opt_timeOut === undefined) {
const style = getComputedStyle(el);
opt_timeOut = parseFloat(style.transitionDuration) * 1000;
@@ -305,7 +301,7 @@
* queried from.
* @return {number} The Y document scroll offset.
*/
-/* #export */ function scrollTopForDocument(doc) {
+function scrollTopForDocument(doc) {
return doc.documentElement.scrollTop || doc.body.scrollTop;
}
@@ -315,7 +311,7 @@
* queried from.
* @param {number} value The target Y scroll offset.
*/
-/* #export */ function setScrollTopForDocument(doc, value) {
+function setScrollTopForDocument(doc, value) {
doc.documentElement.scrollTop = doc.body.scrollTop = value;
}
@@ -325,7 +321,7 @@
* queried from.
* @return {number} The X document scroll offset.
*/
-/* #export */ function scrollLeftForDocument(doc) {
+function scrollLeftForDocument(doc) {
return doc.documentElement.scrollLeft || doc.body.scrollLeft;
}
@@ -335,7 +331,7 @@
* queried from.
* @param {number} value The target X scroll offset.
*/
-/* #export */ function setScrollLeftForDocument(doc, value) {
+function setScrollLeftForDocument(doc, value) {
doc.documentElement.scrollLeft = doc.body.scrollLeft = value;
}
@@ -344,7 +340,7 @@
* @param {string} original The original string.
* @return {string} The string with all the characters mentioned above replaced.
*/
-/* #export */ function HTMLEscape(original) {
+function HTMLEscape(original) {
return original.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
@@ -361,7 +357,7 @@
* |maxLength|. Otherwise the first |maxLength| - 1 characters with '...'
* appended.
*/
-/* #export */ function elide(original, maxLength) {
+function elide(original, maxLength) {
if (original.length <= maxLength) {
return original;
}
@@ -373,7 +369,7 @@
* @param {string} str The source string.
* @return {string} The escaped string.
*/
-/* #export */ function quoteString(str) {
+function quoteString(str) {
return str.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, '\\$1');
}
@@ -386,7 +382,7 @@
* @param {function(!Event)} callback Called at most once. The
* optional return value is passed on by the listener.
*/
-/* #export */ function listenOnce(target, eventNames, callback) {
+function listenOnce(target, eventNames, callback) {
if (!Array.isArray(eventNames)) {
eventNames = eventNames.split(/ +/);
}
@@ -511,7 +507,7 @@ if (!('key' in KeyboardEvent.prototype)) {
* @param {!Event} e
* @return {boolean} Whether a modifier key was down when processing |e|.
*/
-/* #export */ function hasKeyModifiers(e) {
+function hasKeyModifiers(e) {
return !!(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey);
}
diff --git a/ui/webui/resources/js/web_ui_listener_behavior.js b/ui/webui/resources/js/web_ui_listener_behavior.js
--- a/ui/webui/resources/js/web_ui_listener_behavior.js
+++ b/ui/webui/resources/js/web_ui_listener_behavior.js
@@ -7,11 +7,9 @@
* automatically remove WebUI listeners when detached.
*/
-// #import {addWebUIListener, removeWebUIListener} from './cr.m.js';
-
/** @polymerBehavior */
// eslint-disable-next-line no-var
-/* #export */ var WebUIListenerBehavior = {
+var WebUIListenerBehavior = {
properties: {
/**
* Holds WebUI listeners that need to be removed when this element is

+ 0
- 40
patches/src-fix/fix-redefinition-error.patch View File

@ -1,40 +0,0 @@
Fix a redefinition error in unnamed namespace.
author: Wengling Chen <[email protected]>
diff --git a/chrome/browser/android/favicon_helper.cc b/chrome/browser/android/favicon_helper.cc
--- a/chrome/browser/android/favicon_helper.cc
+++ b/chrome/browser/android/favicon_helper.cc
@@ -80,17 +80,13 @@ void OnEnsureIconIsAvailableFinished(
env, j_availability_callback, newly_available);
}
-sync_sessions::OpenTabsUIDelegate* GetOpenTabsUIDelegate(Profile* profile) {
- sync_sessions::SessionSyncService* session_sync_service =
- SessionSyncServiceFactory::GetInstance()->GetForProfile(profile);
- DCHECK(session_sync_service);
- return session_sync_service->GetOpenTabsUIDelegate();
-}
-
scoped_refptr<base::RefCountedMemory> GetSyncedFaviconForPageURL(
Profile* profile,
const GURL& page_url) {
- sync_sessions::OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(profile);
+ sync_sessions::SessionSyncService* session_sync_service =
+ SessionSyncServiceFactory::GetInstance()->GetForProfile(profile);
+ DCHECK(session_sync_service);
+ sync_sessions::OpenTabsUIDelegate* open_tabs = session_sync_service->GetOpenTabsUIDelegate();
return open_tabs ? open_tabs->GetSyncedFaviconForPageURL(page_url.spec())
: nullptr;
}
@@ -173,7 +169,10 @@ jboolean FaviconHelper::GetForeignFaviconImageForURL(
GURL page_url(ConvertJavaStringToUTF8(env, j_page_url));
- sync_sessions::OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(profile);
+ sync_sessions::SessionSyncService* session_sync_service =
+ SessionSyncServiceFactory::GetInstance()->GetForProfile(profile);
+ DCHECK(session_sync_service);
+ sync_sessions::OpenTabsUIDelegate* open_tabs = session_sync_service->GetOpenTabsUIDelegate();
// TODO(victorvianna): Consider passing icon types to the API.
favicon_request_handler_.GetRawFaviconForPageURL(
page_url, static_cast<int>(j_desired_size_in_pixel),

+ 9
- 9
patches/ungoogled-chromium-android/change-package-name-chromium.patch View File

@ -9,17 +9,17 @@ author: Wengling Chen <[email protected]>
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -42,8 +42,8 @@ if (dfmify_devtools) {
import("//chrome/android/features/devtools/devtools_module_tmpl.gni")
}
@@ -31,8 +31,8 @@ import("java_sources.gni")
import("static_initializers.gni")
import("trichrome.gni")
-manifest_package = "org.chromium.chrome"
-test_manifest_package = "org.chromium.chrome.tests"
+manifest_package = "org.ungoogled.chromium"
+test_manifest_package = "org.ungoogled.chromium.tests"
-chrome_public_manifest_package = "org.chromium.chrome"
-chrome_public_test_manifest_package = "org.chromium.chrome.tests"
+chrome_public_manifest_package = "org.ungoogled.chromium"
+chrome_public_test_manifest_package = "org.ungoogled.chromium.tests"
chrome_public_jinja_variables = default_chrome_public_jinja_variables +
[ "manifest_package=$manifest_package" ]
chrome_public_jinja_variables =
default_chrome_public_jinja_variables +
diff --git a/chrome/android/java/res_chromium/values/channel_constants.xml b/chrome/android/java/res_chromium/values/channel_constants.xml
--- a/chrome/android/java/res_chromium/values/channel_constants.xml
+++ b/chrome/android/java/res_chromium/values/channel_constants.xml


+ 1
- 1
patches/ungoogled-chromium-android/disable-context-search-by-default.patch View File

@ -8,7 +8,7 @@ author: Wengling Chen <[email protected]>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
@@ -419,7 +419,7 @@ public class PrefServiceBridge {
@@ -412,7 +412,7 @@ public class PrefServiceBridge {
* @return Whether the Contextual Search feature was disabled by the user explicitly.
*/
public boolean isContextualSearchDisabled() {


+ 5
- 5
patches/ungoogled-chromium-android/remove-gcm-client.patch View File

@ -17,7 +17,7 @@ author: Wengling Chen <[email protected]>
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -361,7 +361,6 @@ android_library("chrome_java") {
@@ -368,7 +368,6 @@ android_library("chrome_java") {
"//third_party/android_deps:com_google_protobuf_protobuf_lite_java",
"//third_party/android_deps:javax_inject_javax_inject_java",
"//third_party/android_media:android_media_java",
@ -55,7 +55,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/In
diff --git a/components/gcm_driver/android/BUILD.gn b/components/gcm_driver/android/BUILD.gn
--- a/components/gcm_driver/android/BUILD.gn
+++ b/components/gcm_driver/android/BUILD.gn
@@ -15,7 +15,6 @@ android_library("gcm_driver_java") {
@@ -14,7 +14,6 @@ android_library("gcm_driver_java") {
deps = [
"//base:base_java",
"//content/public/android:content_java",
@ -84,9 +84,9 @@ diff --git a/third_party/android_sdk/BUILD.gn b/third_party/android_sdk/BUILD.gn
- android_java_prebuilt("android_gcm_java") {
- jar_path = "//third_party/android_sdk/public/extras/google/gcm/gcm-client/dist/gcm.jar"
- }
java_prebuilt("emma_device_java") {
jar_path = "//third_party/android_sdk/public/tools/lib/emma_device.jar"
include_java_resources = true
# The current version of //third_party/byte_buddy relies on an older
# version of dx.
diff --git a/third_party/cacheinvalidation/BUILD.gn b/third_party/cacheinvalidation/BUILD.gn
--- a/third_party/cacheinvalidation/BUILD.gn
+++ b/third_party/cacheinvalidation/BUILD.gn


+ 5
- 5
patches/ungoogled-chromium-android/remove-gms-auth.patch View File

@ -17,7 +17,7 @@ author: Wengling Chen <[email protected]>
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -263,7 +263,6 @@ android_library("chrome_java") {
@@ -265,7 +265,6 @@ android_library("chrome_java") {
":thumbnail_cache_entry_proto_java",
":update_proto_java",
":usage_stats_proto_java",
@ -66,7 +66,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHe
diff --git a/components/background_task_scheduler/BUILD.gn b/components/background_task_scheduler/BUILD.gn
--- a/components/background_task_scheduler/BUILD.gn
+++ b/components/background_task_scheduler/BUILD.gn
@@ -93,7 +93,6 @@ if (is_android) {
@@ -98,7 +98,6 @@ if (is_android) {
deps = [
":background_task_scheduler_java",
@ -77,7 +77,7 @@ diff --git a/components/background_task_scheduler/BUILD.gn b/components/backgrou
diff --git a/components/signin/core/browser/android/BUILD.gn b/components/signin/core/browser/android/BUILD.gn
--- a/components/signin/core/browser/android/BUILD.gn
+++ b/components/signin/core/browser/android/BUILD.gn
@@ -16,7 +16,6 @@ generate_jni("jni_headers") {
@@ -15,7 +15,6 @@ generate_jni("jni_headers") {
android_library("java") {
deps = [
@ -119,7 +119,7 @@ diff --git a/components/signin/core/browser/android/java/src/org/chromium/compon
*/
public boolean canBeUsed() {
- // TODO(http://crbug.com/577190): Remove StrictMode override.
- try (StrictModeContext unused = StrictModeContext.allowDiskWrites()) {
- try (StrictModeContext ignored = StrictModeContext.allowDiskWrites()) {
- int resultCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
- ContextUtils.getApplicationContext());
- return resultCode == ConnectionResult.SUCCESS;
@ -307,7 +307,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/SmsRec
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -301,50 +301,6 @@ android_aar_prebuilt("com_android_support_support_v4_java") {
@@ -315,50 +315,6 @@ android_aar_prebuilt("com_android_support_support_v4_java") {
]
}


+ 43
- 70
patches/ungoogled-chromium-android/remove-gms-base-tasks.patch View File

@ -9,7 +9,7 @@ author: Wengling Chen <[email protected]>
.../src/org/chromium/chrome/browser/AppHooks.java | 14 +---
.../chromium/chrome/browser/ChromeVersionInfo.java | 12 +---
.../browser/component_updater/UpdateScheduler.java | 8 +--
.../browser/externalauth/ExternalAuthUtils.java | 15 ++--
.../browser/externalauth/ExternalAuthUtils.java | 14 ++--
.../externalauth/UserRecoverableErrorHandler.java | 7 --
.../browser/gcore/ChromeGoogleApiClientImpl.java | 25 +------
.../browser/gcore/GoogleApiClientHelper.java | 82 +---------------------
@ -25,16 +25,15 @@ author: Wengling Chen <[email protected]>
services/BUILD.gn | 4 --
services/device/geolocation/BUILD.gn | 2 -
services/shape_detection/BUILD.gn | 2 -
.../shape_detection/FaceDetectionProviderImpl.java | 8 +--
third_party/android_deps/BUILD.gn | 38 ----------
third_party/cacheinvalidation/BUILD.gn | 1 -
third_party/robolectric/BUILD.gn | 2 -
27 files changed, 18 insertions(+), 268 deletions(-)
26 files changed, 17 insertions(+), 260 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -263,9 +263,6 @@ android_library("chrome_java") {
@@ -265,9 +265,6 @@ android_library("chrome_java") {
":thumbnail_cache_entry_proto_java",
":update_proto_java",
":usage_stats_proto_java",
@ -44,7 +43,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"//base:base_java",
"//base:jni_java",
"//chrome/android/features/keyboard_accessory:public_java",
@@ -632,8 +629,6 @@ junit_binary("chrome_junit_tests") {
@@ -665,8 +662,6 @@ junit_binary("chrome_junit_tests") {
":chrome_java",
":chrome_junit_test_support",
":partner_location_descriptor_proto_java",
@ -53,7 +52,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
@@ -728,9 +723,6 @@ android_library("chrome_test_java") {
@@ -761,9 +756,6 @@ android_library("chrome_test_java") {
":browser_java_test_support",
":chrome_test_util_java",
":partner_location_descriptor_proto_java",
@ -102,7 +101,7 @@ diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/b
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -865,15 +865,6 @@ by a child template that "extends" this file.
@@ -875,15 +875,6 @@ by a child template that "extends" this file.
</intent-filter>
</activity>
@ -131,7 +130,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java b
import org.chromium.base.Callback;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
@@ -409,16 +406,7 @@ public abstract class AppHooks {
@@ -419,16 +416,7 @@ public abstract class AppHooks {
* same as {@link GoogleApiAvailability#isGooglePlayServicesAvailable()}.
*/
public int isGoogleApiAvailableWithMinApkVersion(int minApkVersion) {
@ -212,7 +211,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/component_updat
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java
@@ -15,9 +15,6 @@ import android.os.SystemClock;
@@ -13,9 +13,6 @@ import android.os.Binder;
import android.support.annotation.WorkerThread;
import android.text.TextUtils;
@ -222,7 +221,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/Ex
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
@@ -165,9 +162,7 @@ public class ExternalAuthUtils {
@@ -157,9 +154,7 @@ public class ExternalAuthUtils {
* when it is updating.
*/
public boolean isGooglePlayServicesMissing(final Context context) {
@ -233,25 +232,24 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/Ex
}
/**
@@ -190,7 +185,6 @@ public class ExternalAuthUtils {
@@ -181,7 +176,6 @@ public class ExternalAuthUtils {
Context context = ContextUtils.getApplicationContext();
final int resultCode = checkGooglePlayServicesAvailable(context);
recordConnectionResult(resultCode);
- if (resultCode == ConnectionResult.SUCCESS) return true;
// resultCode is some kind of error.
Log.v(TAG, "Unable to use Google Play Services: %s", describeError(resultCode));
if (isUserRecoverableError(resultCode)) {
@@ -271,8 +265,7 @@ public class ExternalAuthUtils {
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
try {
long time = SystemClock.elapsedRealtime();
- int isAvailable =
- GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
+ int isAvailable = 1; /*SERVICE_MISSING*/
mRegistrationTimeHistogramSample.record(SystemClock.elapsedRealtime() - time);
return isAvailable;
} finally {
@@ -288,7 +281,7 @@ public class ExternalAuthUtils {
@@ -251,7 +245,7 @@ public class ExternalAuthUtils {
protected int checkGooglePlayServicesAvailable(final Context context) {
// TODO(crbug.com/577190): Temporarily allowing disk access until more permanent fix is in.
try (StrictModeContext ignored = StrictModeContext.allowDiskWrites()) {
- return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
+ return 1; /*SERVICE_MISSING*/
}
}
@@ -263,7 +257,7 @@ public class ExternalAuthUtils {
* @return true If the code represents a user-recoverable error
*/
protected boolean isUserRecoverableError(final int errorCode) {
@ -260,7 +258,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/Ex
}
/**
@@ -298,6 +291,6 @@ public class ExternalAuthUtils {
@@ -273,6 +267,6 @@ public class ExternalAuthUtils {
* @return a textual description of the error code
*/
protected String describeError(final int errorCode) {
@ -271,24 +269,24 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/Ex
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java
@@ -10,8 +10,6 @@ import android.content.Context;
@@ -9,8 +9,6 @@ import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.annotation.IntDef;
-import com.google.android.gms.common.GoogleApiAvailability;
-
import org.chromium.base.ThreadUtils;
import org.chromium.base.metrics.CachedMetrics.ActionEvent;
import org.chromium.base.metrics.CachedMetrics.EnumeratedHistogramSample;
@@ -120,7 +118,6 @@ public abstract class UserRecoverableErrorHandler {
sErrorHandlerActionHistogramSample.record(ErrorHandlerAction.IGNORED_AS_REDUNDANT);
@@ -97,7 +95,6 @@ public abstract class UserRecoverableErrorHandler {
if (!sNotificationShown.getAndSet(true)) {
return;
}
- GoogleApiAvailability.getInstance().showErrorNotification(context, errorCode);
sErrorHandlerActionHistogramSample.record(ErrorHandlerAction.SYSTEM_NOTIFICATION);
}
}
@@ -214,11 +211,7 @@ public abstract class UserRecoverableErrorHandler {
@@ -190,11 +187,7 @@ public abstract class UserRecoverableErrorHandler {
cancelDialog();
}
if (mDialog == null) {
@ -538,7 +536,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateSta
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java
@@ -12,8 +12,6 @@ import android.os.Build;
@@ -11,8 +11,6 @@ import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -560,7 +558,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/Pre
diff --git a/chrome/test/android/BUILD.gn b/chrome/test/android/BUILD.gn
--- a/chrome/test/android/BUILD.gn
+++ b/chrome/test/android/BUILD.gn
@@ -102,8 +102,6 @@ android_library("chrome_java_test_support") {
@@ -152,8 +152,6 @@ android_library("chrome_java_test_support") {
"javatests/src/org/chromium/chrome/test/util/TranslateUtil.java",
]
deps = [
@ -582,7 +580,7 @@ diff --git a/components/background_task_scheduler/BUILD.gn b/components/backgrou
"//base:base_java",
"//third_party/android_deps:com_android_support_support_annotations_java",
]
@@ -70,9 +67,6 @@ if (is_android) {
@@ -72,9 +69,6 @@ if (is_android) {
deps = [
":background_task_scheduler_java",
":background_task_scheduler_task_ids_java",
@ -591,8 +589,8 @@ diff --git a/components/background_task_scheduler/BUILD.gn b/components/backgrou
- "$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
"//base:base_java_test_support",
"//third_party/android_support_test_runner:runner_java",
@@ -93,9 +87,6 @@ if (is_android) {
"//content/public/test/android:content_java_test_support",
@@ -98,9 +92,6 @@ if (is_android) {
deps = [
":background_task_scheduler_java",
@ -605,7 +603,7 @@ diff --git a/components/background_task_scheduler/BUILD.gn b/components/backgrou
diff --git a/components/signin/core/browser/android/BUILD.gn b/components/signin/core/browser/android/BUILD.gn
--- a/components/signin/core/browser/android/BUILD.gn
+++ b/components/signin/core/browser/android/BUILD.gn
@@ -16,8 +16,6 @@ generate_jni("jni_headers") {
@@ -15,8 +15,6 @@ generate_jni("jni_headers") {
android_library("java") {
deps = [
@ -650,7 +648,7 @@ diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
diff --git a/device/BUILD.gn b/device/BUILD.gn
--- a/device/BUILD.gn
+++ b/device/BUILD.gn
@@ -381,8 +381,6 @@ if (is_android) {
@@ -380,8 +380,6 @@ if (is_android) {
junit_binary("device_junit_tests") {
java_files = [ "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadMappingsTest.java" ]
deps = [
@ -675,7 +673,7 @@ diff --git a/remoting/android/client_java_tmpl.gni b/remoting/android/client_jav
diff --git a/services/BUILD.gn b/services/BUILD.gn
--- a/services/BUILD.gn
+++ b/services/BUILD.gn
@@ -97,8 +97,6 @@ if (is_android) {
@@ -106,8 +106,6 @@ if (is_android) {
"shape_detection/android/junit/src/org/chromium/shape_detection/BitmapUtilsTest.java",
]
deps = [
@ -684,7 +682,7 @@ diff --git a/services/BUILD.gn b/services/BUILD.gn
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
@@ -126,8 +124,6 @@ if (is_android) {
@@ -135,8 +133,6 @@ if (is_android) {
"shape_detection/android/javatests/src/org/chromium/shape_detection/TextDetectionImplTest.java",
]
deps = [
@ -696,7 +694,7 @@ diff --git a/services/BUILD.gn b/services/BUILD.gn
diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn
--- a/services/device/geolocation/BUILD.gn
+++ b/services/device/geolocation/BUILD.gn
@@ -143,8 +143,6 @@ if (is_android) {
@@ -142,8 +142,6 @@ if (is_android) {
deps = [
":geolocation",
":geolocation_jni_headers",
@ -708,7 +706,7 @@ diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/
diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn
--- a/services/shape_detection/BUILD.gn
+++ b/services/shape_detection/BUILD.gn
@@ -97,8 +97,6 @@ if (is_android) {
@@ -96,8 +96,6 @@ if (is_android) {
]
deps = [
@ -717,35 +715,10 @@ diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.
"//base:base_java",
"//mojo/public/java:base_java",
"//mojo/public/java:bindings_java",
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
@@ -4,9 +4,6 @@
package org.chromium.shape_detection;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GoogleApiAvailability;
-
import org.chromium.base.ContextUtils;
import org.chromium.mojo.bindings.InterfaceRequest;
import org.chromium.mojo.system.MojoException;
@@ -24,10 +21,7 @@ public class FaceDetectionProviderImpl implements FaceDetectionProvider {
@Override
public void createFaceDetection(
InterfaceRequest<FaceDetection> request, FaceDetectorOptions options) {
- final boolean isGmsCoreSupported =
- GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
- ContextUtils.getApplicationContext())
- == ConnectionResult.SUCCESS;
+ final boolean isGmsCoreSupported = false;
if (isGmsCoreSupported) {
FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request);
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -301,44 +301,6 @@ android_aar_prebuilt("com_android_support_support_v4_java") {
@@ -315,44 +315,6 @@ android_aar_prebuilt("com_android_support_support_v4_java") {
]
}
@ -788,8 +761,8 @@ diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.
-}
-
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
android_aar_prebuilt("com_google_ar_core_java") {
aar_path = "libs/com_google_ar_core/core-1.8.0.aar"
java_prebuilt("com_google_dagger_dagger_java") {
jar_path = "libs/com_google_dagger_dagger/dagger-2.17.jar"
diff --git a/third_party/cacheinvalidation/BUILD.gn b/third_party/cacheinvalidation/BUILD.gn
--- a/third_party/cacheinvalidation/BUILD.gn
+++ b/third_party/cacheinvalidation/BUILD.gn


+ 7
- 7
patches/ungoogled-chromium-android/remove-gms-cast.patch View File

@ -28,7 +28,7 @@ author: Wengling Chen <[email protected]>
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -265,8 +265,6 @@ android_library("chrome_java") {
@@ -267,8 +267,6 @@ android_library("chrome_java") {
":usage_stats_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -37,7 +37,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"$google_play_services_package:google_play_services_fido_java",
"$google_play_services_package:google_play_services_iid_java",
"$google_play_services_package:google_play_services_tasks_java",
@@ -638,8 +636,6 @@ junit_binary("chrome_junit_tests") {
@@ -671,8 +669,6 @@ junit_binary("chrome_junit_tests") {
":partner_location_descriptor_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -46,7 +46,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"$google_play_services_package:google_play_services_fido_java",
"//base:base_java",
"//base:base_java_test_support",
@@ -737,8 +733,6 @@ android_library("chrome_test_java") {
@@ -770,8 +766,6 @@ android_library("chrome_test_java") {
":partner_location_descriptor_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -1415,7 +1415,7 @@ diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/b
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -191,12 +191,6 @@ by a child template that "extends" this file.
@@ -193,12 +193,6 @@ by a child template that "extends" this file.
android:theme="@android:style/Theme.Material.Light.Dialog.Alert" />
{% endif %}
@ -1428,7 +1428,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<!-- Note: All activities directly or indirectly derived from ChromeActivity
must specify android:hardwareAccelerated="false".
@@ -827,16 +821,6 @@ by a child template that "extends" this file.
@@ -835,16 +829,6 @@ by a child template that "extends" this file.
</intent-filter>
</activity>
@ -1445,7 +1445,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<!-- This activity is used to restart the main Chrome process. Should never be exported. -->
<activity android:name="org.chromium.chrome.browser.BrowserRestartActivity"
android:launchMode="singleInstance"
@@ -1229,18 +1213,6 @@ android:value="true" />
@@ -1237,18 +1221,6 @@ android:value="true" />
android:value="org.chromium.content_public.browser.SmartClipProvider"/>
{% block extra_application_definitions %}
@ -1478,7 +1478,7 @@ diff --git a/chrome/test/android/cast_emulator/BUILD.gn b/chrome/test/android/ca
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -327,38 +327,6 @@ android_aar_prebuilt("google_play_services_basement_java") {
@@ -341,38 +341,6 @@ android_aar_prebuilt("google_play_services_basement_java") {
input_jars_paths = [ "$android_sdk/optional/org.apache.http.legacy.jar" ]
}


+ 8
- 8
patches/ungoogled-chromium-android/remove-gms-fido-iid-instantapps-location.patch View File

@ -18,7 +18,7 @@ author: Wengling Chen <[email protected]>
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -265,8 +265,6 @@ android_library("chrome_java") {
@@ -267,8 +267,6 @@ android_library("chrome_java") {
":usage_stats_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -27,7 +27,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
"//base:jni_java",
@@ -636,7 +634,6 @@ junit_binary("chrome_junit_tests") {
@@ -669,7 +667,6 @@ junit_binary("chrome_junit_tests") {
":partner_location_descriptor_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -35,7 +35,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
@@ -733,8 +730,6 @@ android_library("chrome_test_java") {
@@ -766,8 +763,6 @@ android_library("chrome_test_java") {
":partner_location_descriptor_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -181,7 +181,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/Ins
diff --git a/components/gcm_driver/instance_id/android/BUILD.gn b/components/gcm_driver/instance_id/android/BUILD.gn
--- a/components/gcm_driver/instance_id/android/BUILD.gn
+++ b/components/gcm_driver/instance_id/android/BUILD.gn
@@ -20,7 +20,6 @@ generate_jni("test_support_jni_headers") {
@@ -18,7 +18,6 @@ generate_jni("test_support_jni_headers") {
android_library("instance_id_driver_java") {
deps = [
@ -189,7 +189,7 @@ diff --git a/components/gcm_driver/instance_id/android/BUILD.gn b/components/gcm
"//base:base_java",
"//components/gcm_driver/android:gcm_driver_java",
]
@@ -34,7 +33,6 @@ android_library("instance_id_driver_java") {
@@ -32,7 +31,6 @@ android_library("instance_id_driver_java") {
android_library("instance_id_driver_test_support_java") {
deps = [
":instance_id_driver_java",
@ -285,7 +285,7 @@ diff --git a/components/gcm_driver/instance_id/android/java/src/org/chromium/com
diff --git a/device/BUILD.gn b/device/BUILD.gn
--- a/device/BUILD.gn
+++ b/device/BUILD.gn
@@ -383,7 +383,6 @@ if (is_android) {
@@ -382,7 +382,6 @@ if (is_android) {
deps = [
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -296,7 +296,7 @@ diff --git a/device/BUILD.gn b/device/BUILD.gn
diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn
--- a/services/device/geolocation/BUILD.gn
+++ b/services/device/geolocation/BUILD.gn
@@ -145,7 +145,6 @@ if (is_android) {
@@ -144,7 +144,6 @@ if (is_android) {
":geolocation_jni_headers",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -457,7 +457,7 @@ diff --git a/services/device/geolocation/android/java/src/org/chromium/device/ge
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -327,64 +327,6 @@ android_aar_prebuilt("google_play_services_basement_java") {
@@ -341,64 +341,6 @@ android_aar_prebuilt("google_play_services_basement_java") {
input_jars_paths = [ "$android_sdk/optional/org.apache.http.legacy.jar" ]
}


+ 1
- 1
patches/ungoogled-chromium-android/remove-gms-flags-places-stats.patch View File

@ -8,7 +8,7 @@ author: Wengling Chen <[email protected]>
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -574,55 +574,6 @@ android_aar_prebuilt("com_android_support_transition_java") {
@@ -565,55 +565,6 @@ android_aar_prebuilt("com_android_support_transition_java") {
deps += [ ":com_android_support_support_fragment_java" ]
}


+ 62
- 33
patches/ungoogled-chromium-android/remove-gms-gcm.patch View File

@ -5,28 +5,28 @@ author: Wengling Chen <[email protected]>
---
chrome/android/BUILD.gn | 3 -
chrome/android/java/AndroidManifest.xml | 60 --------
.../chrome/browser/BackgroundSyncLauncher.java | 64 +-------
.../chrome/browser/ChromeBackgroundService.java | 96 +-----------
chrome/android/java/AndroidManifest.xml | 62 -------
.../chrome/browser/BackgroundSyncLauncher.java | 64 +------
.../chrome/browser/ChromeBackgroundService.java | 96 +----------
.../invalidation/InvalidationController.java | 8 +-
.../browser/ntp/snippets/SnippetsLauncher.java | 59 +-------
.../services/gcm/ChromeGcmListenerService.java | 58 +-------
.../browser/ntp/snippets/SnippetsLauncher.java | 59 +------
.../services/gcm/ChromeGcmListenerService.java | 58 +------
components/background_task_scheduler/BUILD.gn | 3 -
.../BackgroundTaskGcmTaskService.java | 53 +------
.../BackgroundTaskGcmTaskService.java | 59 +------
.../BackgroundTaskSchedulerFactory.java | 6 +-
.../BackgroundTaskSchedulerGcmNetworkManager.java | 164 +--------------------
.../BackgroundTaskSchedulerGcmNetworkManager.java | 184 +--------------------
third_party/android_deps/BUILD.gn | 15 --
third_party/cacheinvalidation/BUILD.gn | 1 -
.../client/android2/AndroidManifestUpdatedGcm.xml | 20 ---
.../android2/channel/AndroidGcmController.java | 42 +-----
.../android2/channel/AndroidGcmController.java | 42 +----
.../channel/AndroidInstanceIDListenerService.java | 13 +-
.../channel/GcmRegistrationTaskService.java | 89 +----------
17 files changed, 21 insertions(+), 733 deletions(-)
.../channel/GcmRegistrationTaskService.java | 89 +---------
17 files changed, 21 insertions(+), 761 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -269,7 +269,6 @@ android_library("chrome_java") {
@@ -271,7 +271,6 @@ android_library("chrome_java") {
"$google_play_services_package:google_play_services_cast_framework_java",
"$google_play_services_package:google_play_services_cast_java",
"$google_play_services_package:google_play_services_fido_java",
@ -34,7 +34,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"$google_play_services_package:google_play_services_iid_java",
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
@@ -742,7 +741,6 @@ android_library("chrome_test_java") {
@@ -775,7 +774,6 @@ android_library("chrome_test_java") {
"$google_play_services_package:google_play_services_cast_framework_java",
"$google_play_services_package:google_play_services_cast_java",
"$google_play_services_package:google_play_services_fido_java",
@ -42,7 +42,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"$google_play_services_package:google_play_services_iid_java",
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
@@ -1582,7 +1580,6 @@ android_library("browser_java_test_support") {
@@ -1523,7 +1521,6 @@ android_library("browser_java_test_support") {
]
deps = [
":chrome_java",
@ -53,7 +53,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -83,22 +83,17 @@ by a child template that "extends" this file.
@@ -85,22 +85,17 @@ by a child template that "extends" this file.
<permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
<permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" android:protectionLevel="signatureOrSystem" />
<permission android:name="{{ manifest_package }}.TOS_ACKED" android:protectionLevel="signatureOrSystem" />
@ -76,7 +76,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
@@ -1058,43 +1053,6 @@ by a child template that "extends" this file.
@@ -1059,45 +1054,6 @@ by a child template that "extends" this file.
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"
android:hardwareAccelerated="false" />
@ -112,6 +112,8 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
- </intent-filter>
- </service>
- <service android:name="org.chromium.chrome.browser.services.gcm.GCMBackgroundService"
- android:exported="false"/>
- <meta-data android:name="ipc.invalidation.ticl.gcm_upstream_service_class"
- android:value="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender" />
- <service android:name="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender"
@ -120,7 +122,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<!-- Notification service for sync. -->
<meta-data android:name="ipc.invalidation.ticl.listener_service_class"
android:value="org.chromium.chrome.browser.invalidation.ChromeInvalidationClientService"/>
@@ -1134,24 +1092,6 @@ by a child template that "extends" this file.
@@ -1137,24 +1093,6 @@ by a child template that "extends" this file.
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"/>
@ -523,7 +525,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/Sn
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
@@ -10,7 +10,6 @@ import android.os.Bundle;
@@ -11,7 +11,6 @@ import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
@ -531,13 +533,14 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/Ch
import com.google.ipc.invalidation.ticl.android2.channel.AndroidGcmController;
import org.chromium.base.ApplicationStatus;
@@ -33,62 +32,9 @@ import org.chromium.content_public.browser.UiThreadTaskTraits;
@@ -34,63 +33,10 @@ import org.chromium.content_public.browser.UiThreadTaskTraits;
/**
* Receives Downstream messages and status of upstream messages from GCM.
*/
-public class ChromeGcmListenerService extends GcmListenerService {
+public class ChromeGcmListenerService {
private static final String TAG = "ChromeGcmListener";
private static final String SHARING_APP_ID = "com.google.chrome.sharing.fcm";
- @Override
- public void onCreate() {
@ -593,9 +596,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/Ch
- }
-
/**
* If Chrome is backgrounded, messages coming from lazy subscriptions are
* persisted on disk and replayed next time Chrome is forgrounded. If Chrome is forgrounded or
@@ -149,8 +95,6 @@ public class ChromeGcmListenerService extends GcmListenerService {
* Returns if we deliver the GCMMessage with a background service by calling
* Context#startService. This will only work if Android has put us in a whitelist to allow
@@ -185,8 +131,6 @@ public class ChromeGcmListenerService extends GcmListenerService {
try {
ChromeBrowserInitializer.getInstance(applicationContext).handleSynchronousStartup();
@ -615,7 +618,7 @@ diff --git a/components/background_task_scheduler/BUILD.gn b/components/backgrou
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
"//third_party/android_deps:com_android_support_support_annotations_java",
@@ -73,7 +72,6 @@ if (is_android) {
@@ -75,7 +74,6 @@ if (is_android) {
":background_task_scheduler_task_ids_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -623,7 +626,7 @@ diff --git a/components/background_task_scheduler/BUILD.gn b/components/backgrou
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
"//base:base_java_test_support",
@@ -98,7 +96,6 @@ if (is_android) {
@@ -103,7 +101,6 @@ if (is_android) {
"$google_play_services_package:google_play_services_auth_base_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -645,7 +648,7 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
@@ -19,7 +15,7 @@ import java.util.concurrent.TimeUnit;
@@ -20,7 +16,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
/** Delegates calls out to various tasks that need to run in the background. */
@ -653,8 +656,8 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
+public class BackgroundTaskGcmTaskService {
private static final String TAG = "BkgrdTaskGcmTS";
/** Class that waits for the processing to be done. */
@@ -81,53 +77,6 @@ public class BackgroundTaskGcmTaskService extends GcmTaskService {
private BackgroundTaskSchedulerGcmNetworkManager.Clock mClock = System::currentTimeMillis;
@@ -89,59 +85,6 @@ public class BackgroundTaskGcmTaskService extends GcmTaskService {
}
}
@ -667,6 +670,12 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
- return GcmNetworkManager.RESULT_FAILURE;
- }
-
- Long deadlineTime =
- BackgroundTaskSchedulerGcmNetworkManager.getDeadlineTimeFromTaskParams(params);
- if (deadlineTime != null && mClock.currentTimeMillis() >= deadlineTime) {
- return GcmNetworkManager.RESULT_FAILURE;
- }
-
- final TaskParameters taskParams =
- BackgroundTaskSchedulerGcmNetworkManager.getTaskParametersFromTaskParams(params);
- final Waiter waiter = new Waiter(Waiter.MAX_TIMEOUT_SECONDS);
@ -750,10 +759,10 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
+class BackgroundTaskSchedulerGcmNetworkManager {
private static final String TAG = "BkgrdTaskSchedGcmNM";
@VisibleForTesting
@@ -34,160 +26,6 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
@VisibleForTesting
static final String BACKGROUND_TASK_EXTRAS_KEY = "_background_task_extras";
/** Delta time for expiration checks, after the end time. */
@@ -42,180 +34,6 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
sClock = clock;
}
- static BackgroundTask getBackgroundTaskFromTaskParams(@NonNull TaskParams taskParams) {
- String backgroundTaskClassName = getBackgroundTaskClassFromTaskParams(taskParams);
@ -766,6 +775,19 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
- return extras.getString(BACKGROUND_TASK_CLASS_KEY);
- }
-
- static Long getDeadlineTimeFromTaskParams(@NonNull TaskParams taskParams) {
- Bundle extras = taskParams.getExtras();
- if (extras == null || !extras.containsKey(BACKGROUND_TASK_DEADLINE_KEY)) {
- return null;
- }
- return extras.getLong(BACKGROUND_TASK_DEADLINE_KEY);
- }
-
- private static long getDeadlineTime(TaskInfo taskInfo) {
- long windowEndTimeMs = taskInfo.getOneOffInfo().getWindowEndTimeMs();
- return sClock.currentTimeMillis() + windowEndTimeMs;
- }
-
- /**
- * Retrieves the {@link TaskParameters} from the {@link TaskParams}, which are passed as
- * one of the keys. Only values valid for {@link android.os.BaseBundle} are supported, and other
@ -797,6 +819,9 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
- Bundle taskExtras = new Bundle();
- taskExtras.putString(
- BACKGROUND_TASK_CLASS_KEY, taskInfo.getBackgroundTaskClass().getName());
- if (!taskInfo.isPeriodic() && taskInfo.getOneOffInfo().expiresAfterWindowEndTime()) {
- taskExtras.putLong(BACKGROUND_TASK_DEADLINE_KEY, getDeadlineTime(taskInfo));
- }
- taskExtras.putBundle(BACKGROUND_TASK_EXTRAS_KEY, taskInfo.getExtras());
-
- Task.Builder builder;
@ -832,8 +857,12 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
- long windowStartSeconds = oneOffInfo.hasWindowStartTimeConstraint()
- ? TimeUnit.MILLISECONDS.toSeconds(oneOffInfo.getWindowStartTimeMs())
- : 0;
- builder.setExecutionWindow(windowStartSeconds,
- TimeUnit.MILLISECONDS.toSeconds(oneOffInfo.getWindowEndTimeMs()));
- long windowEndTimeMs = oneOffInfo.getWindowEndTimeMs();
- if (oneOffInfo.expiresAfterWindowEndTime()) {
- windowEndTimeMs += DEADLINE_DELTA_MS;
- }
- builder.setExecutionWindow(
- windowStartSeconds, TimeUnit.MILLISECONDS.toSeconds(windowEndTimeMs));
- return builder;
- }
-
@ -915,7 +944,7 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -417,21 +417,6 @@ android_aar_prebuilt("google_play_services_fido_java") {
@@ -431,21 +431,6 @@ android_aar_prebuilt("google_play_services_fido_java") {
strip_drawables = true
}


+ 128
- 35
patches/ungoogled-chromium-android/remove-gms-vision-clearcut-phenotype.patch View File

@ -4,18 +4,20 @@ author: Wengling Chen <[email protected]>
---
services/BUILD.gn | 4 -
services/shape_detection/BUILD.gn | 2 -
.../shape_detection/BarcodeDetectionImpl.java | 82 +-------------
.../BarcodeDetectionProviderImpl.java | 16 +--
.../shape_detection/BarcodeDetectionImpl.java | 114 +------------------
.../BarcodeDetectionProviderImpl.java | 18 +--
.../org/chromium/shape_detection/BitmapUtils.java | 12 --
.../shape_detection/FaceDetectionImplGmsCore.java | 122 +--------------------
.../shape_detection/FaceDetectionProviderImpl.java | 16 +--
.../shape_detection/InterfaceRegistrar.java | 5 -
.../shape_detection/TextDetectionImpl.java | 59 +---------
third_party/android_deps/BUILD.gn | 66 -----------
8 files changed, 8 insertions(+), 355 deletions(-)
10 files changed, 11 insertions(+), 407 deletions(-)
diff --git a/services/BUILD.gn b/services/BUILD.gn
--- a/services/BUILD.gn
+++ b/services/BUILD.gn
@@ -99,8 +99,6 @@ if (is_android) {
@@ -108,8 +108,6 @@ if (is_android) {
deps = [
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -24,7 +26,7 @@ diff --git a/services/BUILD.gn b/services/BUILD.gn
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
@@ -130,8 +128,6 @@ if (is_android) {
@@ -139,8 +137,6 @@ if (is_android) {
deps = [
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -36,7 +38,7 @@ diff --git a/services/BUILD.gn b/services/BUILD.gn
diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn
--- a/services/shape_detection/BUILD.gn
+++ b/services/shape_detection/BUILD.gn
@@ -99,8 +99,6 @@ if (is_android) {
@@ -98,8 +98,6 @@ if (is_android) {
deps = [
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
@ -59,26 +61,61 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.gfx.mojom.PointF;
@@ -28,63 +24,17 @@ import org.chromium.shape_detection.mojom.BarcodeFormat;
@@ -28,50 +24,7 @@ import org.chromium.shape_detection.mojom.BarcodeFormat;
public class BarcodeDetectionImpl implements BarcodeDetection {
private static final String TAG = "BarcodeDetectionImpl";
- private BarcodeDetector mBarcodeDetector;
-
public BarcodeDetectionImpl(BarcodeDetectorOptions options) {
- // TODO(mcasas): extract the barcode formats to hunt for out of
- // |options| and use them for building |mBarcodeDetector|.
- // https://crbug.com/582266.
- mBarcodeDetector =
- new BarcodeDetector.Builder(ContextUtils.getApplicationContext()).build();
- int formats = Barcode.ALL_FORMATS;
- if (options.formats != null && options.formats.length > 0) {
- formats = 0;
- // Keep this list in sync with the constants defined in
- // com.google.android.gms.vision.barcode.Barcode and the list of
- // supported formats in BarcodeDetectionProviderImpl.
- for (int i = 0; i < options.formats.length; ++i) {
- if (options.formats[i] == BarcodeFormat.AZTEC) {
- formats |= Barcode.AZTEC;
- } else if (options.formats[i] == BarcodeFormat.CODE_128) {
- formats |= Barcode.CODE_128;
- } else if (options.formats[i] == BarcodeFormat.CODE_39) {
- formats |= Barcode.CODE_39;
- } else if (options.formats[i] == BarcodeFormat.CODE_93) {
- formats |= Barcode.CODE_93;
- } else if (options.formats[i] == BarcodeFormat.CODABAR) {
- formats |= Barcode.CODABAR;
- } else if (options.formats[i] == BarcodeFormat.DATA_MATRIX) {
- formats |= Barcode.DATA_MATRIX;
- } else if (options.formats[i] == BarcodeFormat.EAN_13) {
- formats |= Barcode.EAN_13;
- } else if (options.formats[i] == BarcodeFormat.EAN_8) {
- formats |= Barcode.EAN_8;
- } else if (options.formats[i] == BarcodeFormat.ITF) {
- formats |= Barcode.ITF;
- } else if (options.formats[i] == BarcodeFormat.PDF417) {
- formats |= Barcode.PDF417;
- } else if (options.formats[i] == BarcodeFormat.QR_CODE) {
- formats |= Barcode.QR_CODE;
- } else if (options.formats[i] == BarcodeFormat.UPC_A) {
- formats |= Barcode.UPC_A;
- } else if (options.formats[i] == BarcodeFormat.UPC_E) {
- formats |= Barcode.UPC_E;
- } else {
- Log.e(TAG, "Unsupported barcode format hint: " + options.formats[i]);
- }
- }
- }
- mBarcodeDetector = new BarcodeDetector.Builder(ContextUtils.getApplicationContext())
- .setBarcodeFormats(formats)
- .build();
}
@Override
public void detect(org.chromium.skia.mojom.Bitmap bitmapData, DetectResponse callback) {
- // The vision library will be downloaded the first time the API is used
- // on the device; this happens "fast", but it might have not completed,
- // bail in this case. Also, the API was disabled between and v.9.0 and
- // v.9.2, see https://developers.google.com/android/guides/releases.
@@ -80,47 +33,12 @@ public class BarcodeDetectionImpl implements BarcodeDetection {
// on the device; this happens "fast", but it might have not completed,
// bail in this case. Also, the API was disabled between and v.9.0 and
// v.9.2, see https://developers.google.com/android/guides/releases.
- if (!mBarcodeDetector.isOperational()) {
- Log.e(TAG, "BarcodeDetector is not operational");
- callback.call(new BarcodeDetectionResult[0]);
@ -125,7 +162,7 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect
}
@Override
@@ -93,34 +43,6 @@ public class BarcodeDetectionImpl implements BarcodeDetection {
@@ -129,34 +47,6 @@ public class BarcodeDetectionImpl implements BarcodeDetection {
}
private int toBarcodeFormat(int format) {
@ -143,9 +180,9 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect
- case Barcode.EAN_13:
- return BarcodeFormat.EAN_13;
- case Barcode.EAN_8:
- return BarcodeFormat.CODE_128;
- case Barcode.ITF:
- return BarcodeFormat.EAN_8;
- case Barcode.ITF:
- return BarcodeFormat.ITF;
- case Barcode.QR_CODE:
- return BarcodeFormat.QR_CODE;
- case Barcode.UPC_A:
@ -163,29 +200,30 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java
@@ -4,10 +4,6 @@
@@ -4,9 +4,6 @@
package org.chromium.shape_detection;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GoogleApiAvailability;
-import com.google.android.gms.vision.barcode.Barcode;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.mojo.bindings.InterfaceRequest;
@@ -33,10 +29,6 @@ public class BarcodeDetectionProviderImpl implements BarcodeDetectionProvider {
@Override
public void enumerateSupportedFormats(EnumerateSupportedFormatsResponse callback) {
- int[] supportedFormats = {Barcode.AZTEC, Barcode.CODE_128, Barcode.CODE_39, Barcode.CODE_93,
- Barcode.CODABAR, Barcode.DATA_MATRIX, Barcode.EAN_13, Barcode.EAN_8, Barcode.ITF,
- Barcode.PDF417, Barcode.QR_CODE, Barcode.UPC_A, Barcode.UPC_E};
@@ -36,12 +33,6 @@ public class BarcodeDetectionProviderImpl implements BarcodeDetectionProvider {
// Keep this list in sync with the constants defined in
// com.google.android.gms.vision.barcode.Barcode and the format hints
// supported by BarcodeDetectionImpl.
- int[] supportedFormats = {BarcodeFormat.AZTEC, BarcodeFormat.CODE_128,
- BarcodeFormat.CODE_39, BarcodeFormat.CODE_93, BarcodeFormat.CODABAR,
- BarcodeFormat.DATA_MATRIX, BarcodeFormat.EAN_13, BarcodeFormat.EAN_8,
- BarcodeFormat.ITF, BarcodeFormat.PDF417, BarcodeFormat.QR_CODE, BarcodeFormat.UPC_A,
- BarcodeFormat.UPC_E};
- callback.call(supportedFormats);
}
@Override
@@ -53,13 +45,7 @@ public class BarcodeDetectionProviderImpl implements BarcodeDetectionProvider {
@@ -58,13 +49,8 @@ public class BarcodeDetectionProviderImpl implements BarcodeDetectionProvider {
@Override
public BarcodeDetectionProvider createImpl() {
@ -196,6 +234,7 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect
- return null;
- }
- return new BarcodeDetectionProviderImpl();
+ Log.e(TAG, "Google Play Services not available");
+ return null;
}
}
@ -378,6 +417,60 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect
}
@Override
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
@@ -4,9 +4,6 @@
package org.chromium.shape_detection;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GoogleApiAvailability;
-
import org.chromium.base.ContextUtils;
import org.chromium.mojo.bindings.InterfaceRequest;
import org.chromium.mojo.system.MojoException;
@@ -24,16 +21,7 @@ public class FaceDetectionProviderImpl implements FaceDetectionProvider {
@Override
public void createFaceDetection(
InterfaceRequest<FaceDetection> request, FaceDetectorOptions options) {
- final boolean isGmsCoreSupported =
- GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
- ContextUtils.getApplicationContext())
- == ConnectionResult.SUCCESS;
-
- if (isGmsCoreSupported) {
- FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request);
- } else {
- FaceDetection.MANAGER.bind(new FaceDetectionImpl(options), request);
- }
+ FaceDetection.MANAGER.bind(new FaceDetectionImpl(options), request);
}
@Override
@@ -50,7 +38,7 @@ public class FaceDetectionProviderImpl implements FaceDetectionProvider {