commit aa1745839a95d40d5b4581d87ce158c20367d76f parent 892b6f147d7636997f4b5b5e7288090277866e70 Author: Norisz Fay <nfay@mozilla.com> Date: Thu, 13 Nov 2025 04:53:49 +0200 Revert "Bug 1974132 , Bug 1999811 : Nimbus to use remotesettingsservice r=bdk,jonalmeida" for causing fenix-debug failures This reverts commit f0daba13ae48041d050c6c3c7781ed56970dc5e4. Revert "Bug 1999811 - Update android nightly application-services version bump to a2b29819ca7075240d8b21142b6bc05446f1f7fa r=release-managers,RyanVM" This reverts commit e3c2bd93b15835747118c1a9773386d4d1d2a5ca. Diffstat:
8 files changed, 42 insertions(+), 74 deletions(-)
diff --git a/mobile/android/android-components/plugins/dependencies/src/main/java/ApplicationServices.kt b/mobile/android/android-components/plugins/dependencies/src/main/java/ApplicationServices.kt @@ -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 = "147.20251112200825" +val VERSION = "146.20251108050313" val CHANNEL = ApplicationServicesChannel.NIGHTLY object ApplicationServicesConfig { diff --git a/mobile/android/android-components/plugins/dependencies/src/main/java/moz.yaml b/mobile/android/android-components/plugins/dependencies/src/main/java/moz.yaml @@ -31,11 +31,11 @@ origin: # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: a2b29819ca7075240d8b21142b6bc05446f1f7fa (2025-11-12T20:08:25). + release: c0b8b7e48d0fd8766af253aa39db1c30f88e15a4 (2025-11-08T05:03:13). # Revision to pull in # Must be a long or short commit SHA (long preferred) - revision: a2b29819ca7075240d8b21142b6bc05446f1f7fa + revision: c0b8b7e48d0fd8766af253aa39db1c30f88e15a4 # The package's license, where possible using the mnemonic from # https://spdx.org/licenses/ diff --git a/mobile/android/android-components/samples/glean/src/main/java/org/mozilla/samples/glean/GleanApplication.kt b/mobile/android/android-components/samples/glean/src/main/java/org/mozilla/samples/glean/GleanApplication.kt @@ -7,6 +7,7 @@ package org.mozilla.samples.glean import android.app.Application import android.content.Context import androidx.core.content.edit +import androidx.core.net.toUri import mozilla.components.lib.fetch.httpurlconnection.HttpURLConnectionClient import mozilla.components.service.glean.net.ConceptFetchHttpUploader import mozilla.components.service.nimbus.Nimbus @@ -79,6 +80,7 @@ class GleanApplication : Application() { private fun initNimbus(isFirstRun: Boolean) { RustLog.enable() RustHttpConfig.setClient(lazy { HttpURLConnectionClient() }) + val url = getString(R.string.nimbus_default_endpoint).toUri() val appInfo = NimbusAppInfo( appName = "samples-glean", channel = "samples", @@ -86,7 +88,7 @@ class GleanApplication : Application() { nimbus = Nimbus( context = this, appInfo = appInfo, - server = NimbusServerSettings(remoteSettingsService = null), + server = NimbusServerSettings(url), recordedContext = null, ).also { nimbus -> if (isFirstRun) { diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt @@ -197,26 +197,7 @@ class Components(private val context: Context) { } val analytics by lazyMonitored { Analytics(context, nimbus, performance.visualCompletenessQueue) } - - val remoteSettingsService = lazyMonitored { - RemoteSettingsService( - context, - if (context.settings().useProductionRemoteSettingsServer) { - RemoteSettingsServer.Prod.into() - } else { - RemoteSettingsServer.Stage.into() - }, - channel = BuildConfig.BUILD_TYPE, - // Need to send this value separately, since `isLargeScreenSize()` is a fenix extension - isLargeScreenSize = context.isLargeScreenSize(), - ) - } - val nimbus by lazyMonitored { - NimbusComponents( - context = context, - remoteSettingsService = remoteSettingsService.value.remoteSettingsService, - ) - } + val nimbus by lazyMonitored { NimbusComponents(context) } val publicSuffixList by lazyMonitored { PublicSuffixList(context) } val clipboardHandler by lazyMonitored { ClipboardHandler(context) } val performance by lazyMonitored { PerformanceComponent() } @@ -340,6 +321,20 @@ class Components(private val context: Context) { null } + val remoteSettingsService = lazyMonitored { + RemoteSettingsService( + context, + if (context.settings().useProductionRemoteSettingsServer) { + RemoteSettingsServer.Prod.into() + } else { + RemoteSettingsServer.Stage.into() + }, + channel = BuildConfig.BUILD_TYPE, + // Need to send this value separately, since `isLargeScreenSize()` is a fenix extension + isLargeScreenSize = context.isLargeScreenSize(), + ) + } + val fxSuggest by lazyMonitored { FxSuggest(context, remoteSettingsService.value) } val distributionIdManager by lazyMonitored { diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/NimbusComponents.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/NimbusComponents.kt @@ -5,7 +5,6 @@ package org.mozilla.fenix.components import android.content.Context -import mozilla.appservices.remotesettings.RemoteSettingsService import mozilla.components.service.nimbus.NimbusApi import mozilla.components.service.nimbus.messaging.FxNimbusMessaging import mozilla.components.service.nimbus.messaging.NimbusMessagingController @@ -22,14 +21,14 @@ import org.mozilla.fenix.perf.lazyMonitored /** * Component group for access to Nimbus and other Nimbus services. */ -class NimbusComponents(private val context: Context, remoteSettingsService: RemoteSettingsService?) { +class NimbusComponents(private val context: Context) { /** * The main entry point for the Nimbus SDK. Note that almost all access to feature configuration * should be mediated through a FML generated class, e.g. [FxNimbus]. */ val sdk: NimbusApi by lazyMonitored { - createNimbus(context, BuildConfig.NIMBUS_ENDPOINT, remoteSettingsService) + createNimbus(context, BuildConfig.NIMBUS_ENDPOINT) } /** diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/experiments/NimbusSetup.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/experiments/NimbusSetup.kt @@ -5,11 +5,9 @@ package org.mozilla.fenix.experiments import android.content.Context -import mozilla.appservices.remotesettings.RemoteSettingsService import mozilla.components.service.nimbus.NimbusApi import mozilla.components.service.nimbus.NimbusAppInfo import mozilla.components.service.nimbus.NimbusBuilder -import mozilla.components.service.nimbus.NimbusServerSettings import mozilla.components.service.nimbus.messaging.FxNimbusMessaging import mozilla.components.service.nimbus.messaging.NimbusSystem import mozilla.components.support.base.log.logger.Logger @@ -36,11 +34,7 @@ private val logger = Logger("service/Nimbus") /** * Create the Nimbus singleton object for the Fenix app. */ -fun createNimbus( - context: Context, - urlString: String?, - remoteSettingsService: RemoteSettingsService?, -): NimbusApi { +fun createNimbus(context: Context, urlString: String?): NimbusApi { // These values can be used in the JEXL expressions when targeting experiments. val customTargetingAttributes = CustomAttributeProvider.getCustomTargetingAttributes(context) @@ -54,17 +48,6 @@ fun createNimbus( isFirstRun = isAppFirstRun, ) - val serverSettings: NimbusServerSettings? = remoteSettingsService?.let { service -> - NimbusServerSettings( - remoteSettingsService = service, - collection = if (context.settings().nimbusUsePreview) { - "nimbus-preview" - } else { - "nimbus-mobile-experiments" - }, - ) - } - // The name "fenix" here corresponds to the app_name defined for the family of apps // that encompasses all of the channels for the Fenix app. This is defined upstream in // the telemetry system. For more context on where the app_name come from see: @@ -85,6 +68,7 @@ fun createNimbus( errorReporter = context::reportError initialExperiments = R.raw.initial_experiments timeoutLoadingExperiment = TIME_OUT_LOADING_EXPERIMENT_FROM_DISK_MS + usePreviewCollection = context.settings().nimbusUsePreview sharedPreferences = context.settings().preferences isFirstRun = isAppFirstRun featureManifest = FxNimbus @@ -92,7 +76,7 @@ fun createNimbus( context.settings().nimbusExperimentsFetched = true } recordedContext = recordedNimbusContext - }.build(appInfo, serverSettings).also { nimbusApi -> + }.build(appInfo).also { nimbusApi -> nimbusApi.recordIsReady(FxNimbus.features.nimbusIsReady.value().eventCount) } } diff --git a/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/Components.kt b/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/Components.kt @@ -262,20 +262,8 @@ class Components( ) } - val remoteSettingsService by lazy { - RemoteSettingsService( - context, - if (context.settings.useProductionRemoteSettingsServer) { - RemoteSettingsServer.Prod.into() - } else { - RemoteSettingsServer.Stage.into() - }, - channel = BuildConfig.BUILD_TYPE, - ) - } - val experiments: NimbusApi by lazy { - createNimbus(context, BuildConfig.NIMBUS_ENDPOINT, remoteSettingsService.remoteSettingsService) + createNimbus(context, BuildConfig.NIMBUS_ENDPOINT) } val adsTelemetry: AdsTelemetry by lazy { AdsTelemetry() } @@ -302,6 +290,18 @@ class Components( val dateTimeProvider: DateTimeProvider by lazy { DefaultDateTimeProvider() } val downloadEstimator: DownloadEstimator by lazy { DownloadEstimator(dateTimeProvider = dateTimeProvider) } + + val remoteSettingsService by lazy { + RemoteSettingsService( + context, + if (context.settings.useProductionRemoteSettingsServer) { + RemoteSettingsServer.Prod.into() + } else { + RemoteSettingsServer.Stage.into() + }, + channel = BuildConfig.BUILD_TYPE, + ) + } } private fun createCrashReporter(context: Context): CrashReporter { diff --git a/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/experiments/NimbusSetup.kt b/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/experiments/NimbusSetup.kt @@ -5,11 +5,9 @@ package org.mozilla.focus.experiments import android.content.Context -import mozilla.appservices.remotesettings.RemoteSettingsService import mozilla.components.service.nimbus.NimbusApi import mozilla.components.service.nimbus.NimbusAppInfo import mozilla.components.service.nimbus.NimbusBuilder -import mozilla.components.service.nimbus.NimbusServerSettings import mozilla.components.support.base.log.logger.Logger import org.json.JSONObject import org.mozilla.experiments.nimbus.NimbusInterface @@ -31,7 +29,7 @@ private const val TIME_OUT_LOADING_EXPERIMENT_FROM_DISK_MS = 200L /** * Create the Nimbus singleton object for the Focus/Klar apps. */ -fun createNimbus(context: Context, urlString: String?, remoteSettingsService: RemoteSettingsService?): NimbusApi { +fun createNimbus(context: Context, urlString: String?): NimbusApi { val isAppFirstRun = context.settings.isFirstRun // These values can be used in the JEXL expressions when targeting experiments. @@ -60,17 +58,6 @@ fun createNimbus(context: Context, urlString: String?, remoteSettingsService: Re customTargetingAttributes = customTargetingAttributes, ) - val serverSettings: NimbusServerSettings? = remoteSettingsService?.let { service -> - NimbusServerSettings( - remoteSettingsService = service, - collection = if (context.settings.shouldUseNimbusPreview) { - "nimbus-preview" - } else { - "nimbus-mobile-experiments" - }, - ) - } - return NimbusBuilder(context).apply { url = urlString errorReporter = { message, e -> @@ -81,10 +68,11 @@ fun createNimbus(context: Context, urlString: String?, remoteSettingsService: Re } initialExperiments = R.raw.initial_experiments timeoutLoadingExperiment = TIME_OUT_LOADING_EXPERIMENT_FROM_DISK_MS + usePreviewCollection = context.settings.shouldUseNimbusPreview sharedPreferences = context.settings.preferences isFirstRun = isAppFirstRun featureManifest = FocusNimbus - }.build(appInfo, serverSettings) + }.build(appInfo) } internal fun finishNimbusInitialization(experiments: NimbusApi) =