diff --git a/fenix/app/build.gradle b/fenix/app/build.gradle index 78d698dad9..0fbf4cb1cf 100644 --- a/fenix/app/build.gradle +++ b/fenix/app/build.gradle @@ -576,7 +576,6 @@ dependencies { implementation project(':lib-crash') implementation project(':lib-crash-sentry') - implementation project(':lib-push-firebase') implementation project(':lib-state') implementation project(':lib-dataprotect') @@ -615,15 +614,6 @@ dependencies { implementation FenixDependencies.protobuf_javalite implementation ComponentsDependencies.google_material - implementation FenixDependencies.adjust - implementation FenixDependencies.installreferrer // Required by Adjust - - implementation FenixDependencies.google_ads_id // Required for the Google Advertising ID - - // Required for in-app reviews - implementation FenixDependencies.google_play_review - implementation FenixDependencies.google_play_review_ktx - implementation FenixDependencies.androidx_profileinstaller androidTestImplementation ComponentsDependencies.androidx_test_uiautomator diff --git a/fenix/app/proguard-rules.pro b/fenix/app/proguard-rules.pro index e269f65775..e870f06bef 100644 --- a/fenix/app/proguard-rules.pro +++ b/fenix/app/proguard-rules.pro @@ -1,22 +1,5 @@ -dontobfuscate -#################################################################################################### -# Sentry -#################################################################################################### - -# Recommended config via https://docs.sentry.io/clients/java/modules/android/#manual-integration -# Since we don't obfuscate, we don't need to use their Gradle plugin to upload ProGuard mappings. --keepattributes LineNumberTable,SourceFile --dontwarn org.slf4j.** --dontwarn javax.** - -# Our addition: this class is saved to disk via Serializable, which ProGuard doesn't like. -# If we exclude this, upload silently fails (Sentry swallows a NPE so we don't crash). -# I filed https://github.com/getsentry/sentry-java/issues/572 -# -# If Sentry ever mysteriously stops working after we upgrade it, this could be why. --keep class io.sentry.event.Event { *; } - #################################################################################################### # Android and GeckoView built-ins #################################################################################################### @@ -69,58 +52,6 @@ -keep class org.mozilla.fenix.**ViewModel { *; } -#################################################################################################### -# Adjust -#################################################################################################### - --keep public class com.adjust.sdk.** { *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.** { *; } --keep class dalvik.system.VMRuntime { - java.lang.String getRuntime(); -} --keep class android.os.Build { - java.lang.String[] SUPPORTED_ABIS; - java.lang.String CPU_ABI; -} --keep class android.content.res.Configuration { - android.os.LocaledList getLocales(); - java.util.Locale locale; -} --keep class android.os.LocaleList { - java.util.Locale get(int); -} - -# Keep code generated from Glean Metrics --keep class org.mozilla.fenix.GleanMetrics.** { *; } - -# Keep motionlayout internal methods -# https://github.com/mozilla-mobile/fenix/issues/2094 --keep class androidx.constraintlayout.** { *; } - -# Keep adjust relevant classes --keep class com.adjust.sdk.** { *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.** { *; } - # Keep Android Lifecycle methods # https://bugzilla.mozilla.org/show_bug.cgi?id=1596302 -keep class androidx.lifecycle.** { *; } diff --git a/fenix/app/src/main/java/com/adjust/sdk/Adjust.java b/fenix/app/src/main/java/com/adjust/sdk/Adjust.java new file mode 100644 index 0000000000..7e644e2fa2 --- /dev/null +++ b/fenix/app/src/main/java/com/adjust/sdk/Adjust.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012-2017 adjust GmbH, + * http://www.adjust.com + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package com.adjust.sdk; + +import android.content.Context; + +public class Adjust { + public static void onCreate(AdjustConfig adjustConfig) { + } + + public static void onResume() { + } + + public static void onPause() { + } + + public static void setEnabled(boolean enabled) { + } + + public static void gdprForgetMe(final Context context) { + } +} diff --git a/fenix/app/src/main/java/com/adjust/sdk/AdjustAttribution.java b/fenix/app/src/main/java/com/adjust/sdk/AdjustAttribution.java new file mode 100644 index 0000000000..ab6b3badbd --- /dev/null +++ b/fenix/app/src/main/java/com/adjust/sdk/AdjustAttribution.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2012-2017 adjust GmbH, + * http://www.adjust.com + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package com.adjust.sdk; + +import java.io.Serializable; + +public class AdjustAttribution implements Serializable { + public String network; + public String campaign; + public String adgroup; + public String creative; + + @Override + public boolean equals(Object other) { + return false; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public String toString() { + return ""; + } +} diff --git a/fenix/app/src/main/java/com/adjust/sdk/AdjustConfig.java b/fenix/app/src/main/java/com/adjust/sdk/AdjustConfig.java new file mode 100644 index 0000000000..6753dd7d9f --- /dev/null +++ b/fenix/app/src/main/java/com/adjust/sdk/AdjustConfig.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2012-2017 adjust GmbH, + * http://www.adjust.com + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package com.adjust.sdk; + +import android.content.Context; + +import java.util.List; + +public class AdjustConfig { + public static final String ENVIRONMENT_SANDBOX = "sandbox"; + public static final String ENVIRONMENT_PRODUCTION = "production"; + + public AdjustConfig(Context context, String appToken, String environment) { + } + + public AdjustConfig(Context context, String appToken, String environment, boolean allowSuppressLogLevel) { + } + + public void setOnAttributionChangedListener(OnAttributionChangedListener onAttributionChangedListener) { + } + + public void setLogLevel(LogLevel logLevel) { + } +} diff --git a/fenix/app/src/main/java/com/adjust/sdk/LogLevel.java b/fenix/app/src/main/java/com/adjust/sdk/LogLevel.java new file mode 100644 index 0000000000..27ac3de544 --- /dev/null +++ b/fenix/app/src/main/java/com/adjust/sdk/LogLevel.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2012-2017 adjust GmbH, + * http://www.adjust.com + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package com.adjust.sdk; + +import android.util.Log; + +/** + * Created by pfms on 11/03/15. + */ +public enum LogLevel { + VERBOSE(Log.VERBOSE), DEBUG(Log.DEBUG), INFO(Log.INFO), WARN(Log.WARN), ERROR(Log.ERROR), ASSERT(Log.ASSERT), SUPRESS(8); + final int androidLogLevel; + + LogLevel(final int androidLogLevel) { + this.androidLogLevel = androidLogLevel; + } + + public int getAndroidLogLevel() { + return androidLogLevel; + } +} diff --git a/fenix/app/src/main/java/com/adjust/sdk/OnAttributionChangedListener.java b/fenix/app/src/main/java/com/adjust/sdk/OnAttributionChangedListener.java new file mode 100644 index 0000000000..7efa1c6804 --- /dev/null +++ b/fenix/app/src/main/java/com/adjust/sdk/OnAttributionChangedListener.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2012-2017 adjust GmbH, + * http://www.adjust.com + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package com.adjust.sdk; + +public interface OnAttributionChangedListener { + void onAttributionChanged(AdjustAttribution attribution); +} diff --git a/fenix/app/src/main/java/com/google/android/gms/ads/identifier/AdvertisingIdClient.java b/fenix/app/src/main/java/com/google/android/gms/ads/identifier/AdvertisingIdClient.java new file mode 100644 index 0000000000..0f2a47b141 --- /dev/null +++ b/fenix/app/src/main/java/com/google/android/gms/ads/identifier/AdvertisingIdClient.java @@ -0,0 +1,23 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package com.google.android.gms.ads.identifier; + +import android.content.Context; + +public class AdvertisingIdClient { + + public static final class Info { + + public String getId() { + return ""; + } + + } + + public static Info getAdvertisingIdInfo(Context context) { + return new Info(); + } + +} diff --git a/fenix/app/src/main/java/com/google/android/gms/common/GooglePlayServicesNotAvailableException.java b/fenix/app/src/main/java/com/google/android/gms/common/GooglePlayServicesNotAvailableException.java new file mode 100644 index 0000000000..d3bff12497 --- /dev/null +++ b/fenix/app/src/main/java/com/google/android/gms/common/GooglePlayServicesNotAvailableException.java @@ -0,0 +1,8 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package com.google.android.gms.common; + +public class GooglePlayServicesNotAvailableException extends Exception { +} diff --git a/fenix/app/src/main/java/com/google/android/gms/common/GooglePlayServicesRepairableException.java b/fenix/app/src/main/java/com/google/android/gms/common/GooglePlayServicesRepairableException.java new file mode 100644 index 0000000000..b72a7cdb16 --- /dev/null +++ b/fenix/app/src/main/java/com/google/android/gms/common/GooglePlayServicesRepairableException.java @@ -0,0 +1,8 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package com.google.android.gms.common; + +public class GooglePlayServicesRepairableException extends Exception { +} diff --git a/fenix/app/src/main/java/com/google/firebase/messaging/FirebaseMessagingService.java b/fenix/app/src/main/java/com/google/firebase/messaging/FirebaseMessagingService.java new file mode 100644 index 0000000000..4d5fd8153d --- /dev/null +++ b/fenix/app/src/main/java/com/google/firebase/messaging/FirebaseMessagingService.java @@ -0,0 +1,42 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.firebase.messaging; + +import android.app.Service; +import android.content.Intent; +import android.os.Binder; +import android.os.IBinder; + +public class FirebaseMessagingService extends Service { + + private final IBinder mBinder = new Binder(); + + public void onMessageReceived(RemoteMessage message) { + } + + public void onMessageSent(String msgId) { + } + + public void onNewToken(String token) { + } + + public void onSendError(String msgId, Exception exception) { + } + + @Override + public IBinder onBind(Intent intent) { + return mBinder; + } + +} diff --git a/fenix/app/src/main/java/com/google/firebase/messaging/RemoteMessage.java b/fenix/app/src/main/java/com/google/firebase/messaging/RemoteMessage.java new file mode 100644 index 0000000000..9ad59a31e4 --- /dev/null +++ b/fenix/app/src/main/java/com/google/firebase/messaging/RemoteMessage.java @@ -0,0 +1,33 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.firebase.messaging; + +import android.os.Parcel; +import android.os.Parcelable; +import java.util.Map; + +public class RemoteMessage implements Parcelable { + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel out, int flags) { + } + + public Map getData() { + return null; + } + +} diff --git a/fenix/app/src/main/java/mozilla/components/lib/push/firebase/AbstractFirebasePushService.kt b/fenix/app/src/main/java/mozilla/components/lib/push/firebase/AbstractFirebasePushService.kt new file mode 100644 index 0000000000..b50a6f03a2 --- /dev/null +++ b/fenix/app/src/main/java/mozilla/components/lib/push/firebase/AbstractFirebasePushService.kt @@ -0,0 +1,32 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package mozilla.components.lib.push.firebase + +import android.content.Context +import com.google.firebase.messaging.FirebaseMessagingService +import com.google.firebase.messaging.RemoteMessage +import mozilla.components.concept.push.PushService + +abstract class AbstractFirebasePushService() : FirebaseMessagingService(), PushService { + + override fun start(context: Context) { + } + + override fun onNewToken(newToken: String) { + } + + override fun onMessageReceived(remoteMessage: RemoteMessage?) { + } + + final override fun stop() { + } + + override fun deleteToken() { + } + + override fun isServiceAvailable(context: Context): Boolean { + return false + } +} diff --git a/fenix/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt b/fenix/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt index d3d63c17b9..7228e67716 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt @@ -18,7 +18,7 @@ object FeatureFlags { * This feature does not only depend on this flag. It requires the AMO collection override to * be enabled which is behind the Secret Settings. * */ - val customExtensionCollectionFeature = Config.channel.isNightlyOrDebug || Config.channel.isBeta + val customExtensionCollectionFeature = true /** * Pull-to-refresh allows you to pull the web content down far enough to have the page to @@ -37,7 +37,7 @@ object FeatureFlags { fun isPocketRecommendationsFeatureEnabled(context: Context): Boolean { val langTag = LocaleManager.getCurrentLocale(context) ?.toLanguageTag() ?: getSystemDefault().toLanguageTag() - return listOf("en-US", "en-CA").contains(langTag) + return false && listOf("en-US", "en-CA").contains(langTag) } /** diff --git a/fenix/app/src/main/java/org/mozilla/fenix/components/Analytics.kt b/fenix/app/src/main/java/org/mozilla/fenix/components/Analytics.kt index 3cd954a5bb..31f4e6fe34 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/components/Analytics.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/components/Analytics.kt @@ -137,11 +137,7 @@ class Analytics( MetricController.create( listOf( GleanMetricsService(context), - AdjustMetricsService( - application = context as Application, - storage = metricsStorage, - crashReporter = crashReporter, - ), + AdjustMetricsService(context as Application), InstallReferrerMetricsService(context), ), isDataTelemetryEnabled = { context.settings().isTelemetryEnabled }, diff --git a/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt b/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt index d077ca2972..a55a167ad5 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt @@ -10,7 +10,6 @@ import android.content.Context import androidx.compose.runtime.Composable import androidx.compose.ui.platform.LocalContext import androidx.core.app.NotificationManagerCompat -import com.google.android.play.core.review.ReviewManagerFactory import mozilla.components.feature.addons.AddonManager import mozilla.components.feature.addons.amo.AMOAddonsProvider import mozilla.components.feature.addons.migration.DefaultSupportedAddonsChecker @@ -171,7 +170,6 @@ class Components(private val context: Context) { val reviewPromptController by lazyMonitored { ReviewPromptController( - manager = ReviewManagerFactory.create(context), reviewSettings = FenixReviewSettings(settings), ) } diff --git a/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt b/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt index f6d7a2b0df..366c256bdb 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt @@ -510,8 +510,14 @@ class Core( } else { defaultTopSites.add( Pair( - context.getString(R.string.default_top_site_google), - SupportUtils.GOOGLE_URL, + context.getString(R.string.default_top_site_fdroid), + SupportUtils.FDROID_URL, + ), + ) + defaultTopSites.add( + Pair( + context.getString(R.string.default_top_site_eff), + SupportUtils.EFF_URL, ), ) diff --git a/fenix/app/src/main/java/org/mozilla/fenix/components/ReviewPromptController.kt b/fenix/app/src/main/java/org/mozilla/fenix/components/ReviewPromptController.kt index 33e8704adc..ffa85e3e46 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/components/ReviewPromptController.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/components/ReviewPromptController.kt @@ -6,8 +6,6 @@ package org.mozilla.fenix.components import android.app.Activity import androidx.annotation.VisibleForTesting -import com.google.android.play.core.review.ReviewInfo -import com.google.android.play.core.review.ReviewManager import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.withContext import org.mozilla.fenix.GleanMetrics.ReviewPrompt @@ -45,24 +43,9 @@ class FenixReviewSettings( * Controls the Review Prompt behavior. */ class ReviewPromptController( - private val manager: ReviewManager, private val reviewSettings: ReviewSettings, private val timeNowInMillis: () -> Long = { System.currentTimeMillis() }, - private val tryPromptReview: suspend (Activity) -> Unit = { activity -> - val flow = manager.requestReviewFlow() - - withContext(Main) { - flow.addOnCompleteListener { - if (it.isSuccessful) { - manager.launchReviewFlow(activity, it.result) - recordReviewPromptEvent( - it.result.toString(), - reviewSettings.numberOfAppLaunches, - Date(), - ) - } - } - } + private val tryPromptReview: suspend (Activity) -> Unit = { _ -> }, ) { @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) diff --git a/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt b/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt index b979a08026..ae125ebd52 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt @@ -10,25 +10,13 @@ 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.Constants.ADJUST_PREINSTALL_SYSTEM_PROPERTY_PATH import com.adjust.sdk.LogLevel -import kotlinx.coroutines.CoroutineDispatcher -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import mozilla.components.lib.crash.CrashReporter import org.mozilla.fenix.BuildConfig import org.mozilla.fenix.Config import org.mozilla.fenix.GleanMetrics.FirstSession import org.mozilla.fenix.ext.settings -class AdjustMetricsService( - private val application: Application, - private val storage: MetricsStorage, - private val crashReporter: CrashReporter, - private val dispatcher: CoroutineDispatcher = Dispatchers.IO, -) : MetricsService { +class AdjustMetricsService(private val application: Application) : MetricsService { override val type = MetricServiceType.Marketing override fun start() { @@ -42,15 +30,12 @@ class AdjustMetricsService( return } - System.setProperty(ADJUST_PREINSTALL_SYSTEM_PROPERTY_PATH, "/preload/etc/adjust.preinstall") - val config = AdjustConfig( application, BuildConfig.ADJUST_TOKEN, AdjustConfig.ENVIRONMENT_PRODUCTION, true, ) - config.setPreinstallTrackingEnabled(true) val installationPing = FirstSessionPing(application) @@ -94,26 +79,8 @@ class AdjustMetricsService( Adjust.gdprForgetMe(application.applicationContext) } - @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) - } - } - } - - override fun shouldTrack(event: Event): Boolean = - event is Event.GrowthData + override fun track(event: Event) { /* noop */ } + override fun shouldTrack(event: Event): Boolean = false companion object { private const val LOGTAG = "AdjustMetricsService" diff --git a/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/InstallReferrerMetricsService.kt b/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/InstallReferrerMetricsService.kt index a65690bdce..5e88212347 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/InstallReferrerMetricsService.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/InstallReferrerMetricsService.kt @@ -8,8 +8,6 @@ import android.content.Context import android.net.UrlQuerySanitizer import android.os.RemoteException import androidx.annotation.VisibleForTesting -import com.android.installreferrer.api.InstallReferrerClient -import com.android.installreferrer.api.InstallReferrerStateListener import org.mozilla.fenix.GleanMetrics.PlayStoreAttribution import org.mozilla.fenix.ext.settings import org.mozilla.fenix.utils.Settings @@ -23,60 +21,13 @@ import java.net.URLDecoder class InstallReferrerMetricsService(private val context: Context) : MetricsService { override val type = MetricServiceType.Marketing - private var referrerClient: InstallReferrerClient? = null - override fun start() { if (context.settings().utmParamsKnown) { return } - - val timerId = PlayStoreAttribution.attributionTime.start() - val client = InstallReferrerClient.newBuilder(context).build() - referrerClient = client - - client.startConnection( - object : InstallReferrerStateListener { - override fun onInstallReferrerSetupFinished(responseCode: Int) { - PlayStoreAttribution.attributionTime.stopAndAccumulate(timerId) - when (responseCode) { - InstallReferrerClient.InstallReferrerResponse.OK -> { - // Connection established. - try { - val response = client.installReferrer - recordInstallReferrer(context.settings(), response.installReferrer) - context.settings().utmParamsKnown = true - } catch (e: RemoteException) { - // NOOP. - // We can't do anything about this. - } - } - - InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED -> { - // API not available on the current Play Store app. - context.settings().utmParamsKnown = true - } - - InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE -> { - // Connection couldn't be established. - } - } - // End the connection, and null out the client. - stop() - } - - override fun onInstallReferrerServiceDisconnected() { - // Try to restart the connection on the next request to - // Google Play by calling the startConnection() method. - referrerClient = null - } - }, - ) } - override fun stop() { - referrerClient?.endConnection() - referrerClient = null - } + override fun stop() { /* noop */ } override fun track(event: Event) = Unit diff --git a/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSiteItemViewHolder.kt b/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSiteItemViewHolder.kt index d69f27e570..171f54a6d5 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSiteItemViewHolder.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSiteItemViewHolder.kt @@ -176,6 +176,12 @@ class TopSiteItemViewHolder( SupportUtils.MEITUAN_URL -> { binding.faviconImage.setImageDrawable(getDrawable(itemView.context, R.drawable.ic_meituan)) } + SupportUtils.FDROID_URL -> { + binding.faviconImage.setImageDrawable(getDrawable(itemView.context, R.drawable.ic_fdroid)) + } + SupportUtils.EFF_URL -> { + binding.faviconImage.setImageDrawable(getDrawable(itemView.context, R.drawable.ic_eff)) + } else -> { itemView.context.components.core.icons.loadIntoView(binding.faviconImage, topSite.url) } diff --git a/fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt b/fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt index e867be39f2..a1667b1c2b 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt @@ -38,6 +38,8 @@ object SupportUtils { const val GOOGLE_US_URL = "https://www.google.com/webhp?client=firefox-b-1-m&channel=ts" const val GOOGLE_XX_URL = "https://www.google.com/webhp?client=firefox-b-m&channel=ts" const val WHATS_NEW_URL = "https://www.mozilla.org/firefox/android/notes" + const val FDROID_URL = "https://f-droid.org/" + const val EFF_URL = "https://www.eff.org/" enum class SumoTopic(internal val topicStr: String) { HELP("faq-android"), diff --git a/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index 01ed68bbe6..c35ab607f7 100644 --- a/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -332,17 +332,17 @@ class Settings(private val appContext: Context) : PreferencesHolder { var isTelemetryEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_telemetry), - default = true, + default = false, ) var isMarketingTelemetryEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_marketing_telemetry), - default = !Config.channel.isMozillaOnline, + default = false, ) var isExperimentationEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_experimentation), - default = true, + default = false, ) var isOverrideTPPopupsForPerformanceTest = false @@ -1553,7 +1553,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { var showPocketRecommendationsFeature by lazyFeatureFlagPreference( appContext.getPreferenceKey(R.string.pref_key_pocket_homescreen_recommendations), featureFlag = FeatureFlags.isPocketRecommendationsFeatureEnabled(appContext), - default = { homescreenSections[HomeScreenSection.POCKET] == true }, + default = { false }, ) /** @@ -1611,7 +1611,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { */ var showContileFeature by booleanPreference( key = appContext.getPreferenceKey(R.string.pref_key_enable_contile), - default = true, + default = false, ) /** diff --git a/fenix/app/src/main/res/values/static_strings_extra.xml b/fenix/app/src/main/res/values/static_strings_extra.xml new file mode 100644 index 0000000000..101f4e0d0a --- /dev/null +++ b/fenix/app/src/main/res/values/static_strings_extra.xml @@ -0,0 +1,8 @@ + + + + F-Droid + EFF + diff --git a/fenix/app/src/main/res/xml/preferences.xml b/fenix/app/src/main/res/xml/preferences.xml index 2e0366e11b..4a684b7fb6 100644 --- a/fenix/app/src/main/res/xml/preferences.xml +++ b/fenix/app/src/main/res/xml/preferences.xml @@ -133,11 +133,6 @@ app:iconSpaceReserved="false" android:title="@string/preferences_notifications" /> - - - - + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + android:summary="@string/preference_option_phone_feature_ask_to_allow" + app:isPreferenceVisible="false"/>