From 7f746f6f17c42aaba07fa689e0d3b7736d1b9d20 Mon Sep 17 00:00:00 2001 From: Arturo Mejia Date: Mon, 19 Aug 2019 10:29:10 -0700 Subject: [PATCH] [fenix] Use Mozilla Android Components 9.0.0-SNAPSHOT. (https://github.com/mozilla-mobile/fenix/pull/4750) --- .../java/org/mozilla/fenix/components/Core.kt | 9 +++++++-- .../java/org/mozilla/fenix/settings/Extensions.kt | 15 --------------- .../quicksettings/QuickSettingsComponent.kt | 1 - buildSrc/src/main/java/Dependencies.kt | 4 ++-- 4 files changed, 9 insertions(+), 20 deletions(-) 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 d09f9bd6cc..0905b64db9 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Core.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Core.kt @@ -21,7 +21,9 @@ import mozilla.components.browser.storage.sync.PlacesHistoryStorage import mozilla.components.concept.engine.DefaultSettings import mozilla.components.concept.engine.Engine import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy -import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy.Companion.SAFE_BROWSING_ALL +import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy.SafeBrowsingCategory +import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy.Companion.select +import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy.TrackingCategory import mozilla.components.concept.engine.mediaquery.PreferredColorScheme import mozilla.components.concept.fetch.Client import mozilla.components.feature.media.MediaFeature @@ -177,7 +179,10 @@ class Core(private val context: Context) { normalMode && privateMode -> trackingProtectionPolicy normalMode && !privateMode -> trackingProtectionPolicy.forRegularSessionsOnly() !normalMode && privateMode -> trackingProtectionPolicy.forPrivateSessionsOnly() - else -> TrackingProtectionPolicy.select(SAFE_BROWSING_ALL) + else -> select( + trackingCategories = arrayOf(TrackingCategory.NONE), + safeBrowsingCategories = arrayOf(SafeBrowsingCategory.RECOMMENDED) + ) } } diff --git a/app/src/main/java/org/mozilla/fenix/settings/Extensions.kt b/app/src/main/java/org/mozilla/fenix/settings/Extensions.kt index 6a2e55ad3c..b93fdfc4bd 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/Extensions.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/Extensions.kt @@ -40,21 +40,6 @@ internal fun SitePermissions.Status.toString(context: Context): String { } } -fun SitePermissionsRules.Action.toStatus(): SitePermissions.Status { - return when (this) { - SitePermissionsRules.Action.BLOCKED -> SitePermissions.Status.BLOCKED - SitePermissionsRules.Action.ASK_TO_ALLOW -> SitePermissions.Status.NO_DECISION - } -} - -fun SitePermissions.Status.toggle(): SitePermissions.Status { - return when (this) { - SitePermissions.Status.BLOCKED -> SitePermissions.Status.ALLOWED - SitePermissions.Status.NO_DECISION -> SitePermissions.Status.ALLOWED - SitePermissions.Status.ALLOWED -> SitePermissions.Status.BLOCKED - } -} - fun SitePermissions.toggle(featurePhone: PhoneFeature): SitePermissions { return when (featurePhone) { PhoneFeature.CAMERA -> { diff --git a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsComponent.kt b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsComponent.kt index d44b9ac826..3692bb024f 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsComponent.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsComponent.kt @@ -18,7 +18,6 @@ import org.mozilla.fenix.mvi.UIComponentViewModelBase import org.mozilla.fenix.mvi.UIComponentViewModelProvider import org.mozilla.fenix.mvi.UIView import org.mozilla.fenix.settings.PhoneFeature -import org.mozilla.fenix.settings.toStatus import org.mozilla.fenix.settings.toggle import org.mozilla.fenix.utils.Settings diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 07dfd34c80..e04b5d2fbb 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -34,14 +34,14 @@ object Versions { const val androidx_work = "2.0.1" const val google_material = "1.1.0-alpha07" - const val mozilla_android_components = "8.0.0" + const val mozilla_android_components = "9.0.0-SNAPSHOT" // Note that android-components also depends on application-services, // and in fact is our main source of appservices-related functionality. // The version number below tracks the application-services version // that we depend on directly for the fenix-megazord (and for it's // forUnitTest variant), and it's important that it be kept in // sync with the version used by android-components above. - const val mozilla_appservices = "0.36.0" + const val mozilla_appservices = "0.37.1" const val autodispose = "1.1.0" const val adjust = "4.11.4"