diff --git a/app/src/androidTest/java/org/mozilla/fenix/helpers/FeatureSettingsHelper.kt b/app/src/androidTest/java/org/mozilla/fenix/helpers/FeatureSettingsHelper.kt index 1fa4df11b5ad..5cb27ea94095 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/helpers/FeatureSettingsHelper.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/helpers/FeatureSettingsHelper.kt @@ -19,6 +19,7 @@ class FeatureSettingsHelper { private var isRecentlyVisitedFeatureEnabled: Boolean = settings.historyMetadataUIFeature private var isUserKnowsAboutPwasTrue: Boolean = settings.userKnowsAboutPwas private var isTCPCFREnabled: Boolean = settings.shouldShowTotalCookieProtectionCFR + private var isWallpaperOnboardingEnabled: Boolean = settings.showWallpaperOnboarding fun setPocketEnabled(enabled: Boolean) { settings.showPocketRecommendationsFeature = enabled @@ -28,6 +29,10 @@ class FeatureSettingsHelper { settings.shouldShowJumpBackInCFR = enabled } + fun setShowWallpaperOnboarding(enabled: Boolean) { + settings.showWallpaperOnboarding = enabled + } + fun setRecentTabsFeatureEnabled(enabled: Boolean) { settings.showRecentTabsFeature = enabled } @@ -65,5 +70,6 @@ class FeatureSettingsHelper { settings.historyMetadataUIFeature = isRecentlyVisitedFeatureEnabled settings.userKnowsAboutPwas = isUserKnowsAboutPwasTrue settings.shouldShowTotalCookieProtectionCFR = isTCPCFREnabled + settings.showWallpaperOnboarding = isWallpaperOnboardingEnabled } } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/CrashReportingTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/CrashReportingTest.kt index 5d1635dd69f1..21e02980b034 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/CrashReportingTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/CrashReportingTest.kt @@ -35,6 +35,7 @@ class CrashReportingTest { fun setUp() { featureSettingsHelper.setJumpBackCFREnabled(false) featureSettingsHelper.setPocketEnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) mockWebServer = MockWebServer().apply { diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt index f2a1d46d728d..62b68306d0be 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt @@ -131,6 +131,7 @@ class HomeScreenTest { fun dismissOnboardingUsingHelpTest() { val settings = activityTestRule.activity.applicationContext.settings() settings.shouldShowJumpBackInCFR = false + settings.showWallpaperOnboarding = false homeScreen { verifyWelcomeHeader() }.openThreeDotMenu { diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/NoNetworkAccessStartupTests.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/NoNetworkAccessStartupTests.kt index 2f29478572b3..d15ca51b4d06 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/NoNetworkAccessStartupTests.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/NoNetworkAccessStartupTests.kt @@ -37,6 +37,7 @@ class NoNetworkAccessStartupTests { @Before fun setUp() { featureSettingsHelper.setTCPCFREnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) } @After diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SearchTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SearchTest.kt index 32ea8a10c872..1505f869d6ce 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SearchTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SearchTest.kt @@ -66,6 +66,7 @@ class SearchTest { featureSettingsHelper.setJumpBackCFREnabled(false) featureSettingsHelper.setTCPCFREnabled(false) featureSettingsHelper.setPocketEnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) } @After diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAddonsTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAddonsTest.kt index e814821df311..d54f86e2c121 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAddonsTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAddonsTest.kt @@ -46,6 +46,7 @@ class SettingsAddonsTest { } featureSettingsHelper.setTCPCFREnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) } @After diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt index ce525f9a5913..7d7de6b43fca 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt @@ -45,6 +45,7 @@ class SettingsAdvancedTest { } featureSettingsHelper.setPocketEnabled(false) featureSettingsHelper.setTCPCFREnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) } @After diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsBasicsTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsBasicsTest.kt index 1873b3a776ae..2889b5bfb0ef 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsBasicsTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsBasicsTest.kt @@ -56,6 +56,7 @@ class SettingsBasicsTest { featureSettingsHelper.setJumpBackCFREnabled(false) featureSettingsHelper.setTCPCFREnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) } @After diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt index edcaa467b54a..db290154ebc9 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt @@ -65,6 +65,7 @@ class SettingsPrivacyTest { featureSettingsHelper.setJumpBackCFREnabled(false) featureSettingsHelper.setTCPCFREnabled(false) featureSettingsHelper.disablePwaCFR(true) + featureSettingsHelper.setShowWallpaperOnboarding(false) if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) { val autofillManager: AutofillManager = diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSearchTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSearchTest.kt index 56fbc569ac73..5e0e051053c4 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSearchTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSearchTest.kt @@ -34,6 +34,7 @@ class SettingsSearchTest { start() } featureSettingsHelper.setJumpBackCFREnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) } @After diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt index 8e08c2adfaa7..514395b2cd13 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt @@ -97,6 +97,7 @@ class SmokeTest { // disabling the new homepage pop-up that interferes with the tests. featureSettingsHelper.setJumpBackCFREnabled(false) featureSettingsHelper.setTCPCFREnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) mockWebServer = MockWebServer().apply { diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/StrictEnhancedTrackingProtectionTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/StrictEnhancedTrackingProtectionTest.kt index 191f43e2304a..0dca06a52f21 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/StrictEnhancedTrackingProtectionTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/StrictEnhancedTrackingProtectionTest.kt @@ -49,6 +49,7 @@ class StrictEnhancedTrackingProtectionTest { featureSettingsHelper.setStrictETPEnabled() featureSettingsHelper.setJumpBackCFREnabled(false) featureSettingsHelper.setTCPCFREnabled(false) + featureSettingsHelper.setShowWallpaperOnboarding(false) } @After diff --git a/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt b/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt index 09a67bcd5ab2..b8128c29fc5f 100644 --- a/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt +++ b/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlView.kt @@ -224,13 +224,12 @@ class SessionControlView( ).showSyncCFR() } } - if (!isCFRDisplayed && + + val higherPriorityCFRShown = !isCFRDisplayed && !context.settings().showHomeOnboardingDialog && - (!context.settings().shouldShowJumpBackInCFR || - !context.settings().showSyncCFR) && - context.settings().showWallpaperOnboarding -// && onboarding.userHasBeenOnboarded() - ) { + (!context.settings().shouldShowJumpBackInCFR || !context.settings().showSyncCFR) + + if (!higherPriorityCFRShown && context.settings().showWallpaperOnboarding) { interactor.showWallpapersOnboardingDialog() } diff --git a/app/src/main/java/org/mozilla/fenix/onboarding/SyncCFRPresenter.kt b/app/src/main/java/org/mozilla/fenix/onboarding/SyncCFRPresenter.kt index 5d01d678cd86..16c88ea407b7 100644 --- a/app/src/main/java/org/mozilla/fenix/onboarding/SyncCFRPresenter.kt +++ b/app/src/main/java/org/mozilla/fenix/onboarding/SyncCFRPresenter.kt @@ -37,7 +37,7 @@ class SyncCFRPresenter( /** * Find the synced view and if it is available, then show the synced tab CFR. */ - fun showSyncCFR() : Boolean { + fun showSyncCFR(): Boolean { findSyncTabsView()?.let { CFRPopup( text = context.getString(R.string.sync_cfr_message),