Skip to content

Commit

Permalink
Closes mozilla-mobile#9414: Make AMO collection configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
csadilek committed Mar 26, 2020
1 parent 9e324fa commit 5e9d5dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ android {
testInstrumentationRunnerArguments clearPackageData: 'true'
resValue "bool", "IS_DEBUG", "false"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "false"
buildConfigField "String", "AMO_COLLECTION", "\"7e8d6dc651b54ab385fb8791bf9dac\""
manifestPlaceholders = [
"isRaptorEnabled": "false",
"deepLinkScheme": "fenix-dev"
Expand Down
12 changes: 11 additions & 1 deletion app/src/main/java/org/mozilla/fenix/components/Components.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import mozilla.components.feature.addons.migration.DefaultSupportedAddonsChecker
import mozilla.components.feature.tabs.TabsUseCases
import mozilla.components.lib.publicsuffixlist.PublicSuffixList
import mozilla.components.support.migration.state.MigrationStore
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.test.Mockable
Expand Down Expand Up @@ -69,7 +70,16 @@ class Components(private val context: Context) {
}

val addonCollectionProvider by lazy {
AddonCollectionProvider(context, core.client, maxCacheAgeInMinutes = DAY_IN_MINUTES)
if (!BuildConfig.AMO_COLLECTION.isNullOrEmpty()) {
AddonCollectionProvider(
context,
core.client,
collectionName = BuildConfig.AMO_COLLECTION,
maxCacheAgeInMinutes = DAY_IN_MINUTES
)
} else {
AddonCollectionProvider(context, core.client, maxCacheAgeInMinutes = DAY_IN_MINUTES)
}
}

@Suppress("MagicNumber")
Expand Down

0 comments on commit 5e9d5dd

Please sign in to comment.