Skip to content

Commit

Permalink
Update to A-S 120.20231014050328 on main (mozilla-mobile#4088)
Browse files Browse the repository at this point in the history
* Update A-S to 120.20231014050328.

* No bug - Update uses of `SuggestionQuery` in Firefox Suggest.

This commit fixes the breaking change introduced in
mozilla/application-services#5867.

* Fixup build breaking from Nimbus pref-key addition

---------

Co-authored-by: MickeyMoz <sebastian@mozilla.com>
Co-authored-by: Ryan VanderMeulen <rvandermeulen@mozilla.com>
Co-authored-by: Lina Butler <lina@yakshaving.ninja>
Co-authored-by: James Hugman <james@hugman.tv>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored and pmarks-net committed Oct 24, 2023
1 parent f1fad21 commit 10e9efa
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
Expand Up @@ -6,6 +6,7 @@ package mozilla.components.feature.fxsuggest

import android.content.res.Resources
import mozilla.appservices.suggest.Suggestion
import mozilla.appservices.suggest.SuggestionProvider
import mozilla.appservices.suggest.SuggestionQuery
import mozilla.components.concept.awesomebar.AwesomeBar
import mozilla.components.feature.session.SessionUseCases
Expand Down Expand Up @@ -36,11 +37,18 @@ class FxSuggestSuggestionProvider(
if (text.isEmpty()) {
emptyList()
} else {
val providers = buildList() {
if (includeSponsoredSuggestions) {
add(SuggestionProvider.AMP)
}
if (includeNonSponsoredSuggestions) {
add(SuggestionProvider.WIKIPEDIA)
}
}
GlobalFxSuggestDependencyProvider.requireStorage().query(
SuggestionQuery(
keyword = text,
includeSponsored = includeSponsoredSuggestions,
includeNonSponsored = includeNonSponsoredSuggestions,
providers = providers,
),
).into()
}
Expand Down
Expand Up @@ -7,6 +7,7 @@ package mozilla.components.feature.fxsuggest
import androidx.test.ext.junit.runners.AndroidJUnit4
import kotlinx.coroutines.test.runTest
import mozilla.appservices.suggest.Suggestion
import mozilla.appservices.suggest.SuggestionProvider
import mozilla.appservices.suggest.SuggestionQuery
import mozilla.components.support.test.any
import mozilla.components.support.test.eq
Expand Down Expand Up @@ -112,8 +113,7 @@ class FxSuggestSuggestionProviderTest {
eq(
SuggestionQuery(
keyword = "la",
includeSponsored = true,
includeNonSponsored = true,
providers = listOf(SuggestionProvider.AMP, SuggestionProvider.WIKIPEDIA),
),
),
)
Expand Down Expand Up @@ -168,8 +168,7 @@ class FxSuggestSuggestionProviderTest {
eq(
SuggestionQuery(
keyword = "la",
includeSponsored = false,
includeNonSponsored = true,
providers = listOf(SuggestionProvider.WIKIPEDIA),
),
),
)
Expand Down Expand Up @@ -212,8 +211,7 @@ class FxSuggestSuggestionProviderTest {
eq(
SuggestionQuery(
keyword = "la",
includeSponsored = true,
includeNonSponsored = false,
providers = listOf(SuggestionProvider.AMP),
),
),
)
Expand Down
Expand Up @@ -787,7 +787,7 @@ class NimbusMessagingStorageTest {
)
val featureInterface: FeaturesInterface = mock()
// "messaging" is a hard coded value generated from Nimbus.
val messagingFeature = FeatureHolder({ featureInterface }, "messaging") {
val messagingFeature = FeatureHolder({ featureInterface }, "messaging") { _, _ ->
messaging
}
messagingFeature.withCachedValue(messaging)
Expand Down
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// These lines are generated by android-components/automation/application-services-nightly-bump.py
val VERSION = "120.20231013050343"
val VERSION = "120.20231014050328"
val CHANNEL = ApplicationServicesChannel.NIGHTLY

object ApplicationServicesConfig {
Expand Down
2 changes: 2 additions & 0 deletions fenix/app/build.gradle
Expand Up @@ -485,6 +485,8 @@ nimbus {
// It will be fetched by Experimenter (the Nimbus experiment website)
// and used to inform experiment configuration.
experimenterManifest = ".experimenter.yaml"
applicationServicesDir = gradle.hasProperty('localProperties.autoPublish.application-services.dir')
? gradle.getProperty('localProperties.autoPublish.application-services.dir') : null
}

tasks.withType(KotlinCompile).configureEach {
Expand Down
Expand Up @@ -56,7 +56,7 @@ class NimbusMessagingHomescreenTest {
@Before
fun setUp() {
// Set up nimbus message
FxNimbusMessaging.features.messaging.withInitializer {
FxNimbusMessaging.features.messaging.withInitializer { _, _ ->
// FML generated objects.
Messaging(
messages = mapOf(
Expand All @@ -82,7 +82,7 @@ class NimbusMessagingHomescreenTest {
}

// Remove some homescreen features not needed for testing
FxNimbus.features.homescreen.withInitializer {
FxNimbus.features.homescreen.withInitializer { _, _ ->
// These are FML generated objects and enums
Homescreen(
sectionsEnabled = mapOf(
Expand Down

0 comments on commit 10e9efa

Please sign in to comment.