From 7ef7a37e241e2b027a8a67e1812f955ab8bbbe1c Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Thu, 6 Jan 2022 01:08:00 -0500 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/23076 - Clean up unneeded FeatureFlags --- .../java/org/mozilla/fenix/FeatureFlags.kt | 15 ----------- .../fenix/browser/BaseBrowserFragment.kt | 2 +- .../mozilla/fenix/browser/BrowserFragment.kt | 25 ++++++++----------- .../java/org/mozilla/fenix/home/HomeMenu.kt | 3 +-- 4 files changed, 13 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt index 7f02df8673..b4cac70a9b 100644 --- a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt +++ b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt @@ -23,16 +23,6 @@ object FeatureFlags { */ val addressesFeature = Config.channel.isNightlyOrDebug - /** - * Enables WebAuthn support. - */ - const val webAuthFeature = true - - /** - * Enables the Home button in the browser toolbar to navigate back to the home screen. - */ - const val showHomeButtonFeature = true - /** * Enables the Start On Home feature in the settings page. */ @@ -63,11 +53,6 @@ object FeatureFlags { */ const val showHomeBehindSearch = true - /** - * Enables customizing the home screen - */ - const val customizeHome = true - /** * Identifies and separates the tabs list with a group containing search term tabs. */ diff --git a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index 1615ec2c0b..5fa48ebd36 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -694,7 +694,7 @@ abstract class BaseBrowserFragment : ) // This component feature only works on Fenix when built on Mozilla infrastructure. - if (FeatureFlags.webAuthFeature && BuildConfig.MOZILLA_OFFICIAL) { + if (BuildConfig.MOZILLA_OFFICIAL) { webAuthnFeature.set( feature = WebAuthnFeature( engine = requireComponents.core.engine, diff --git a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt index d1b44d2a76..da88c59392 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt @@ -26,12 +26,11 @@ import mozilla.components.feature.tab.collections.TabCollection import mozilla.components.feature.tabs.WindowFeature import mozilla.components.support.base.feature.UserInteractionHandler import mozilla.components.support.base.feature.ViewBoundFeatureWrapper -import org.mozilla.fenix.FeatureFlags import org.mozilla.fenix.R import org.mozilla.fenix.components.FenixSnackbar import org.mozilla.fenix.components.TabCollectionStorage -import org.mozilla.fenix.components.toolbar.ToolbarMenu import org.mozilla.fenix.components.metrics.Event +import org.mozilla.fenix.components.toolbar.ToolbarMenu import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.nav import org.mozilla.fenix.ext.requireComponents @@ -72,19 +71,17 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { ) } - if (FeatureFlags.showHomeButtonFeature) { - val homeAction = BrowserToolbar.Button( - imageDrawable = AppCompatResources.getDrawable( - context, - R.drawable.mozac_ic_home - )!!, - contentDescription = context.getString(R.string.browser_toolbar_home), - iconTintColorResource = ThemeManager.resolveAttribute(R.attr.primaryText, context), - listener = browserToolbarInteractor::onHomeButtonClicked - ) + val homeAction = BrowserToolbar.Button( + imageDrawable = AppCompatResources.getDrawable( + context, + R.drawable.mozac_ic_home + )!!, + contentDescription = context.getString(R.string.browser_toolbar_home), + iconTintColorResource = ThemeManager.resolveAttribute(R.attr.primaryText, context), + listener = browserToolbarInteractor::onHomeButtonClicked + ) - browserToolbarView.view.addNavigationAction(homeAction) - } + browserToolbarView.view.addNavigationAction(homeAction) if (resources.getBoolean(R.bool.tablet)) { val enableTint = ThemeManager.resolveAttribute(R.attr.primaryText, context) diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt b/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt index 9b161ba824..126e0df77e 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt @@ -23,7 +23,6 @@ import mozilla.components.concept.sync.AccountObserver import mozilla.components.concept.sync.AuthType import mozilla.components.concept.sync.OAuthAccount import mozilla.components.support.ktx.android.content.getColorFromAttr -import org.mozilla.fenix.FeatureFlags import org.mozilla.fenix.R import org.mozilla.fenix.components.accounts.AccountState import org.mozilla.fenix.components.accounts.FenixAccountManager @@ -209,7 +208,7 @@ class HomeMenu( BrowserMenuDivider(), whatsNewItem, helpItem, - if (FeatureFlags.customizeHome) customizeHomeItem else null, + customizeHomeItem, settingsItem, if (settings.shouldDeleteBrowsingDataOnQuit) quitItem else null ).also { items ->