Loading app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt +3 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ class AdjustMetricsService(private val application: Application) : MetricsServic true ) val installationPing = InstallationPing(application) config.setOnAttributionChangedListener { if (!it.network.isNullOrEmpty()) { application.applicationContext.settings().adjustNetwork = Loading @@ -55,7 +57,7 @@ class AdjustMetricsService(private val application: Application) : MetricsServic it.campaign } InstallationPing(application).checkAndSend() installationPing.checkAndSend() } config.setLogLevel(LogLevel.SUPRESS) Loading app/src/main/java/org/mozilla/fenix/components/metrics/InstallationPing.kt +5 −2 Original line number Diff line number Diff line Loading @@ -71,14 +71,17 @@ class InstallationPing(private val context: Context) { } /** * Check that required metrics are not empty before attempting to send ping. * Check that at least one of the metrics values is set before sending the ping. * Note: it is normal for many of these values to not be set as campaigns do not always * utilize every attribute! * */ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) internal fun checkMetricsNotEmpty(): Boolean = listOf( context.settings().adjustCampaignId, context.settings().adjustAdGroup, context.settings().adjustCreative, context.settings().adjustNetwork ).all { it.isNotEmpty() } ).any { it.isNotEmpty() } /** * Trigger sending the `installation` ping if it wasn't sent already. Loading Loading
app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt +3 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ class AdjustMetricsService(private val application: Application) : MetricsServic true ) val installationPing = InstallationPing(application) config.setOnAttributionChangedListener { if (!it.network.isNullOrEmpty()) { application.applicationContext.settings().adjustNetwork = Loading @@ -55,7 +57,7 @@ class AdjustMetricsService(private val application: Application) : MetricsServic it.campaign } InstallationPing(application).checkAndSend() installationPing.checkAndSend() } config.setLogLevel(LogLevel.SUPRESS) Loading
app/src/main/java/org/mozilla/fenix/components/metrics/InstallationPing.kt +5 −2 Original line number Diff line number Diff line Loading @@ -71,14 +71,17 @@ class InstallationPing(private val context: Context) { } /** * Check that required metrics are not empty before attempting to send ping. * Check that at least one of the metrics values is set before sending the ping. * Note: it is normal for many of these values to not be set as campaigns do not always * utilize every attribute! * */ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) internal fun checkMetricsNotEmpty(): Boolean = listOf( context.settings().adjustCampaignId, context.settings().adjustAdGroup, context.settings().adjustCreative, context.settings().adjustNetwork ).all { it.isNotEmpty() } ).any { it.isNotEmpty() } /** * Trigger sending the `installation` ping if it wasn't sent already. Loading