Loading mobile/android/android-components/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingController.kt +7 −7 Original line number Diff line number Diff line Loading @@ -101,36 +101,36 @@ open class NimbusMessagingController( * creates a URI string for the message action. */ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) fun processMessageActionToUri(message: Message): Uri { open fun processMessageActionToUri(message: Message): Uri { val (uuid, action) = messagingStorage.generateUuidAndFormatMessage(message) sendClickedMessageTelemetry(message.id, uuid) return convertActionIntoDeepLinkSchemeUri(action) } private fun sendDismissedMessageTelemetry(messageId: String) { open fun sendDismissedMessageTelemetry(messageId: String) { GleanMessaging.messageDismissed.record(GleanMessaging.MessageDismissedExtra(messageId)) } private fun sendShownMessageTelemetry(messageId: String) { open fun sendShownMessageTelemetry(messageId: String) { GleanMessaging.messageShown.record(GleanMessaging.MessageShownExtra(messageId)) } private fun sendExpiredMessageTelemetry(messageId: String) { open fun sendExpiredMessageTelemetry(messageId: String) { GleanMessaging.messageExpired.record(GleanMessaging.MessageExpiredExtra(messageId)) } private fun sendClickedMessageTelemetry(messageId: String, uuid: String?) { open fun sendClickedMessageTelemetry(messageId: String, uuid: String?) { GleanMessaging.messageClicked.record( GleanMessaging.MessageClickedExtra(messageKey = messageId, actionUuid = uuid), ) } private fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String?) { open fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String?) { MicroSurvey.response.record(MicroSurvey.ResponseExtra(surveyId = messageId, userSelection = answer)) } private fun convertActionIntoDeepLinkSchemeUri(action: String): Uri = open fun convertActionIntoDeepLinkSchemeUri(action: String): Uri = if (action.startsWith("://")) { "$deepLinkScheme$action".toUri() } else { Loading mobile/android/android-components/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingStorage.kt +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ const val MESSAGING_FEATURE_ID = "messaging" /** * Provides messages from [messagingFeature] and combine with the metadata store on [metadataStorage]. */ class NimbusMessagingStorage( open class NimbusMessagingStorage( private val context: Context, private val metadataStorage: MessageMetadataStorage, private val onMalformedMessage: (String) -> Unit = { Loading mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +1 −1 Original line number Diff line number Diff line Loading @@ -215,7 +215,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider { ) // Set the metric configuration from Nimbus. Glean.applyServerKnobsConfig(FxNimbus.features.glean.value().metricsEnabled) // Glean.applyServerKnobsConfig(FxNimbus.features.glean.value().metricsEnabled) Glean.initialize( applicationContext = this, Loading mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +8 −6 Original line number Diff line number Diff line Loading @@ -319,7 +319,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { } } else { lifecycleScope.launch(IO) { showFullscreenMessageIfNeeded(applicationContext) // showFullscreenMessageIfNeeded(applicationContext) } // Unless the activity is recreated, navigate to home first (without rendering it) Loading Loading @@ -356,7 +356,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { ?.also { Events.appOpened.record(Events.AppOpenedExtra(it)) // This will record an event in Nimbus' internal event store. Used for behavioral targeting components.nimbus.events.recordEvent("app_opened") // components.nimbus.events.recordEvent("app_opened") if (safeIntent.action.equals(ACTION_OPEN_PRIVATE_TAB) && it == APP_ICON) { AppIcon.newPrivateTabTapped.record(NoExtras()) Loading Loading @@ -1270,10 +1270,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { keyDismissButtonText = null, ) /* researchSurfaceDialogFragment.onAccept = { processIntent(messaging.getIntentForMessage(nextMessage)) components.appStore.dispatch(AppAction.MessagingAction.MessageClicked(nextMessage)) } */ researchSurfaceDialogFragment.onDismiss = { components.appStore.dispatch(AppAction.MessagingAction.MessageDismissed(nextMessage)) Loading @@ -1286,10 +1288,10 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { ) } // Update message as displayed. val currentBootUniqueIdentifier = BootUtils.getBootIdentifier(context) messaging.onMessageDisplayed(nextMessage, currentBootUniqueIdentifier) // // Update message as displayed. // val currentBootUniqueIdentifier = BootUtils.getBootIdentifier(context) // // messaging.onMessageDisplayed(nextMessage, currentBootUniqueIdentifier) } companion object { Loading mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -765,7 +765,7 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { override fun navToQuickSettingsSheet(tab: SessionState, sitePermissions: SitePermissions?) { val useCase = requireComponents.useCases.trackingProtectionUseCases FxNimbus.features.cookieBanners.recordExposure() // FxNimbus.features.cookieBanners.recordExposure() useCase.containsException(tab.id) { hasTrackingProtectionException -> lifecycleScope.launch { val cookieBannersStorage = requireComponents.core.cookieBannersStorage Loading Loading
mobile/android/android-components/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingController.kt +7 −7 Original line number Diff line number Diff line Loading @@ -101,36 +101,36 @@ open class NimbusMessagingController( * creates a URI string for the message action. */ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) fun processMessageActionToUri(message: Message): Uri { open fun processMessageActionToUri(message: Message): Uri { val (uuid, action) = messagingStorage.generateUuidAndFormatMessage(message) sendClickedMessageTelemetry(message.id, uuid) return convertActionIntoDeepLinkSchemeUri(action) } private fun sendDismissedMessageTelemetry(messageId: String) { open fun sendDismissedMessageTelemetry(messageId: String) { GleanMessaging.messageDismissed.record(GleanMessaging.MessageDismissedExtra(messageId)) } private fun sendShownMessageTelemetry(messageId: String) { open fun sendShownMessageTelemetry(messageId: String) { GleanMessaging.messageShown.record(GleanMessaging.MessageShownExtra(messageId)) } private fun sendExpiredMessageTelemetry(messageId: String) { open fun sendExpiredMessageTelemetry(messageId: String) { GleanMessaging.messageExpired.record(GleanMessaging.MessageExpiredExtra(messageId)) } private fun sendClickedMessageTelemetry(messageId: String, uuid: String?) { open fun sendClickedMessageTelemetry(messageId: String, uuid: String?) { GleanMessaging.messageClicked.record( GleanMessaging.MessageClickedExtra(messageKey = messageId, actionUuid = uuid), ) } private fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String?) { open fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String?) { MicroSurvey.response.record(MicroSurvey.ResponseExtra(surveyId = messageId, userSelection = answer)) } private fun convertActionIntoDeepLinkSchemeUri(action: String): Uri = open fun convertActionIntoDeepLinkSchemeUri(action: String): Uri = if (action.startsWith("://")) { "$deepLinkScheme$action".toUri() } else { Loading
mobile/android/android-components/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingStorage.kt +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ const val MESSAGING_FEATURE_ID = "messaging" /** * Provides messages from [messagingFeature] and combine with the metadata store on [metadataStorage]. */ class NimbusMessagingStorage( open class NimbusMessagingStorage( private val context: Context, private val metadataStorage: MessageMetadataStorage, private val onMalformedMessage: (String) -> Unit = { Loading
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +1 −1 Original line number Diff line number Diff line Loading @@ -215,7 +215,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider { ) // Set the metric configuration from Nimbus. Glean.applyServerKnobsConfig(FxNimbus.features.glean.value().metricsEnabled) // Glean.applyServerKnobsConfig(FxNimbus.features.glean.value().metricsEnabled) Glean.initialize( applicationContext = this, Loading
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +8 −6 Original line number Diff line number Diff line Loading @@ -319,7 +319,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { } } else { lifecycleScope.launch(IO) { showFullscreenMessageIfNeeded(applicationContext) // showFullscreenMessageIfNeeded(applicationContext) } // Unless the activity is recreated, navigate to home first (without rendering it) Loading Loading @@ -356,7 +356,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { ?.also { Events.appOpened.record(Events.AppOpenedExtra(it)) // This will record an event in Nimbus' internal event store. Used for behavioral targeting components.nimbus.events.recordEvent("app_opened") // components.nimbus.events.recordEvent("app_opened") if (safeIntent.action.equals(ACTION_OPEN_PRIVATE_TAB) && it == APP_ICON) { AppIcon.newPrivateTabTapped.record(NoExtras()) Loading Loading @@ -1270,10 +1270,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { keyDismissButtonText = null, ) /* researchSurfaceDialogFragment.onAccept = { processIntent(messaging.getIntentForMessage(nextMessage)) components.appStore.dispatch(AppAction.MessagingAction.MessageClicked(nextMessage)) } */ researchSurfaceDialogFragment.onDismiss = { components.appStore.dispatch(AppAction.MessagingAction.MessageDismissed(nextMessage)) Loading @@ -1286,10 +1288,10 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { ) } // Update message as displayed. val currentBootUniqueIdentifier = BootUtils.getBootIdentifier(context) messaging.onMessageDisplayed(nextMessage, currentBootUniqueIdentifier) // // Update message as displayed. // val currentBootUniqueIdentifier = BootUtils.getBootIdentifier(context) // // messaging.onMessageDisplayed(nextMessage, currentBootUniqueIdentifier) } companion object { Loading
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -765,7 +765,7 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { override fun navToQuickSettingsSheet(tab: SessionState, sitePermissions: SitePermissions?) { val useCase = requireComponents.useCases.trackingProtectionUseCases FxNimbus.features.cookieBanners.recordExposure() // FxNimbus.features.cookieBanners.recordExposure() useCase.containsException(tab.id) { hasTrackingProtectionException -> lifecycleScope.launch { val cookieBannersStorage = requireComponents.core.cookieBannersStorage Loading