From 0b87f966371cb865821a34c7621689132abfcc38 Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Wed, 3 Jun 2020 20:50:58 +0200 Subject: [PATCH] [fenix] Bug 1643132 - Add WebCompat Reporter feature. --- app/build.gradle | 1 + .../java/org/mozilla/fenix/components/Core.kt | 16 ++++++++++++++++ buildSrc/src/main/java/Dependencies.kt | 1 + 3 files changed, 18 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 76b93b6e4d..430e1c4780 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -500,6 +500,7 @@ dependencies { implementation Deps.mozilla_feature_accounts_push implementation Deps.mozilla_feature_webcompat implementation Deps.mozilla_feature_webnotifications + implementation Deps.mozilla_feature_webcompat_reporter implementation Deps.mozilla_service_experiments implementation Deps.mozilla_service_sync_logins diff --git a/app/src/main/java/org/mozilla/fenix/components/Core.kt b/app/src/main/java/org/mozilla/fenix/components/Core.kt index 76972c54dc..52482c3dac 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Core.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Core.kt @@ -38,6 +38,7 @@ import mozilla.components.feature.pwa.WebAppShortcutManager import mozilla.components.feature.readerview.ReaderViewMiddleware import mozilla.components.feature.session.HistoryDelegate import mozilla.components.feature.webcompat.WebCompatFeature +import mozilla.components.feature.webcompat.reporter.WebCompatReporterFeature import mozilla.components.feature.webnotifications.WebNotificationFeature import mozilla.components.lib.dataprotect.SecureAbove22Preferences import mozilla.components.lib.dataprotect.generateEncryptionKey @@ -46,6 +47,7 @@ import org.mozilla.fenix.AppRequestInterceptor import org.mozilla.fenix.Config import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R +import org.mozilla.fenix.ReleaseChannel import org.mozilla.fenix.downloads.DownloadService import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.settings @@ -84,6 +86,20 @@ class Core(private val context: Context) { GeckoProvider.getOrCreateRuntime(context, lazyPasswordsStorage) ).also { WebCompatFeature.install(it) + + /** + * There are some issues around localization to be resolved, as well as questions around + * the capacity of the WebCompat team, so the "Report site issue" feature should stay + * disabled in Fenix Release builds for now. + * This is consistent with both Fennec and Firefox Desktop. + */ + val shouldEnableWebcompatReporter = Config.channel !in setOf( + ReleaseChannel.FenixProduction, + ReleaseChannel.FennecProduction + ) + if (shouldEnableWebcompatReporter) { + WebCompatReporterFeature.install(it) + } } } diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index f41d6f139b..79c355c4a7 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -114,6 +114,7 @@ object Deps { const val mozilla_feature_share = "org.mozilla.components:feature-share:${Versions.mozilla_android_components}" const val mozilla_feature_webcompat = "org.mozilla.components:feature-webcompat:${Versions.mozilla_android_components}" const val mozilla_feature_webnotifications = "org.mozilla.components:feature-webnotifications:${Versions.mozilla_android_components}" + const val mozilla_feature_webcompat_reporter = "org.mozilla.components:feature-webcompat-reporter:${Versions.mozilla_android_components}" const val mozilla_service_experiments = "org.mozilla.components:service-experiments:${Versions.mozilla_android_components}"