Verified Commit 993a8313 authored by brizental's avatar brizental Committed by Pier Angelo Vendrame
Browse files

Revert "TB 40185: [android] Use NimbusDisabled"

This reverts commit c98c78c5.
parent 3652275f
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -96,32 +96,32 @@ open class NimbusMessagingController(
     * creates a URI string for the message action.
     */
    @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
    open fun processMessageActionToUri(message: Message): Uri {
    fun processMessageActionToUri(message: Message): Uri {
        val (uuid, action) = messagingStorage.generateUuidAndFormatMessage(message)
        sendClickedMessageTelemetry(message.id, uuid)

        return convertActionIntoDeepLinkSchemeUri(action)
    }

    open fun sendDismissedMessageTelemetry(messageId: String) {
    private fun sendDismissedMessageTelemetry(messageId: String) {
        GleanMessaging.messageDismissed.record(GleanMessaging.MessageDismissedExtra(messageId))
    }

    open fun sendShownMessageTelemetry(messageId: String) {
    private fun sendShownMessageTelemetry(messageId: String) {
        GleanMessaging.messageShown.record(GleanMessaging.MessageShownExtra(messageId))
    }

    open fun sendExpiredMessageTelemetry(messageId: String) {
    private fun sendExpiredMessageTelemetry(messageId: String) {
        GleanMessaging.messageExpired.record(GleanMessaging.MessageExpiredExtra(messageId))
    }

    open fun sendClickedMessageTelemetry(messageId: String, uuid: String?) {
    private fun sendClickedMessageTelemetry(messageId: String, uuid: String?) {
        GleanMessaging.messageClicked.record(
            GleanMessaging.MessageClickedExtra(messageKey = messageId, actionUuid = uuid),
        )
    }

    open fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String) {
    private fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String) {
        Microsurvey.submitButtonTapped.record(
            Microsurvey.SubmitButtonTappedExtra(
                surveyId = messageId,
@@ -130,7 +130,7 @@ open class NimbusMessagingController(
        )
    }

    open fun convertActionIntoDeepLinkSchemeUri(action: String): Uri =
    private fun convertActionIntoDeepLinkSchemeUri(action: String): Uri =
        if (action.startsWith("://")) {
            "$deepLinkScheme$action".toUri()
        } else {
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ const val MESSAGING_FEATURE_ID = "messaging"
/**
 * Provides messages from [messagingFeature] and combine with the metadata store on [metadataStorage].
 */
open class NimbusMessagingStorage(
class NimbusMessagingStorage(
    private val context: Context,
    private val metadataStorage: MessageMetadataStorage,
    private val onMalformedMessage: (String) -> Unit = {
+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
        //
        // We can initialize Nimbus before Glean because Glean will queue messages
        // before it's initialized.
        // initializeNimbus()
        initializeNimbus()

        ProfilerMarkerFactProcessor.create { components.core.engine.profiler }.register()

+7 −8
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ import org.mozilla.fenix.ext.getNavDirections
import org.mozilla.fenix.ext.hasTopDestination
import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.ext.openSetDefaultBrowserOption
import org.mozilla.fenix.ext.recordEventInNimbus
import org.mozilla.fenix.ext.setNavigationIcon
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.extension.WebExtensionPromptFeature
@@ -441,7 +442,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {

        if (!shouldShowOnboarding) {
            lifecycleScope.launch(IO) {
                // showFullscreenMessageIfNeeded(applicationContext)
                showFullscreenMessageIfNeeded(applicationContext)
            }

            // Unless the activity is recreated, navigate to home first (without rendering it)
@@ -481,7 +482,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
                        ),
                    )
                    // This will record an event in Nimbus' internal event store. Used for behavioral targeting
                    // recordEventInNimbus("app_opened")
                    recordEventInNimbus("app_opened")

                    if (safeIntent.action.equals(ACTION_OPEN_PRIVATE_TAB) && source == APP_ICON) {
                        AppIcon.newPrivateTabTapped.record(NoExtras())
@@ -1453,12 +1454,10 @@ 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))
@@ -1471,10 +1470,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)
    }

    private fun showCrashReporter() {
+1 −1
Original line number Diff line number Diff line
@@ -598,7 +598,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