richard pushed to branch firefox-android-115.2.0-13.0-1 at The Tor Project / Applications / firefox-android
Commits: 2e2c4d37 by Dan Ballard at 2023-08-11T15:25:56-07:00 fixup! Disable features and functionality
Bug 41997: Remove all use and reference to com.adjust.sdk.Adjust which now uses AD_ID
- - - - -
3 changed files:
- fenix/app/build.gradle - fenix/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt - fenix/buildSrc/src/main/java/FenixDependencies.kt
Changes:
===================================== fenix/app/build.gradle ===================================== @@ -633,7 +633,6 @@ dependencies { implementation FenixDependencies.protobuf_javalite implementation FenixDependencies.google_material
- implementation FenixDependencies.adjust implementation FenixDependencies.installreferrer // Required by Adjust
// Required for in-app reviews
===================================== fenix/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt ===================================== @@ -8,10 +8,6 @@ import android.app.Activity import android.app.Application import android.os.Bundle import android.util.Log -import com.adjust.sdk.Adjust -import com.adjust.sdk.AdjustConfig -import com.adjust.sdk.AdjustEvent -import com.adjust.sdk.LogLevel import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -31,76 +27,16 @@ class AdjustMetricsService( override val type = MetricServiceType.Marketing
override fun start() { - if ((BuildConfig.ADJUST_TOKEN.isNullOrBlank())) { - Log.i(LOGTAG, "No adjust token defined") - - if (Config.channel.isReleased && !BuildConfig.DATA_COLLECTION_DISABLED) { - throw IllegalStateException("No adjust token defined for release build") - } - - return - } - - val config = AdjustConfig( - application, - BuildConfig.ADJUST_TOKEN, - AdjustConfig.ENVIRONMENT_PRODUCTION, - true, - ) - config.setPreinstallTrackingEnabled(true) - - val installationPing = FirstSessionPing(application) - - val timerId = FirstSession.adjustAttributionTime.start() - config.setOnAttributionChangedListener { - FirstSession.adjustAttributionTime.stopAndAccumulate(timerId) - if (!it.network.isNullOrEmpty()) { - application.applicationContext.settings().adjustNetwork = - it.network - } - if (!it.adgroup.isNullOrEmpty()) { - application.applicationContext.settings().adjustAdGroup = - it.adgroup - } - if (!it.creative.isNullOrEmpty()) { - application.applicationContext.settings().adjustCreative = - it.creative - } - if (!it.campaign.isNullOrEmpty()) { - application.applicationContext.settings().adjustCampaignId = - it.campaign - } - - installationPing.checkAndSend() - } - - config.setLogLevel(LogLevel.SUPRESS) - Adjust.onCreate(config) - Adjust.setEnabled(true) - application.registerActivityLifecycleCallbacks(AdjustLifecycleCallbacks()) + /* noop */ }
override fun stop() { - Adjust.setEnabled(false) - Adjust.gdprForgetMe(application.applicationContext) + /* noop */ }
@Suppress("TooGenericExceptionCaught") override fun track(event: Event) { - CoroutineScope(dispatcher).launch { - try { - if (event is Event.GrowthData) { - if (storage.shouldTrack(event)) { - Adjust.trackEvent(AdjustEvent(event.tokenName)) - storage.updateSentState(event) - } else { - storage.updatePersistentState(event) - } - } - } catch (e: Exception) { - crashReporter.submitCaughtException(e) - } - } + /* noop */ }
override fun shouldTrack(event: Event): Boolean = @@ -112,11 +48,11 @@ class AdjustMetricsService(
private class AdjustLifecycleCallbacks : Application.ActivityLifecycleCallbacks { override fun onActivityResumed(activity: Activity) { - Adjust.onResume() + /* noop */ }
override fun onActivityPaused(activity: Activity) { - Adjust.onPause() + /* noop */ }
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { /* noop */ }
===================================== fenix/buildSrc/src/main/java/FenixDependencies.kt ===================================== @@ -127,7 +127,6 @@ object FenixDependencies { const val protobuf_javalite = "com.google.protobuf:protobuf-javalite:${FenixVersions.protobuf}" const val protobuf_compiler = "com.google.protobuf:protoc:${FenixVersions.protobuf}"
- const val adjust = "com.adjust.sdk:adjust-android:${FenixVersions.adjust}" const val installreferrer = "com.android.installreferrer:installreferrer:${FenixVersions.installreferrer}"
const val junit = "junit:junit:${FenixVersions.junit}"
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/2e2c...
tor-commits@lists.torproject.org