diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1c7225db5d34..2b18b3eee978 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -51,16 +51,10 @@ work = "2.11.1" # Google other accompanist = "0.37.3" -firebase-messaging = "25.0.1" installreferrer = "2.2" ksp = "2.3.6" material = "1.13.0" osslicenses-plugin = "0.10.10" -play-integrity = "1.6.0" -play-review = "2.0.2" -play-services-ads-id = "18.3.0" -play-services-base = "18.10.0" -play-services-fido = "21.2.0" protobuf = "4.33.2" # Keep Protobuf in sync with the version used by AppServices. # Gradle plugins @@ -120,7 +114,6 @@ kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = kotlin-serialization = { module = "org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin", version.ref = "kotlin" } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } -kotlinx-coroutines-play-services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "coroutines" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } @@ -210,7 +203,6 @@ androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling # Google other accompanist-drawablepainter = { module = "com.google.accompanist:accompanist-drawablepainter", version.ref = "accompanist" } -firebase-messaging = { module = "com.google.firebase:firebase-messaging", version.ref = "firebase-messaging" } google-material = { module = "com.google.android.material:material", version.ref = "material" } installreferrer = { module = "com.android.installreferrer:installreferrer", version.ref = "installreferrer" } ksp-symbol-processing-aa = { module = "com.google.devtools.ksp:symbol-processing-aa", version.ref = "ksp" } @@ -219,12 +211,6 @@ ksp-symbol-processing-api = { module = "com.google.devtools.ksp:symbol-processin ksp-symbol-processing-common-deps = { module = "com.google.devtools.ksp:symbol-processing-common-deps", version.ref = "ksp" } mlkit-prompt = { module = "com.google.mlkit:genai-prompt", version = "1.0.0-alpha1" } osslicenses-plugin = { module = "com.google.android.gms:oss-licenses-plugin", version.ref = "osslicenses-plugin" } -play-integrity = { module = "com.google.android.play:integrity", version.ref = "play-integrity" } -play-review = { module = "com.google.android.play:review", version.ref = "play-review" } -play-review-ktx = { module = "com.google.android.play:review-ktx", version.ref = "play-review" } -play-services-ads-id = { module = "com.google.android.gms:play-services-ads-identifier", version.ref = "play-services-ads-id" } -play-services-base = { module = "com.google.android.gms:play-services-base", version.ref = "play-services-base" } -play-services-fido = { module = "com.google.android.gms:play-services-fido", version.ref = "play-services-fido" } protobuf-compiler = { module = "com.google.protobuf:protoc", version.ref = "protobuf" } protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobuf" } diff --git a/mobile/android/android-components/.buildconfig.yml b/mobile/android/android-components/.buildconfig.yml index c26c00fa5a13..ff79084820f0 100644 --- a/mobile/android/android-components/.buildconfig.yml +++ b/mobile/android/android-components/.buildconfig.yml @@ -1769,18 +1769,6 @@ projects: - components:support-test - components:tooling-fetch-tests - components:tooling-lint - components:lib-integrity-googleplay: - description: A library for verifying the integrity of an installation using Google - Play - path: components/lib/integrity-googleplay - publish: true - upstream_dependencies: - - components:concept-base - - components:concept-fetch - - components:concept-integrity - - components:support-base - - components:support-test - - components:tooling-lint components:lib-jexl: description: 'Javascript Expression Language: Powerful context-based expression parser and evaluator.' @@ -1821,17 +1809,6 @@ projects: - components:support-base - components:support-test - components:tooling-lint - components:lib-push-firebase: - description: An implementation of concept-push for the Firebase Message Service. - path: components/lib/push-firebase - publish: true - upstream_dependencies: - - components:concept-base - - components:concept-fetch - - components:concept-push - - components:support-base - - components:support-test - - components:tooling-lint components:lib-shake: description: A library to detect shake gestures from accelerometer data path: components/lib/shake diff --git a/mobile/android/fenix/.buildconfig.yml b/mobile/android/fenix/.buildconfig.yml index 7d6b48243700..5e94d59bfa5e 100644 --- a/mobile/android/fenix/.buildconfig.yml +++ b/mobile/android/fenix/.buildconfig.yml @@ -69,10 +69,8 @@ projects: - components:lib-crash - components:lib-crash-sentry - components:lib-dataprotect - - components:lib-integrity-googleplay - components:lib-llm-mlpa - components:lib-publicsuffixlist - - components:lib-push-firebase - components:lib-shake - components:lib-state - components:service-digitalassetlinks diff --git a/mobile/android/fenix/app/build.gradle b/mobile/android/fenix/app/build.gradle index 4930620b7123..552003446b24 100644 --- a/mobile/android/fenix/app/build.gradle +++ b/mobile/android/fenix/app/build.gradle @@ -623,16 +623,13 @@ dependencies { implementation project(':components:lib-crash') implementation project(':components:lib-crash-sentry') implementation project(':components:lib-dataprotect') - implementation project(':components:lib-push-firebase') implementation project(':components:lib-state') implementation project(':components:lib-accelerometer-sensormanager') - implementation project(':components:lib-integrity-googleplay') implementation project(':components:lib-llm-mlpa') implementation project(':components:lib-shake') implementation ComponentsDependencies.mozilla_appservices_syncmanager implementation libs.accompanist.drawablepainter - implementation libs.adjust implementation libs.androidx.activity implementation libs.androidx.activity.ktx implementation libs.androidx.annotation @@ -679,16 +676,14 @@ dependencies { implementation libs.androidx.viewpager2 implementation libs.androidx.work.runtime implementation libs.google.material - implementation libs.installreferrer implementation libs.kotlinx.coroutines implementation libs.kotlinx.serialization.json implementation libs.mozilla.glean - implementation libs.play.review - implementation libs.play.review.ktx - implementation libs.play.services.ads.id implementation libs.protobuf.javalite implementation libs.sentry + implementation 'org.microg.gms:play-services-ads-identifier:0.3.13.250932' + debugImplementation libs.androidx.compose.ui.tooling debugImplementation libs.leakcanary diff --git a/mobile/android/fenix/app/proguard-rules.pro b/mobile/android/fenix/app/proguard-rules.pro index 39a6df6fb62e..86ee82a027dc 100644 --- a/mobile/android/fenix/app/proguard-rules.pro +++ b/mobile/android/fenix/app/proguard-rules.pro @@ -28,3 +28,11 @@ # Keep code generated from Glean Metrics -keep class org.mozilla.fenix.GleanMetrics.** { *; } + +#################################################################################################### +# Checker Framework +#################################################################################################### + +-dontwarn org.checkerframework.checker.nullness.qual.EnsuresNonNull +-dontwarn org.checkerframework.checker.nullness.qual.EnsuresNonNullIf +-dontwarn org.checkerframework.checker.nullness.qual.RequiresNonNull diff --git a/mobile/android/fenix/app/src/main/java/com/adjust/sdk/Adjust.java b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/Adjust.java new file mode 100644 index 000000000000..1bafc51be64e --- /dev/null +++ b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/Adjust.java @@ -0,0 +1,55 @@ +/* + * 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 initSdk(AdjustConfig adjustConfig) { + } + + public static void trackEvent(AdjustEvent event) { + } + + public static void onResume() { + } + + public static void onPause() { + } + + public static void enable() { + } + + public static void disable() { + } + + public static void gdprForgetMe(final Context context) { + } + + public static void trackThirdPartySharing( + final AdjustThirdPartySharing adjustThirdPartySharing) + { + } +} diff --git a/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustAttribution.java b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustAttribution.java new file mode 100644 index 000000000000..ab6b3badbdb1 --- /dev/null +++ b/mobile/android/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/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustConfig.java b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustConfig.java new file mode 100644 index 000000000000..df58236bc456 --- /dev/null +++ b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustConfig.java @@ -0,0 +1,52 @@ +/* + * 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 enablePreinstallTracking() { + } + + public void setLogLevel(LogLevel logLevel) { + } + + public void enableCoppaCompliance() { + } +} diff --git a/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustEvent.java b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustEvent.java new file mode 100644 index 000000000000..0b4d80ed4b2c --- /dev/null +++ b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustEvent.java @@ -0,0 +1,31 @@ +package com.adjust.sdk; + +/** + * Created by pfms on 05/11/14. + */ +public class AdjustEvent { + + public AdjustEvent(String eventToken) { + } + + public void setRevenue(double revenue, String currency) { + } + + public void addCallbackParameter(String key, String value) { + } + + public void addPartnerParameter(String key, String value) { + } + + public void setOrderId(String orderId) { + } + + public void setCallbackId(String callbackId) { + } + + public void setProductId(String productId) { + } + + public void setPurchaseToken(String purchaseToken) { + } +} diff --git a/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustThirdPartySharing.java b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustThirdPartySharing.java new file mode 100644 index 000000000000..1a8314dae0a1 --- /dev/null +++ b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/AdjustThirdPartySharing.java @@ -0,0 +1,13 @@ +package com.adjust.sdk; + +public class AdjustThirdPartySharing { + + public AdjustThirdPartySharing(final Boolean isEnabled) { + } + + public void addPartnerSharingSetting(final String partnerName, + final String key, + final boolean value) + { + } +} diff --git a/mobile/android/fenix/app/src/main/java/com/adjust/sdk/Constants.java b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/Constants.java new file mode 100644 index 000000000000..bfaeee26e8e1 --- /dev/null +++ b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/Constants.java @@ -0,0 +1,18 @@ +// +// Constants.java +// Adjust +// +// Created by keyboardsurfer on 2013-11-08. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// See the file MIT-LICENSE for copying permission. +// + +package com.adjust.sdk; + +/** + * @author keyboardsurfer + * @since 8.11.13 + */ +public interface Constants { + String ADJUST_PREINSTALL_SYSTEM_PROPERTY_PATH = "adjust.preinstall.path"; +} diff --git a/mobile/android/fenix/app/src/main/java/com/adjust/sdk/LogLevel.java b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/LogLevel.java new file mode 100644 index 000000000000..f4ef17f4c492 --- /dev/null +++ b/mobile/android/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), SUPPRESS(8); + final int androidLogLevel; + + LogLevel(final int androidLogLevel) { + this.androidLogLevel = androidLogLevel; + } + + public int getAndroidLogLevel() { + return androidLogLevel; + } +} diff --git a/mobile/android/fenix/app/src/main/java/com/adjust/sdk/OnAttributionChangedListener.java b/mobile/android/fenix/app/src/main/java/com/adjust/sdk/OnAttributionChangedListener.java new file mode 100644 index 000000000000..7efa1c6804c6 --- /dev/null +++ b/mobile/android/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/mobile/android/fenix/app/src/main/java/com/google/firebase/messaging/FirebaseMessagingService.java b/mobile/android/fenix/app/src/main/java/com/google/firebase/messaging/FirebaseMessagingService.java new file mode 100644 index 000000000000..4d5fd8153d21 --- /dev/null +++ b/mobile/android/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/mobile/android/fenix/app/src/main/java/com/google/firebase/messaging/RemoteMessage.java b/mobile/android/fenix/app/src/main/java/com/google/firebase/messaging/RemoteMessage.java new file mode 100644 index 000000000000..9ad59a31e43c --- /dev/null +++ b/mobile/android/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/mobile/android/fenix/app/src/main/java/mozilla/components/lib/push/firebase/AbstractFirebasePushService.kt b/mobile/android/fenix/app/src/main/java/mozilla/components/lib/push/firebase/AbstractFirebasePushService.kt new file mode 100644 index 000000000000..b50a6f03a218 --- /dev/null +++ b/mobile/android/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/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 8dd1374d2d94..fb6785a50a77 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -412,7 +412,6 @@ open class FenixApplication : Application(), Provider, ThemeProvider { queueIncrementNumberOfAppLaunches(queue) queueRestoreLocale(queue) queueStorageMaintenance(queue) - queueIntegrityClientWarmUp(queue) queueNimbusFetchInForeground(queue) queueSetAutofillMetrics(queue) queueDownloadWallpapers(queue) @@ -533,14 +532,6 @@ open class FenixApplication : Application(), Provider, ThemeProvider { components.core.autofillStorage.registerStorageMaintenanceWorker() } - @OptIn(DelicateCoroutinesApi::class) // GlobalScope usage - private fun queueIntegrityClientWarmUp(queue: RunWhenReadyQueue) = - runOnVisualCompleteness(queue) { - GlobalScope.launch(IO) { - components.integrityClient.warmUp() - } - } - @OptIn(DelicateCoroutinesApi::class) // GlobalScope usage private fun queueNimbusFetchInForeground(queue: RunWhenReadyQueue) = runOnVisualCompleteness(queue) { diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index cbbdc3c76899..97fedfafc208 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -1372,19 +1372,16 @@ abstract class BaseBrowserFragment : view = view, ) - // This component feature only works on Fenix when built on Mozilla infrastructure. - if (BuildConfig.MOZILLA_OFFICIAL) { - webAuthnFeature.set( - feature = WebAuthnFeature( - engine = requireComponents.core.engine, - activity = requireActivity(), - exitFullScreen = requireComponents.useCases.sessionUseCases.exitFullscreen::invoke, - currentTab = { store.state.selectedTabId }, - ), - owner = this, - view = view, - ) - } + webAuthnFeature.set( + feature = WebAuthnFeature( + engine = requireComponents.core.engine, + activity = requireActivity(), + exitFullScreen = requireComponents.useCases.sessionUseCases.exitFullscreen::invoke, + currentTab = { store.state.selectedTabId }, + ), + owner = this, + view = view, + ) screenOrientationFeature.set( feature = ScreenOrientationFeature( diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt index 2c3b431cec24..e7550716a0fa 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt @@ -10,7 +10,6 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.ReadOnlyComposable 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 @@ -18,11 +17,6 @@ import mozilla.components.feature.addons.update.DefaultAddonUpdater import mozilla.components.feature.autofill.AutofillConfiguration import mozilla.components.lib.crash.store.CrashAction import mozilla.components.lib.crash.store.CrashMiddleware -import mozilla.components.lib.integrity.googleplay.GooglePlayIntegrityClient -import mozilla.components.lib.integrity.googleplay.GoogleProjectNumber -import mozilla.components.lib.integrity.googleplay.IntegrityManagerProvider -import mozilla.components.lib.integrity.googleplay.RequestHashProvider -import mozilla.components.lib.integrity.googleplay.TokenProviderFactory import mozilla.components.lib.publicsuffixlist.PublicSuffixList import mozilla.components.service.fxrelay.eligibility.RelayEligibilityStore import mozilla.components.service.fxrelay.eligibility.middlewares.ClearLastUsedMiddleware @@ -247,7 +241,6 @@ class Components(private val context: Context) { val playStoreReviewPromptController by lazyMonitored { PlayStoreReviewPromptController( - manager = ReviewManagerFactory.create(context), numberOfAppLaunches = { settings.numberOfAppLaunches }, ) } @@ -364,16 +357,6 @@ class Components(private val context: Context) { ) } - val integrityClient by lazyMonitored { - GooglePlayIntegrityClient( - TokenProviderFactory.create( - IntegrityManagerProvider.create(context), - GoogleProjectNumber.create(BuildConfig.GPS_INTEGRITY_TOKEN), - ), - RequestHashProvider.randomHashProvider(), - ) - } - val termsOfUsePromptRepository by lazyMonitored { DefaultTermsOfUsePromptRepository(settings) } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/PlayStoreReviewPromptController.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/PlayStoreReviewPromptController.kt index f08c5cecdade..7f75cc75c20c 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/PlayStoreReviewPromptController.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/PlayStoreReviewPromptController.kt @@ -11,9 +11,6 @@ import androidx.annotation.VisibleForTesting import androidx.core.net.toUri import androidx.fragment.app.FragmentActivity import androidx.navigation.fragment.NavHostFragment -import com.google.android.play.core.review.ReviewException -import com.google.android.play.core.review.ReviewInfo -import com.google.android.play.core.review.ReviewManager import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import mozilla.components.support.base.log.logger.Logger @@ -35,7 +32,6 @@ val logger = Logger("PlayStoreReviewPromptController") * Wraps the Play Store In-App Review API. */ class PlayStoreReviewPromptController( - private val manager: ReviewManager, private val numberOfAppLaunches: () -> Int, ) { @@ -47,80 +43,12 @@ class PlayStoreReviewPromptController( onNotDisplayed: () -> Unit = {}, onError: () -> Unit = {}, ) { - logger.info("tryPromptReview in progress...") - val reviewInfoTask = withContext(Dispatchers.IO) { manager.requestReviewFlow() } - - reviewInfoTask.addOnCompleteListener(activity) { task -> - val result = if (task.isSuccessful) { - logger.info("Review flow launched.") - // Launch the in-app flow. - manager.launchReviewFlow(activity, task.result) - - ReviewPromptAttemptResult.from(task.result.toString()) - } else { - Error - } - - when (result) { - NotDisplayed -> { - logger.warn("In-app review flow reported as not displayed, even though there was no error.") - - onNotDisplayed() - } - - Error -> { - val reviewErrorCode = - (task.exception as? ReviewException)?.errorCode ?: ERROR_CODE_UNEXPECTED - logger.warn("Failed to launch in-app review flow due to: $reviewErrorCode.") - - onError() - } - - Displayed, Unknown -> {} - } - - recordReviewPromptEvent( - promptAttemptResult = result, - numberOfAppLaunches = numberOfAppLaunches(), - now = Date(), - ) - } - - logger.info("tryPromptReview completed.") } /** * Try to launch the play store review flow. */ fun tryLaunchPlayStoreReview(activity: Activity) { - logger.info("tryLaunchPlayStoreReview in progress...") - - try { - logger.info("Navigating to Play store listing.") - activity.startActivity( - Intent(Intent.ACTION_VIEW, SupportUtils.RATE_APP_URL.toUri()), - ) - } catch (e: ActivityNotFoundException) { - // Device without the play store installed. - // Opening the play store website. - - activity.applicationContext.components.useCases.fenixBrowserUseCases.loadUrlOrSearch( - searchTermOrURL = SupportUtils.FENIX_PLAY_STORE_URL, - newTab = true, - ) - - // https://bugzilla.mozilla.org/show_bug.cgi?id=1997148 - (activity as? FragmentActivity) - ?.supportFragmentManager - ?.fragments - ?.firstOrNull { it is NavHostFragment } - ?.let { (it as NavHostFragment).navController } - ?.openToBrowser() - - logger.warn("Failed to launch play store review flow due to: $e.") - } - - logger.info("tryLaunchPlayStoreReview completed.") } companion object { diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/InstallReferrerWorker.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/InstallReferrerWorker.kt index be9e47f9fbf2..fd16b5119e41 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/InstallReferrerWorker.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/InstallReferrerWorker.kt @@ -9,8 +9,6 @@ import android.os.RemoteException import androidx.annotation.VisibleForTesting import androidx.work.CoroutineWorker import androidx.work.WorkerParameters -import com.android.installreferrer.api.InstallReferrerClient -import com.android.installreferrer.api.InstallReferrerStateListener import kotlinx.coroutines.suspendCancellableCoroutine import mozilla.components.support.base.log.logger.Logger import mozilla.telemetry.glean.GleanTimerId @@ -43,31 +41,7 @@ class InstallReferrerWorker( private val settings = context.settings() override suspend fun doWork(): Result { - val referrerClient = DefaultInstallReferrerClient(applicationContext) - val (responseCode, referrerResponse) = fetchInstallReferrer(referrerClient) - - return when (responseCode) { - InstallReferrerClient.InstallReferrerResponse.OK -> { - handleSuccess(referrerResponse, responseCode, settings) - Result.success() - } - - InstallReferrerClient.InstallReferrerResponse.SERVICE_DISCONNECTED, - InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE, - -> { - if (shouldRetry(runAttemptCount)) { - Result.retry() - } else { - markAsComplete(responseCode) - Result.failure() - } - } - - else -> { - markAsComplete(responseCode) - Result.failure() - } - } + return Result.success() } @VisibleForTesting @@ -76,103 +50,6 @@ class InstallReferrerWorker( responseCode: Int, settings: Settings, ) { - if (!installReferrerResponse.isNullOrBlank()) { - PlayStoreAttribution.installReferrerResponse.set(installReferrerResponse) - - val utmParams = UTMParams.parseUTMParameters(installReferrerResponse) - val metaParams = MetaParams.extractMetaAttribution(utmParams.content) - if (metaParams != null) { - settings.isUserMetaAttributed = true - metaParams.recordMetaAttribution() - } else { - settings.isUserMetaAttributed = false - } - - utmParams.recordInstallReferrer(settings) - } - - markAsComplete(responseCode) - } - - private fun markAsComplete(responseCode: Int) { - settings.utmParamsKnown = true - PlayStoreAttribution.responseCode.set(responseCode.toString()) - Pings.playStoreAttribution.submit() - } - - companion object { - private val logger = Logger("InstallReferrerWorker") - - @VisibleForTesting - internal fun shouldRetry(runAttemptCount: Int): Boolean { - return runAttemptCount < InstallReferrerMetricsService.MAX_RETRIES - } - - @VisibleForTesting - internal suspend fun fetchInstallReferrer( - referrerClient: InstallReferrerClientWrapper, - ): Pair { - val timerId = PlayStoreAttribution.attributionTime.start() - - return suspendCancellableCoroutine { continuation -> - continuation.invokeOnCancellation { - safelyEndConnection(referrerClient) - } - - val listener = createReferrerStateListener(timerId, referrerClient, continuation) - referrerClient.startConnection(listener) - } - } - - private fun createReferrerStateListener( - timerId: GleanTimerId, - referrerClient: InstallReferrerClientWrapper, - continuation: kotlin.coroutines.Continuation>, - ) = object : InstallReferrerStateListener { - override fun onInstallReferrerSetupFinished(responseCode: Int) { - PlayStoreAttribution.attributionTime.stopAndAccumulate(timerId) - val referrerResponse = getReferrerResponseIfOk(responseCode, referrerClient) - safelyEndConnection(referrerClient) - continuation.resume(Pair(responseCode, referrerResponse)) - } - - override fun onInstallReferrerServiceDisconnected() { - continuation.resume( - Pair( - InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE, - null, - ), - ) - } - } - - private fun getReferrerResponseIfOk( - responseCode: Int, - referrerClient: InstallReferrerClientWrapper, - ): String? { - if (responseCode != InstallReferrerClient.InstallReferrerResponse.OK) { - return null - } - - return try { - referrerClient.getInstallReferrer() - } catch (e: RemoteException) { - logger.error("Failed to retrieve install referrer", e) - null - } catch (e: SecurityException) { - logger.error("Failed to retrieve install referrer", e) - null - } - } - - @Suppress("TooGenericExceptionCaught") - private fun safelyEndConnection(referrerClient: InstallReferrerClientWrapper) { - try { - referrerClient.endConnection() - } catch (e: Exception) { - logger.error("Failed to end connection", e) - } - } } } @@ -181,30 +58,10 @@ class InstallReferrerWorker( */ @VisibleForTesting internal interface InstallReferrerClientWrapper { - fun startConnection(listener: InstallReferrerStateListener) fun getInstallReferrer(): String? fun endConnection() } -/** - * Default implementation that wraps the actual InstallReferrerClient. - */ -private class DefaultInstallReferrerClient(context: Context) : InstallReferrerClientWrapper { - private val client = InstallReferrerClient.newBuilder(context).build() - - override fun startConnection(listener: InstallReferrerStateListener) { - client.startConnection(listener) - } - - override fun getInstallReferrer(): String? { - return client.installReferrer?.installReferrer - } - - override fun endConnection() { - client.endConnection() - } -} - /** * Descriptions of utm parameters comes from * https://support.google.com/analytics/answer/1033863 diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/MarketingAttributionService.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/MarketingAttributionService.kt index c35705351b3e..b0156324642b 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/MarketingAttributionService.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/MarketingAttributionService.kt @@ -7,8 +7,6 @@ package org.mozilla.fenix.components.metrics import android.content.Context import android.os.RemoteException import androidx.annotation.VisibleForTesting -import com.android.installreferrer.api.InstallReferrerClient -import com.android.installreferrer.api.InstallReferrerStateListener import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -28,87 +26,18 @@ const val ADJUST_REFTAG_PREFIX = "adjust_reftag=" */ class MarketingAttributionService(private val context: Context) { private val logger = Logger("MarketingAttributionService") - private var referrerClient: InstallReferrerClient? = null /** * Starts the connection with the install referrer and handle the response. */ @Suppress("CognitiveComplexMethod") fun start() { - val client = InstallReferrerClient.newBuilder(context).build() - referrerClient = client - - client.startConnection( - object : InstallReferrerStateListener { - override fun onInstallReferrerSetupFinished(responseCode: Int) { - when (responseCode) { - InstallReferrerClient.InstallReferrerResponse.OK -> { - // Connection established. - val installReferrerResponse = try { - client.installReferrer.installReferrer - } catch (e: RemoteException) { - // We can't do anything about this. - logger.error("Failed to retrieve install referrer response", e) - null - } catch (e: SecurityException) { - // https://issuetracker.google.com/issues/72926755 - logger.error("Failed to retrieve install referrer response", e) - null - } - - val distributionIdManager = context.components.distributionIdManager - - if (!installReferrerResponse.isNullOrBlank()) { - response = installReferrerResponse - val utmParams = - UTMParams.parseUTMParameters(installReferrerResponse) - - context.settings().isUserMetaAttributed = isMetaAttribution(installReferrerResponse) - - distributionIdManager.updateDistributionIdFromUtmParams(utmParams) - CoroutineScope(Dispatchers.IO).launch { - distributionIdManager.startAdjustIfSkippingConsentScreen() - } - } - - CoroutineScope(Dispatchers.IO).launch { - context.settings().shouldShowMarketingOnboarding = - shouldShowMarketingOnboarding( - installReferrerResponse, - distributionIdManager, - ) - } - - return - } - - InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED, - InstallReferrerClient.InstallReferrerResponse.DEVELOPER_ERROR, - InstallReferrerClient.InstallReferrerResponse.PERMISSION_ERROR, - InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE, - -> { - context.settings().shouldShowMarketingOnboarding = false - return - } - } - - // End the connection, and null out the client. - stop() - } - - override fun onInstallReferrerServiceDisconnected() { - referrerClient = null - } - }, - ) } /** * Stops the connection with the install referrer. */ fun stop() { - referrerClient?.endConnection() - referrerClient = null } /** diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/navigation/DebugDrawerRoute.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/navigation/DebugDrawerRoute.kt index abd548208c15..959565d2241b 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/navigation/DebugDrawerRoute.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/navigation/DebugDrawerRoute.kt @@ -8,7 +8,6 @@ import androidx.annotation.StringRes import androidx.compose.runtime.Composable import mozilla.components.browser.state.state.BrowserState import mozilla.components.browser.state.store.BrowserStore -import mozilla.components.concept.integrity.IntegrityClient import mozilla.components.concept.storage.CreditCardsAddressesStorage import mozilla.components.concept.storage.LoginsStorage import org.mozilla.fenix.R @@ -23,7 +22,6 @@ import org.mozilla.fenix.debugsettings.crashtools.CrashTools import org.mozilla.fenix.debugsettings.creditcards.CreditCardsTools import org.mozilla.fenix.debugsettings.gleandebugtools.GleanDebugToolsStore import org.mozilla.fenix.debugsettings.gleandebugtools.ui.GleanDebugToolsScreen -import org.mozilla.fenix.debugsettings.integrity.IntegrityTools import org.mozilla.fenix.debugsettings.llm.LlmTools import org.mozilla.fenix.debugsettings.logins.LoginsTools import org.mozilla.fenix.debugsettings.region.RegionTools @@ -86,10 +84,6 @@ enum class DebugDrawerRoute( route = "crash_debug_tools", title = R.string.crash_debug_tools_title, ), - IntegrityTools( - route = "integrity_tools", - title = R.string.integrity_debug_tools_title, - ), LlmTools( route = "llm_tools", title = R.string.llm_debug_tools_title, @@ -107,7 +101,6 @@ enum class DebugDrawerRoute( * @param loginsStorage [LoginsStorage] used to access logins for [LoginsScreen]. * @param addressesDebugRegionRepository used to control storage for [AddressesTools]. * @param creditCardsAddressesStorage used to access addresses for [AddressesTools]. - * @param integrityClient used to test an [IntegrityClient] in [IntegrityTools]. * @param inactiveTabsEnabled Whether the inactive tabs feature is enabled. * @param llm the component group [Llm]. */ @@ -120,7 +113,6 @@ enum class DebugDrawerRoute( loginsStorage: LoginsStorage, addressesDebugRegionRepository: AddressesDebugRegionRepository, creditCardsAddressesStorage: CreditCardsAddressesStorage, - integrityClient: IntegrityClient, inactiveTabsEnabled: Boolean, llm: Llm, ): List = @@ -235,14 +227,6 @@ enum class DebugDrawerRoute( CrashTools() } } - IntegrityTools -> { - onClick = { - debugDrawerStore.dispatch(DebugDrawerAction.NavigateTo.IntegrityDebugTools) - } - content = { - IntegrityTools(integrityClient) - } - } LlmTools -> { onClick = { diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/store/DebugDrawerAction.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/store/DebugDrawerAction.kt index 4719845ff56e..234bd51c9773 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/store/DebugDrawerAction.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/store/DebugDrawerAction.kt @@ -89,11 +89,6 @@ sealed class DebugDrawerAction : Action { */ object CrashDebugTools : NavigateTo() - /** - * [NavigateTo] action fired when the debug drawer needs to navigate to [IntegrityTools]. - */ - object IntegrityDebugTools : NavigateTo() - /** * [NavigateTo] action fired when the debug drawer needs to navigate to [LlmTools]. */ diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/store/DebugDrawerNavigationMiddleware.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/store/DebugDrawerNavigationMiddleware.kt index 15917e848afa..389bc3e05848 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/store/DebugDrawerNavigationMiddleware.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/store/DebugDrawerNavigationMiddleware.kt @@ -55,8 +55,6 @@ class DebugDrawerNavigationMiddleware( navController.navigate(route = DebugDrawerRoute.AddonsDebugTools.route) is DebugDrawerAction.NavigateTo.CrashDebugTools -> navController.navigate(route = DebugDrawerRoute.CrashDebugTools.route) - is DebugDrawerAction.NavigateTo.IntegrityDebugTools -> - navController.navigate(route = DebugDrawerRoute.IntegrityTools.route) is DebugDrawerAction.NavigateTo.LlmDebugTools -> navController.navigate(route = DebugDrawerRoute.LlmTools.route) is DebugDrawerAction.OnBackPressed -> navController.popBackStack() diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/ui/FenixOverlay.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/ui/FenixOverlay.kt index 4f379233e869..ff3e7e48f5d4 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/ui/FenixOverlay.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/ui/FenixOverlay.kt @@ -113,7 +113,6 @@ fun FenixOverlay( }, creditCardsAddressesStorage = context.components.core.autofillStorage, inactiveTabsEnabled = inactiveTabsEnabled, - integrityClient = context.components.integrityClient, llm = context.components.llm, ) } @@ -127,7 +126,6 @@ fun FenixOverlay( * @param loginsStorage [LoginsStorage] used to access logins for [LoginsTools]. * @param addressesDebugRegionRepository used to control storage for [AddressesTools]. * @param creditCardsAddressesStorage used to access addresses for [AddressesTools]. - * @param integrityClient used to test an [IntegrityClient]. * @param llm the component group [Llm]. * @param inactiveTabsEnabled Whether the inactive tabs feature is enabled. */ @@ -140,7 +138,6 @@ private fun FenixOverlay( loginsStorage: LoginsStorage, addressesDebugRegionRepository: AddressesDebugRegionRepository, creditCardsAddressesStorage: CreditCardsAddressesStorage, - integrityClient: IntegrityClient, llm: Llm, inactiveTabsEnabled: Boolean, ) { @@ -168,7 +165,6 @@ private fun FenixOverlay( loginsStorage = loginsStorage, addressesDebugRegionRepository = addressesDebugRegionRepository, creditCardsAddressesStorage = creditCardsAddressesStorage, - integrityClient = integrityClient, llm = llm, ) } @@ -219,7 +215,6 @@ private fun FenixOverlayPreview() { loginsStorage = FakeLoginsStorage(), addressesDebugRegionRepository = FakeAddressesDebugRegionRepository(), creditCardsAddressesStorage = FakeCreditCardsAddressesStorage(), - integrityClient = IntegrityClient.testSuccess, llm = Llm(FakeClient()), ) } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/pocket/ContentRecommendationsFeatureHelper.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/pocket/ContentRecommendationsFeatureHelper.kt index d211d3625dbf..0458e8704d5c 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/pocket/ContentRecommendationsFeatureHelper.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/pocket/ContentRecommendationsFeatureHelper.kt @@ -16,22 +16,7 @@ object ContentRecommendationsFeatureHelper { /** * List of supported content recommendations locales. */ - val CONTENT_RECOMMENDATIONS_SUPPORTED_LOCALE = listOf( - "fr", - "fr-FR", - "es", - "es-ES", - "it", - "it-IT", - "en", - "en-CA", - "en-GB", - "en-US", - "de", - "de-DE", - "de-AT", - "de-CH", - ) + val CONTENT_RECOMMENDATIONS_SUPPORTED_LOCALE = listOf() /** * Show Pocket sponsored stories in between Pocket recommended stories on home. diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/OnboardingFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/OnboardingFragment.kt index d3b5cb6187ac..61f458c19fdc 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/OnboardingFragment.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/OnboardingFragment.kt @@ -474,8 +474,7 @@ class OnboardingFragment : Fragment() { } if (!settings.isTelemetryEnabled) { - Pings.onboardingOptOut.setEnabled(true) - Pings.onboardingOptOut.submit() + Pings.onboardingOptOut.setEnabled(false) } // The marketing telemetry may be enabled after finishing onboarding. diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt index 09a40c4d935b..8a81595ebc7c 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt @@ -30,6 +30,8 @@ object SupportUtils { const val FXACCOUNT_SUMO_URL = "https://support.mozilla.org/kb/access-mozilla-services-firefox-account" const val ANDROID_SUPPORT_SUMO_URL = "mzl.la/AndroidSupport" const val RELAY_MANAGE_URL = "https://relay.firefox.com" + const val FDROID_URL = "https://f-droid.org/" + const val EFF_URL = "https://www.eff.org/" // This is locale-less on purpose so that the content negotiation happens on the AMO side because the current // user language might not be supported by AMO and/or the language might not be exactly what AMO is expecting diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index 5c3035c5b371..845f2a979282 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -174,8 +174,7 @@ class Settings( private val logger = Logger("Settings") @VisibleForTesting - internal val isCrashReportEnabledInBuild: Boolean = - BuildConfig.CRASH_REPORTING && Config.channel.isReleased + internal val isCrashReportEnabledInBuild: Boolean = false override val preferences: SharedPreferences = appContext.getSharedPreferences(FENIX_PREFERENCES, MODE_PRIVATE) @@ -199,11 +198,7 @@ class Settings( /** * Indicates if the stories homescreen section should be shown. */ - var showPocketRecommendationsFeature by lazyFeatureFlagBooleanPreference( - appContext.getPreferenceKey(R.string.pref_key_pocket_homescreen_recommendations), - featureFlag = ContentRecommendationsFeatureHelper.isContentRecommendationsFeatureEnabled(appContext), - defaultValue = { homescreenSections[HomeScreenSection.POCKET] == true }, - ) + var showPocketRecommendationsFeature = false /** * Indicates what simple toolbar shortcut key is currently selected. @@ -238,11 +233,7 @@ class Settings( /** * Indicates if the Pocket recommendations homescreen section should also show sponsored stories. */ - val showPocketSponsoredStories by lazyFeatureFlagBooleanPreference( - key = appContext.getPreferenceKey(R.string.pref_key_pocket_sponsored_stories), - defaultValue = { homescreenSections[HomeScreenSection.POCKET_SPONSORED_STORIES] == true }, - featureFlag = ContentRecommendationsFeatureHelper.isPocketSponsoredStoriesFeatureEnabled(appContext), - ) + val showPocketSponsoredStories = false /** * Indicates whether or not the "Recently Visited" section should be shown on the home screen. @@ -566,12 +557,7 @@ class Settings( default = true, ) - val isCrashReportingEnabled: Boolean - get() = isCrashReportEnabledInBuild && - preferences.getBoolean( - appContext.getPreferenceKey(R.string.pref_key_crash_reporter), - true, - ) + val isCrashReportingEnabled: Boolean = false var crashReportChoice by stringPreference( appContext.getPreferenceKey(R.string.pref_key_crash_reporting_choice), @@ -583,20 +569,11 @@ class Settings( default = false, ) - var isTelemetryEnabled by booleanPreference( - appContext.getPreferenceKey(R.string.pref_key_telemetry), - default = true, - ) + var isTelemetryEnabled = false - var isMarketingTelemetryEnabled by booleanPreference( - appContext.getPreferenceKey(R.string.pref_key_marketing_telemetry), - default = false, - ) + var isMarketingTelemetryEnabled = false - var hasMadeMarketingTelemetrySelection by booleanPreference( - appContext.getPreferenceKey(R.string.pref_key_marketing_telemetry_selection_made), - default = false, - ) + var hasMadeMarketingTelemetrySelection = false var hasAcceptedTermsOfService by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_terms_accepted), @@ -710,16 +687,9 @@ class Settings( * sure that users who upgrade and had telemetry disabled don't start sending the * daily usage ping telemetry. */ - var isDailyUsagePingEnabled by booleanPreference( - appContext.getPreferenceKey(R.string.pref_key_daily_usage_ping), - default = isTelemetryEnabled, - persistDefaultIfNotExists = true, - ) + var isDailyUsagePingEnabled = false - var isExperimentationEnabled by booleanPreference( - appContext.getPreferenceKey(R.string.pref_key_experimentation_v2), - default = isTelemetryEnabled, - ) + var isExperimentationEnabled = false /** * This lets us know if the user has disabled experimentation manually so that we know @@ -2095,10 +2065,7 @@ class Settings( /** * Indicates if the Contile functionality should be visible. */ - var showContileFeature by booleanPreference( - key = appContext.getPreferenceKey(R.string.pref_key_enable_contile), - default = true, - ) + var showContileFeature = false /** * Indicates if the Unified Search feature should be visible. diff --git a/mobile/android/fenix/app/src/main/res/xml/home_preferences.xml b/mobile/android/fenix/app/src/main/res/xml/home_preferences.xml index e1afb71a53b2..aa4c14b19436 100644 --- a/mobile/android/fenix/app/src/main/res/xml/home_preferences.xml +++ b/mobile/android/fenix/app/src/main/res/xml/home_preferences.xml @@ -13,7 +13,8 @@ android:dependency="@string/pref_key_show_top_sites" android:layout="@layout/checkbox_left_sub_preference" android:key="@string/pref_key_enable_contile" - android:title="@string/customize_toggle_contile" /> + android:title="@string/customize_toggle_contile" + app:isPreferenceVisible="false" /> + android:title="@string/customize_toggle_pocket_3" + app:isPreferenceVisible="false" /> + android:title="@string/customize_toggle_pocket_sponsored" + app:isPreferenceVisible="false" /> - - - - + android:summary="@string/preference_option_phone_feature_ask_to_allow" + app:isPreferenceVisible="false"/>