From 46701c75ededd5c2d19b5039bd54ac279198103a Mon Sep 17 00:00:00 2001 From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Tue, 29 Jun 2021 08:42:31 +0200 Subject: [PATCH] Minor patches fix --- ...I-level-21-prevent-crash-on-download.patch | 4 +-- build/patches/Add-vibration-flag.patch | 27 +++---------------- .../Automated-domain-substitution.patch | 2 +- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/build/patches/API-level-21-prevent-crash-on-download.patch b/build/patches/API-level-21-prevent-crash-on-download.patch index f939239e..85f47fec 100644 --- a/build/patches/API-level-21-prevent-crash-on-download.patch +++ b/build/patches/API-level-21-prevent-crash-on-download.patch @@ -18,14 +18,14 @@ diff --git a/components/background_task_scheduler/internal/android/java/src/org/ persistableBundle.putString(key, null); } else if (obj instanceof Boolean) { - persistableBundle.putBoolean(key, (Boolean) obj); -+ if Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP { ++ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { + failedKeys.add(key); + } else { + persistableBundle.putBoolean(key, (Boolean) obj); + } } else if (obj instanceof boolean[]) { - persistableBundle.putBooleanArray(key, (boolean[]) obj); -+ if Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP { ++ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { + failedKeys.add(key); + } else { + persistableBundle.putBooleanArray(key, (boolean[]) obj); diff --git a/build/patches/Add-vibration-flag.patch b/build/patches/Add-vibration-flag.patch index 8ac37e7c..cdc1db88 100644 --- a/build/patches/Add-vibration-flag.patch +++ b/build/patches/Add-vibration-flag.patch @@ -6,15 +6,14 @@ Subject: Add vibration flag chrome/browser/about_flags.cc | 4 ++++ chrome/browser/flag_descriptions.cc | 3 +++ chrome/browser/flag_descriptions.h | 3 +++ - .../internal/BundleToPersistableBundleConverter.java | 4 ++-- content/child/runtime_features.cc | 1 + content/public/common/content_features.cc | 3 +++ content/public/common/content_features.h | 2 ++ third_party/blink/public/platform/web_runtime_features.h | 1 + - .../blink/renderer/modules/vibration/vibration_controller.cc | 4 ++++ + .../blink/renderer/modules/vibration/vibration_controller.cc | 3 +++ .../blink/renderer/platform/exported/web_runtime_features.cc | 4 ++++ .../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++++ - 11 files changed, 31 insertions(+), 2 deletions(-) + 10 files changed, 28 insertions(+) diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc --- a/chrome/browser/about_flags.cc @@ -56,25 +55,6 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio #if defined(OS_CHROMEOS) extern const char kDeprecateLowUsageCodecsName[]; extern const char kDeprecateLowUsageCodecsDescription[]; -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,13 +85,13 @@ class BundleToPersistableBundleConverter { - if (obj == null) { - persistableBundle.putString(key, null); - } else if (obj instanceof Boolean) { -- if Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP { -+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { - failedKeys.add(key); - } else { - persistableBundle.putBoolean(key, (Boolean) obj); - } - } else if (obj instanceof boolean[]) { -- if Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP { -+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { - failedKeys.add(key); - } else { - persistableBundle.putBooleanArray(key, (boolean[]) obj); diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc @@ -133,13 +113,12 @@ diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.c // Maximum number of entries in a vibration pattern. const unsigned kVibrationPatternLengthMax = 99; -@@ -142,6 +143,9 @@ bool VibrationController::vibrate(Navigator& navigator, +@@ -142,6 +143,8 @@ bool VibrationController::vibrate(Navigator& navigator, // reference to |window| or |navigator| was retained in another window. if (!navigator.DomWindow()) return false; + if (!RuntimeEnabledFeatures::VibrationEnabled()) + return false; -+ } return From(navigator).Vibrate(pattern); } diff --git a/build/patches/Automated-domain-substitution.patch b/build/patches/Automated-domain-substitution.patch index 1a385d58..541e90f3 100644 --- a/build/patches/Automated-domain-substitution.patch +++ b/build/patches/Automated-domain-substitution.patch @@ -30381,7 +30381,7 @@ diff --git a/third_party/blink/renderer/modules/payments/skip_to_gpay_utils.cc b diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.cc b/third_party/blink/renderer/modules/vibration/vibration_controller.cc --- a/third_party/blink/renderer/modules/vibration/vibration_controller.cc +++ b/third_party/blink/renderer/modules/vibration/vibration_controller.cc -@@ -180,12 +180,12 @@ bool VibrationController::Vibrate(const VibrationPattern& pattern) { +@@ -179,12 +179,12 @@ bool VibrationController::Vibrate(const VibrationPattern& pattern) { message = "Blocked call to navigator.vibrate inside a cross-origin " "iframe because the frame has never been activated by the user: "