From dbb01910ade94073d061e04aaceada5f12b822d0 Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Thu, 18 Aug 2022 13:29:27 -0400 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/26528 - Add a nimbus feature flag for MR Home Onboarding Dialog --- app/src/main/java/org/mozilla/fenix/utils/Settings.kt | 11 ++++++++++- app/src/main/res/values/preference_keys.xml | 4 +++- nimbus.fml.yaml | 11 ++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index 500c5c8e44..9c3d1311b0 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -1208,7 +1208,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { ) /** - * Indicates if sync on-boarding CFR should be shown + * Indicates if sync onboarding CFR should be shown. * Returns true if the [FeatureFlags.showSynCFR] and [R.string.pref_key_should_show_sync_cfr] are true. */ var showSyncCFR by lazyFeatureFlagPreference( @@ -1217,6 +1217,15 @@ class Settings(private val appContext: Context) : PreferencesHolder { default = { onboardScreenSection[OnboardingSection.SYNC_CFR] == true }, ) + /** + * Indicates if home onboarding dialog should be shown. + */ + var showHomeOnboardingDialog by lazyFeatureFlagPreference( + appContext.getPreferenceKey(R.string.pref_key_should_show_home_onboarding_dialog), + featureFlag = FeatureFlags.showHomeOnboarding, + default = { onboardScreenSection[OnboardingSection.HOME_ONBOARDING_DIALOG] == true }, + ) + /** * Indicates if the recent tabs functionality should be visible. * Returns true if the [FeatureFlags.showRecentTabsFeature] and [R.string.pref_key_recent_tabs] are true. diff --git a/app/src/main/res/values/preference_keys.xml b/app/src/main/res/values/preference_keys.xml index 0ab0608b88..07d2f0a994 100644 --- a/app/src/main/res/values/preference_keys.xml +++ b/app/src/main/res/values/preference_keys.xml @@ -235,8 +235,10 @@ pref_key_has_inactive_tabs_auto_close_dialog_dismissed pref_key_should_show_jump_back_in_tabs_popup - + pref_key_should_show_sync_cfr + + pref_key_should_show_home_onboarding_dialog pref_key_debug_settings diff --git a/nimbus.fml.yaml b/nimbus.fml.yaml index ee4c4cb592..1a5a655f04 100644 --- a/nimbus.fml.yaml +++ b/nimbus.fml.yaml @@ -47,21 +47,24 @@ features: default: { "sync-cfr": false, - "wallpapers": false + "wallpapers": false, + "home-onboarding-dialog": false, } defaults: - channel: nightly value: { "sections-enabled": { "sync-cfr": false, - "wallpapers": false + "wallpapers": false, + "home-onboarding-dialog": false, } } - channel: developer value: { "sections-enabled": { "sync-cfr": false, - "wallpapers": true + "wallpapers": true, + "home-onboarding-dialog": false, } } nimbus-validation: @@ -331,3 +334,5 @@ types: description: Sync onboarding CFR. wallpapers: description: Wallpapers onboarding dialog. + home-onboarding-dialog: + description: Home onboarding dialog for upgraded users.