Commit 4bf1a146 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

browser: Add bromite as submodule


Signed-off-by: Aayush Gupta's avatarAayush Gupta <theimpulson@e.email>
parent 9a6cae86
......@@ -7,6 +7,7 @@ stages:
variables:
CONTAINER_IMAGE: registry.gitlab.e.foundation:5000/$CI_PROJECT_PATH
GIT_SUBMODULE_STRATEGY: recursive
build-docker:
image: docker:19-git
......
[submodule "bromite"]
path = bromite
url = https://github.com/bromite/bromite/
Specific authors for Browser, the /e/ fork of Chromium/Bromite:
© ECORP SAS 2019 - Author: Romain Hunault
Note: original authors are not listed here. Please refer to the source code of the original project and/or the commit history for the complete list of authors.
\ No newline at end of file
This diff is collapsed.
# Frequently Asked Questions
## Does Google Sync/Translate/Data saver work?
No.
This is not a limitation of Bromite but of all Chromium-based projects in general, as general public is not allowed to use Google's APIs for free unless when using Chrome.
Additionally, these features would not be privacy-friendly.
## Does Bromite require root?
No.
## Is Bromite de-googled?
Yes, although this has not been verified (and hardly can be) under all situations; if you were to find connections to cloud-based services please report them via the issue tracker.
Bromite uses [ungoogled-chromium's python script](https://github.com/Eloston/ungoogled-chromium/blob/master/utils/domain_substitution.py) to disable URLs in the codebase since version `78.0.3904.93`.
Projects which follow a strict approach on this are [Iridium](https://iridiumbrowser.de/) and [Inox patchset](https://github.com/gcarq/inox-patchset).
## Does Bromite support DRM media?
Yes, in order to play protected/encrypted media content the browser will use Android's DRM media framework to automatically negotiate access (same as Chromium).
This means for example that requests to Android license servers will be performed (`www.googleapis.com`), see https://w3c.github.io/encrypted-media/#direct-individualization
To disable this functionality you should disable protected content playback from Site settings -> Multimedia.
## What is the SystemWebView?
It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
See also [the wiki page](https://github.com/bromite/bromite/wiki/Installing-SystemWebView) for community-contributed installation instructions.
Ad-blocking was present and always enabled in the SystemWebView from version `72.0.3626.120` till version `77.0.3865.104`, when it stopped working due to [upstream NetworkService changes](https://docs.google.com/document/d/1TZEuPvr2KAbP4_TZpuuwtEEArQsyAkc2HDu68l66YwU/edit?ts=598244df#heading=h.ougoi5i6508y).
## How to enable DNS-over-HTTPS?
See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
## Can you add HTTPS everywhere?
No.
We cannot add add-ons to Bromite (merely some features).
## Is Bromite on Play Store?
No, and this is unlikely to change. Many limitations apply for submissions there, including which ads are allowed to be blocked.
Bromite favors user freedom in software choice: the device is yours so you get to choose which software to run on it, end of the story.
## Is Bromite on F-Droid?
It is not on the official F-Droid repository and there are no (more) plans to submit it.
You can use F-Droid client to install and receive updates via [the official Bromite F-Droid repository](https://www.bromite.org/fdroid).
## Does Bromite support WebRTC?
Yes, since version 69. While the desktop version of Chromium has an option to disable it (video/audio site settings), the Android version cannot.
The WebRTC functionality has always been using safe defaults to prevent leaks (disabled multiple routes and non-proxied UDP).
## Using Bromite will favour the monopoly of the Chromium/Blink engine, why do you develop and maintain Bromite?
In short, to show what a Chromium-based engine could do **for the user** if the user experience and needs were the main focus of modern browser design.
For an Android browser using an alternative engine see [Fennec F-Droid](https://f-droid.org/en/packages/org.mozilla.fennec_fdroid/).
## Does Bromite support extensions?
No; Bromite will support extensions only if upstream (Chromium) does, or similarly another project maintains the patch and functionality.
## Why do push notifications not work on this website?
The [Chromium Blink engine](https://www.chromium.org/blink) uses [GCM](https://en.wikipedia.org/wiki/Google_Cloud_Messaging) to deliver messages
when websites use the [Push API](https://w3c.github.io/push-api/); this will not work in Bromite because cloud integrations are disabled (GCM in this case).
[ServiceWorker notifications](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification) do work instead since they use
[android.app.Notification](https://developer.android.com/guide/topics/ui/notifiers/notifications).
## Can PWAs be installed?
PWAs are only supported as home shortcuts; WebAPKs will not work because they are generated server-side on googleapis.com (which is not allowed in Bromite).
## Does Bromite support the Android autofill framework?
No; the only autofill available in Chromium browsers requires integration with the Play Store binary blobs.
Some apps use accessibility services as a workaround.
## Does Bromite support casting media content?
No; this would require Play Store binary blobs.
bromite @ 19bcbb30
Subproject commit 19bcbb3055cac8a8a778f89a8ea4123c6b4aea79
......@@ -8,7 +8,7 @@ ARCH=arm
function usage() {
cat << EOT
usage $0 [-hac]
OPTIONS
-h show this usage
-a target build archictecture (default: arm)
......@@ -29,10 +29,10 @@ function init() {
function checkout() {
if [ -z "${CHROMIUM_VERSION}" ] ; then
CHROMIUM_VERSION=$(head -n 1 "${ROOT_DIR}/CHANGELOG.md" | sed 's/# \(.*\)/\1/')
CHROMIUM_VERSION=$(head -n 1 "${ROOT_DIR}/bromite/CHANGELOG.md" | sed 's/# \(.*\)/\1/')
export CHROMIUM_VERSION
fi
echo ">> [$(date)] Use Chromium v${CHROMIUM_VERSION}"
git fetch --tags
......@@ -54,11 +54,11 @@ function setup() {
function patch() {
echo ">> [$(date)] Apply Bromite and /e/ patches"
mv "${ROOT_DIR}"/build/patches/e/* "${ROOT_DIR}"/build/patches/
PATCHES_LIST=$(cat "${ROOT_DIR}/build/bromite_patches_list.txt" "${ROOT_DIR}/build/e_patches_list.txt")
mv "${ROOT_DIR}"/build/patches/* "${ROOT_DIR}"/bromite/build/patches/
PATCHES_LIST=$(cat "${ROOT_DIR}/bromite/build/bromite_patches_list.txt" "${ROOT_DIR}/build/e_patches_list.txt")
for file in $PATCHES_LIST; do
echo " -> Apply $file"
git apply "${ROOT_DIR}/build/patches/$file"
git apply "${ROOT_DIR}/bromite/build/patches/$file"
echo " "
done
gclient runhooks
......@@ -67,7 +67,7 @@ function patch() {
function build() {
local out="out/${BUILDID}_${ARCH}"
echo ">> [$(date)] Build for ${ARCH}"
gn gen --args="$(cat "${ROOT_DIR}"/build/GN_ARGS) target_cpu=\"${ARCH}\" " "$out"
gn gen --args="$(cat "${ROOT_DIR}"/bromite/build/GN_ARGS) target_cpu=\"${ARCH}\" " "$out"
autoninja -C "$out" chrome_public_apk system_webview_apk
cp "$out/apks/ChromePublic.apk" "${ROOT_DIR}/apks/ChromePublic_$ARCH.apk"
cp "$out/apks/SystemWebView.apk" "${ROOT_DIR}/apks/SystemWebView_$ARCH.apk"
......
android_channel="stable"
blink_symbol_level=1
chrome_pgo_phase=0
dcheck_always_on=false
debuggable_apks=false
dfmify_dev_ui=false
disable_android_lint=true
disable_autofill_assistant_dfm=true
disable_tab_ui_dfm=true
enable_av1_decoder=true
enable_dav1d_decoder=true
enable_gvr_services=false
enable_hangout_services_extension=false
enable_iterator_debugging=false
enable_mdns=false
enable_mse_mpeg2ts_stream_parser=true
enable_nacl=false
enable_nacl_nonsfi=false
enable_platform_dolby_vision=true
enable_platform_hevc=true
enable_remoting=false
enable_reporting=true
enable_vr=false
exclude_unwind_tables=false
ffmpeg_branding="Chrome"
fieldtrial_testing_like_official_build=true
icu_use_data_file=true
is_component_build=false
is_debug=false
is_official_build=true
proprietary_codecs=true
rtc_build_examples=false
safe_browsing_mode=0
symbol_level=1
target_os="android"
use_debug_fission=true
use_errorprone_java_compiler=false
use_gnome_keyring=false
use_official_google_api_keys=false
use_rtti=false
use_sysroot=false
webview_includes_weblayer=false
Disable-third-party-cookies-by-default.patch
Restore-classic-new-tab-page.patch
Always-use-new-tab-page-for-default-home-page.patch
Always-allow-partner-customisation.patch
battery_status_service-disable-more-privacy-nightmares.patch
Battery-API-return-nothing.patch
updater-disable-updater-pings.patch
Remove-EV-certificates.patch
promo-disable-Google-promotion-fetching.patch
Disable-omission-of-URL-elements-in-Omnibox.patch
Modify-default-preferences.patch
Do-not-hide-component-extensions.patch
Do-not-store-passwords-by-default.patch
Disable-NTP-remote-suggestions-by-default.patch
Disable-references-to-fonts.googleapis.com.patch
Change-default-webRTC-policy-to-not-use-any-address.patch
Never-send-any-crash-upload-data.patch
Hide-send-reports-checkbox.patch
Never-fetch-popular-sites.patch
ungoogled-chromium-Disable-webRTC-log-uploader.patch
ungoogled-chromium-Disable-untraceable-URLs.patch
ungoogled-chromium-Disable-translate-integration.patch
ungoogled-chromium-Disable-profile-avatar.patch
ungoogled-chromium-Disable-intranet-redirect-detector.patch
ungoogled-chromium-Disable-Google-host-detection.patch
ungoogled-chromium-Disable-Gaia.patch
ungoogled-chromium-Disable-domain-reliability.patch
ungoogled-chromium-Disable-Network-Time-Tracker.patch
Disable-safe-browsing.patch
Skip-the-first-run-and-metrics.patch
Disable-all-promo-dialogs.patch
Remove-signin-and-data-saver-integrations.patch
Hide-passwords-manager-link.patch
Disable-Omaha-update-checks.patch
Disable-update-scheduler.patch
openH264-enable-ARM-ARM64-optimizations.patch
Switch-to-fstack-protector-strong.patch
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
build-remove-calling-untrusted-hooks.patch
AV1-codec-support.patch
Inject-scripts-for-AMP-tracking-ads-and-video.patch
Allow-playing-audio-in-background.patch
Add-flag-to-control-video-playback-resume-feature.patch
Open-YouTube-links-in-Bromite.patch
Add-exit-menu-item.patch
AudioBuffer-AnalyserNode-fp-mitigations.patch
Multiple-fingerprinting-mitigations.patch
Disable-metrics-on-all-I-O-threads.patch
Always-respect-async-dns-flag-regardless-of-SDK-version.patch
Add-flag-to-configure-maximum-connections-per-host.patch
Do-not-ignore-download-location-prompt-setting.patch
Add-bookmark-import-export-actions.patch
Add-an-always-incognito-mode.patch
Add-custom-tab-intents-privacy-option.patch
Add-option-to-not-persist-tabs-across-sessions.patch
Disable-fetching-of-all-field-trials.patch
Disable-seed-based-field-trials.patch
Disable-plugins-enumeration.patch
net-cert-increase-default-key-length-for-newly-generated-RSA-keys.patch
dns-send-IPv6-connectivity-probes-to-RIPE-DNS.patch
profile-resetter-do-not-tick-send-settings-by-default.patch
browser-ui-disable-warning-about-missing-API-keys.patch
autofill-disable-autofill-download-manager.patch
first_run-deactivate-autoupdate-globally.patch
translate-disable-fetching-of-translate-languages-from-server.patch
kill-TOS-and-metrics-opt-out.patch
kill-Vision.patch
kill-Location-fall-back-to-system.patch
kill-Auth.patch
Remove-binary-blob-integrations.patch
Remove-SMS-integration.patch
Do-not-compile-QR-code-sharing.patch
Allow-website-sign-in-without-account-sign-in.patch
Offer-builtin-autocomplete-for-chrome-flags.patch
Do-not-grant-notifications-to-default-search-engine.patch
Add-flag-to-disable-IPv6-probes.patch
Add-a-proxy-configuration-page.patch
Use-4-tile-rows-never-show-logo.patch
Disable-metrics-collection-for-NTP-tiles.patch
Enable-SPPI-for-devices-with-enough-memory.patch
Use-64-bit-WebView-processes.patch
prefs-disable-signinallowed-by-default.patch
prefs-always-prompt-for-download-directory-by-default.patch
Disable-offline-pages-in-the-downloads-home-to-be-opened-in-CCT-by-default.patch
disable-payment-support-by-default.patch
disable-background-sync-by-default.patch
disable-sensors-access-site-setting-by-default.patch
Disable-media-router-and-remoting-by-default.patch
Restore-Search-Ready-Omnibox-flag.patch
disable-AdsBlockedInfoBar.patch
Bromite-AdBlockUpdaterService.patch
Replace-DoH-probe-domain-with-RIPE-domain.patch
Increase-number-of-autocomplete-matches-from-5-to-10.patch
Disable-HEAD-requests-for-single-word-Omnibar-searches.patch
Disable-some-signed-exchange-features.patch
Add-flag-to-disable-WebGL.patch
DoH-secure-mode-by-default.patch
Reduce-HTTP-headers-in-DoH-requests-to-bare-minimum.patch
Revert-flags-remove-disable-pull-to-refresh-effect.patch
Use-dummy-DFM-installer.patch
Disable-feeds-support-by-default.patch
Disable-autofill-assistant-by-default.patch
Show-site-settings-for-cookies-javascript-and-ads.patch
Disable-DRM-media-origin-IDs-preprovisioning.patch
Disable-smart-selection-by-default.patch
Enable-user-agent-freeze-by-default.patch
disable-browser-autologin-by-default.patch
AImageReader-CFI-crash-mitigations.patch
Update-i18n-zh_CN-support.patch
Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch
Add-menu-item-to-view-source.patch
Enable-prefetch-privacy-changes-by-default.patch
Disable-support-for-RAR-files-inspection.patch
Add-history-support-in-incognito-mode.patch
Enable-darken-websites-checkbox-in-themes.patch
Remove-blocklisted-URLs-upon-bookmark-creation.patch
Disable-the-DIAL-repeating-discovery.patch
Block-qjz9zk-or-trk-requests.patch
Hardening-against-incognito-mode-detection.patch
Remove-weblayer-dependency-on-Play-Services.patch
Timezone-customization.patch
Move-some-account-settings-back-to-privacy-settings.patch
Restore-Simplified-NTP-launch.patch
Revert-the-removal-of-an-option-to-block-autoplay.patch
Disable-text-fragments-by-default.patch
disable-WebView-variations-support.patch
disable-autofill-server-communication-by-default.patch
ask-permission-to-play-protected-media-by-default.patch
Enable-network-isolation-features.patch
Revert-flags-remove-num-raster-threads.patch
webview-Hard-no-to-persistent-histograms.patch
Ignore-enterprise-policies-for-secure-DNS.patch
Add-menu-item-to-bookmark-all-tabs.patch
Add-flag-for-save-data-header.patch
Add-option-to-force-tablet-UI.patch
Make-all-favicon-requests-on-demand.patch
Add-Alt-D-hotkey-to-focus-address-bar.patch
Remove-offline-measurement-background-task.patch
User-agent-customization.patch
Add-AllowUserCertificates-flag.patch
Add-IsCleartextPermitted-flag.patch
Disable-RTCGetCurrentBrowsingContextMedia-by-default.patch
Disable-FLoC-by-default.patch
Unexpire-tab-groups-flags.patch
Add-flag-for-omnibox-autocomplete-filtering.patch
Enable-IntentBlockExternalFormRedirectsNoGesture-by-default.patch
Add-flag-to-disable-external-intent-requests.patch
Logcat-crash-reports-UI.patch
Add-support-for-ISupportHelpAndFeedback.patch
JIT-less-toggle.patch
API-level-21-prevent-crash-on-download.patch
Add-vibration-flag.patch
Automated-domain-substitution.patch
AV1-codec-support.patch
Switch-to-fstack-protector-strong.patch
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
Disable-feeds-support-by-default.patch
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 5 May 2020 07:22:20 +0200
Subject: AImageReader CFI crash mitigations
Revert "gpu/android: Remove setup for disabling AImageReader."
This reverts commit dcd5a39518246eb999f1cc63bf1ec95d93fd5b2f.
Revert "Remove flags to enable/disable AImageReader."
This reverts commit 463fa0f2e3b9e418bc26e2c8954463f0b0f76634.
Restore GPU bug blacklist for AImageReader on ARM and Qualcomm CPUs
Restore the AImageReader blacklist for ARM/Qualcomm chipsets which causes
crashes on Android 9 and 10 (at different code locations).
See discussions at:
* https://github.com/bromite/bromite/issues/445
* https://github.com/bromite/bromite/issues/814
* https://github.com/bromite/bromite/issues/1005
---
base/android/android_image_reader_compat.cc | 8 +++++++-
base/android/android_image_reader_compat.h | 4 ++++
chrome/browser/flag-metadata.json | 2 +-
gpu/config/gpu_driver_bug_list.json | 16 ++++++++++++++++
gpu/config/gpu_finch_features.cc | 5 +++++
gpu/config/gpu_finch_features.h | 1 +
gpu/config/gpu_util.cc | 8 ++++++++
gpu/config/gpu_workaround_list.txt | 1 +
gpu/ipc/service/gpu_init.cc | 5 +++++
gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++-
media/base/media_switches.cc | 4 ++++
media/base/media_switches.h | 1 +
12 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc
--- a/base/android/android_image_reader_compat.cc
+++ b/base/android/android_image_reader_compat.cc
@@ -23,6 +23,8 @@
namespace base {
namespace android {
+bool AndroidImageReader::disable_support_ = false;
+
AndroidImageReader& AndroidImageReader::GetInstance() {
// C++11 static local variable initialization is
// thread-safe.
@@ -30,8 +32,12 @@ AndroidImageReader& AndroidImageReader::GetInstance() {
return *instance;
}
+void AndroidImageReader::DisableSupport() {
+ disable_support_ = true;
+}
+
bool AndroidImageReader::IsSupported() {
- return is_supported_;
+ return !disable_support_ && is_supported_;
}
AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {}
diff --git a/base/android/android_image_reader_compat.h b/base/android/android_image_reader_compat.h
--- a/base/android/android_image_reader_compat.h
+++ b/base/android/android_image_reader_compat.h
@@ -22,6 +22,9 @@ class BASE_EXPORT AndroidImageReader {
// Thread safe GetInstance.
static AndroidImageReader& GetInstance();
+ // Disable image reader support.
+ static void DisableSupport();
+
// Check if the image reader usage is supported. This function returns TRUE
// if android version is >=OREO, image reader support is not disabled and all
// the required functions are loaded.
@@ -59,6 +62,7 @@ class BASE_EXPORT AndroidImageReader {
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
private:
+ static bool disable_support_;
friend class base::NoDestructor<AndroidImageReader>;
AndroidImageReader();
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1940,7 +1940,7 @@
{
"name": "enable-image-reader",
"owners": [ "vikassoni", "liberato" ],
- "expiry_milestone": 90
+ "expiry_milestone": -1
},
{
"name": "enable-immersive-fullscreen-toolbar",
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json
--- a/gpu/config/gpu_driver_bug_list.json
+++ b/gpu/config/gpu_driver_bug_list.json
@@ -3206,6 +3206,22 @@
"dont_delete_source_texture_for_egl_image"
]
},
+ {
+ "id":335,
+ "cr_bugs": [1051705],
+ "description": "Disable AImageReader on ARM GPUs",
+ "os": {
+ "type": "android",
+ "version": {
+ "op": "<",
+ "value": "10"
+ }
+ },
+ "gl_vendor": "ARM.*|Qualcomm.*",
+ "features": [
+ "disable_aimagereader"
+ ]
+ },
{
"id": 336,
"cr_bugs": [625785],
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
--- a/gpu/config/gpu_finch_features.cc
+++ b/gpu/config/gpu_finch_features.cc
@@ -49,6 +49,11 @@ bool IsDeviceBlocked(const char* field, const std::string& block_list) {
} // namespace
#if defined(OS_ANDROID)
+
+// Use android AImageReader when playing videos with MediaPlayer.
+const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
// Used to limit GL version to 2.0 for skia raster on Android.
const base::Feature kUseGles2ForOopR{"UseGles2ForOopR",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h
--- a/gpu/config/gpu_finch_features.h
+++ b/gpu/config/gpu_finch_features.h
@@ -17,6 +17,7 @@ namespace features {
// All features in alphabetical order. The features should be documented
// alongside the definition of their values in the .cc file.
#if defined(OS_ANDROID)
+GPU_EXPORT extern const base::Feature kAImageReaderMediaPlayer;
GPU_EXPORT extern const base::Feature kUseGles2ForOopR;
GPU_EXPORT extern const base::Feature kAndroidSurfaceControl;
GPU_EXPORT extern const base::Feature kWebViewSurfaceControl;
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -112,6 +112,9 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
#if !defined(OS_ANDROID)
return kGpuFeatureStatusDisabled;
#else
+ if (blocklisted_features.count(GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL))
+ return kGpuFeatureStatusBlocklisted;
+
if (!gpu_preferences.enable_android_surface_control)
return kGpuFeatureStatusDisabled;
@@ -317,6 +320,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
gpu_feature_info->status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
kGpuFeatureStatusBlocklisted;
}
+
+ if (gpu_feature_info->IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
+ gpu_feature_info->status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
+ kGpuFeatureStatusBlocklisted;
+ }
}
// Estimates roughly user total disk space by counting in the drives where
diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list.txt
--- a/gpu/config/gpu_workaround_list.txt
+++ b/gpu/config/gpu_workaround_list.txt
@@ -14,6 +14,7 @@ decode_encode_srgb_for_generatemipmap
depth_stencil_renderbuffer_resize_emulation
disable_2d_canvas_auto_flush
disable_accelerated_av1_decode
+disable_aimagereader
disable_accelerated_av1_decode_d3d11
disable_accelerated_h264_encode
disable_accelerated_vp8_decode
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -502,6 +502,11 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
}
}
+ // Disable AImageReader if the workaround is enabled.
+ if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
+ base::android::AndroidImageReader::DisableSupport();
+ }
+
if (gpu_feature_info_.status_values[GPU_FEATURE_TYPE_VULKAN] !=
kGpuFeatureStatusEnabled ||
!InitializeVulkan()) {
diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
--- a/gpu/ipc/service/stream_texture_android.cc
+++ b/gpu/ipc/service/stream_texture_android.cc
@@ -6,6 +6,7 @@
#include <string.h>
+#include "base/android/android_image_reader_compat.h"
#include "base/android/scoped_hardware_buffer_fence_sync.h"
#include "base/bind.h"
#include "base/feature_list.h"
@@ -49,7 +50,15 @@ std::unique_ptr<ui::ScopedMakeCurrent> MakeCurrent(
}
TextureOwner::Mode GetTextureOwnerMode() {
- return features::IsAImageReaderEnabled()
+ const bool a_image_reader_supported =
+ base::android::AndroidImageReader::GetInstance().IsSupported();
+
+ // TODO(vikassoni) : Currently we have 2 different flags to enable/disable
+ // AImageReader - one for MCVD and other for MediaPlayer here. Merge those 2
+ // flags into a single flag. Keeping the 2 flags separate for now since finch
+ // experiment using this flag is in progress.
+ return a_image_reader_supported && features::IsAImageReaderEnabled() &&
+ base::FeatureList::IsEnabled(features::kAImageReaderMediaPlayer)
? TextureOwner::Mode::kAImageReaderInsecure
: TextureOwner::Mode::kSurfaceTextureInsecure;
}
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -627,6 +627,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
const base::Feature kMediaDrmPreprovisioningAtStartup{
"MediaDrmPreprovisioningAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
+// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
+const base::Feature kAImageReaderVideoOutput{"AImageReaderVideoOutput",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
// Prevents using SurfaceLayer for videos. This is meant to be used by embedders
// that cannot support SurfaceLayer at the moment.
const base::Feature kDisableSurfaceLayerForVideo{
diff --git a/media/base/media_switches.h b/media/base/media_switches.h
--- a/media/base/media_switches.h
+++ b/media/base/media_switches.h
@@ -205,6 +205,7 @@ MEDIA_EXPORT extern const base::Feature kMediaControlsExpandGesture;
MEDIA_EXPORT extern const base::Feature kMediaDrmPersistentLicense;
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioning;
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioningAtStartup;
+MEDIA_EXPORT extern const base::Feature kAImageReaderVideoOutput;
MEDIA_EXPORT extern const base::Feature kDisableSurfaceLayerForVideo;
MEDIA_EXPORT extern const base::Feature kCanPlayHls;
MEDIA_EXPORT extern const base::Feature kPictureInPictureAPI;
--
2.17.1
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Jun 2021 16:53:48 +0200
Subject: API level 21: prevent crash on download
On Lollipop 5.0.x it is not possible to use the system persistent bundle.
This patch ignores boolean settings for them and prevents the crash.
See also: https://github.com/bromite/bromite/issues/1184
---
.../internal/BundleToPersistableBundleConverter.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
--- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
+++ b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
@@ -85,9 +85,17 @@ class BundleToPersistableBundleConverter {
if (obj == null) {
persistableBundle.putString(key, null);