Commit 87a65d24 authored by Hakkı Kaan Çalışkan's avatar Hakkı Kaan Çalışkan Committed by Emily Kager
Browse files

For #9782: Clean up unused FeatureFlags

I've currently found out this ones unused.
webPushIntegration removed because looks like all fatal bugs solved as it said from note.
parent 291a29b3
...@@ -22,21 +22,8 @@ class AppRequestInterceptor(private val context: Context) : RequestInterceptor { ...@@ -22,21 +22,8 @@ class AppRequestInterceptor(private val context: Context) : RequestInterceptor {
hasUserGesture: Boolean, hasUserGesture: Boolean,
isSameDomain: Boolean isSameDomain: Boolean
): RequestInterceptor.InterceptionResponse? { ): RequestInterceptor.InterceptionResponse? {
var result: RequestInterceptor.InterceptionResponse? = null return context.components.services.appLinksInterceptor
.onLoadRequest(engineSession, uri, hasUserGesture, isSameDomain)
// WebChannel-driven authentication does not require a separate redirect interceptor.
@Suppress("ConstantConditionIf")
if (FeatureFlags.asFeatureWebChannelsDisabled) {
result = context.components.services.accountsAuthFeature.interceptor.onLoadRequest(
engineSession, uri, hasUserGesture, isSameDomain)
}
if (result == null) {
result = context.components.services.appLinksInterceptor.onLoadRequest(
engineSession, uri, hasUserGesture, isSameDomain)
}
return result
} }
override fun onErrorRequest( override fun onErrorRequest(
......
...@@ -10,25 +10,6 @@ object FeatureFlags { ...@@ -10,25 +10,6 @@ object FeatureFlags {
*/ */
const val pullToRefreshEnabled = false const val pullToRefreshEnabled = false
/**
* Disables FxA Application Services Web Channels feature
*/
const val asFeatureWebChannelsDisabled = false
/**
* Disables FxA Application Services Sync feature
*/
const val asFeatureSyncDisabled = false
/**
* Integration of push support provided by `feature-push` component into the Gecko engine.
*
* Behind nightly flag until all fatal bugs are resolved.
*
* https://github.com/mozilla-mobile/fenix/issues/9059
*/
const val webPushIntegration = true
/** /**
* Enables tip feature * Enables tip feature
*/ */
......
...@@ -37,7 +37,6 @@ import mozilla.components.support.rusthttp.RustHttpConfig ...@@ -37,7 +37,6 @@ import mozilla.components.support.rusthttp.RustHttpConfig
import mozilla.components.support.rustlog.RustLog import mozilla.components.support.rustlog.RustLog
import mozilla.components.support.utils.logElapsedTime import mozilla.components.support.utils.logElapsedTime
import mozilla.components.support.webextensions.WebExtensionSupport import mozilla.components.support.webextensions.WebExtensionSupport
import org.mozilla.fenix.FeatureFlags.webPushIntegration
import org.mozilla.fenix.components.Components import org.mozilla.fenix.components.Components
import org.mozilla.fenix.components.metrics.MetricServiceType import org.mozilla.fenix.components.metrics.MetricServiceType
import org.mozilla.fenix.ext.settings import org.mozilla.fenix.ext.settings
...@@ -239,10 +238,7 @@ open class FenixApplication : LocaleAwareApplication() { ...@@ -239,10 +238,7 @@ open class FenixApplication : LocaleAwareApplication() {
// Install the AutoPush singleton to receive messages. // Install the AutoPush singleton to receive messages.
PushProcessor.install(it) PushProcessor.install(it)
if (webPushIntegration) { WebPushEngineIntegration(components.core.engine, it).start()
// WebPush integration to observe and deliver push messages to engine.
WebPushEngineIntegration(components.core.engine, it).start()
}
// Perform a one-time initialization of the account manager if a message is received. // Perform a one-time initialization of the account manager if a message is received.
PushFxaIntegration(it, lazy { components.backgroundServices.accountManager }).launch() PushFxaIntegration(it, lazy { components.backgroundServices.accountManager }).launch()
......
...@@ -560,22 +560,19 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session ...@@ -560,22 +560,19 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
view.swipeRefresh.setOnChildScrollUpCallback { _, _ -> true } view.swipeRefresh.setOnChildScrollUpCallback { _, _ -> true }
} }
@Suppress("ConstantConditionIf") webchannelIntegration.set(
if (!FeatureFlags.asFeatureWebChannelsDisabled) { feature = FxaWebChannelFeature(
webchannelIntegration.set( requireContext(),
feature = FxaWebChannelFeature( customTabSessionId,
requireContext(), requireComponents.core.engine,
customTabSessionId, requireComponents.core.store,
requireComponents.core.engine, requireComponents.backgroundServices.accountManager,
requireComponents.core.store, requireComponents.backgroundServices.serverConfig,
requireComponents.backgroundServices.accountManager, setOf(FxaCapability.CHOOSE_WHAT_TO_SYNC)
requireComponents.backgroundServices.serverConfig, ),
setOf(FxaCapability.CHOOSE_WHAT_TO_SYNC) owner = this,
), view = view
owner = this, )
view = view
)
}
initializeEngineView(toolbarHeight) initializeEngineView(toolbarHeight)
} }
......
...@@ -84,20 +84,12 @@ class BackgroundServices( ...@@ -84,20 +84,12 @@ class BackgroundServices(
// If sync has been turned off on the server then disable syncing. // If sync has been turned off on the server then disable syncing.
@Suppress("ConstantConditionIf") @Suppress("ConstantConditionIf")
@VisibleForTesting(otherwise = PRIVATE) @VisibleForTesting(otherwise = PRIVATE)
val syncConfig = if (FeatureFlags.asFeatureSyncDisabled) { val supportedEngines = if (FeatureFlags.syncedTabs) {
null setOf(SyncEngine.History, SyncEngine.Bookmarks, SyncEngine.Passwords, SyncEngine.Tabs)
} else { } else {
setOf(SyncEngine.History, SyncEngine.Bookmarks, SyncEngine.Passwords)
val supportedEngines = if (FeatureFlags.syncedTabs) {
setOf(SyncEngine.History, SyncEngine.Bookmarks, SyncEngine.Passwords, SyncEngine.Tabs)
} else {
setOf(SyncEngine.History, SyncEngine.Bookmarks, SyncEngine.Passwords)
}
SyncConfig(
supportedEngines,
syncPeriodInMinutes = 240L) // four hours
} }
private val syncConfig = SyncConfig(supportedEngines, syncPeriodInMinutes = 240L) // four hours
init { init {
/* Make the "history", "bookmark", "passwords", and "tabs" stores accessible to workers /* Make the "history", "bookmark", "passwords", and "tabs" stores accessible to workers
......
...@@ -6,7 +6,6 @@ package org.mozilla.fenix.components ...@@ -6,7 +6,6 @@ package org.mozilla.fenix.components
import android.content.Context import android.content.Context
import mozilla.components.service.fxa.ServerConfig import mozilla.components.service.fxa.ServerConfig
import mozilla.components.service.fxa.ServerConfig.Server import mozilla.components.service.fxa.ServerConfig.Server
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.ext.settings import org.mozilla.fenix.ext.settings
/** /**
...@@ -14,22 +13,16 @@ import org.mozilla.fenix.ext.settings ...@@ -14,22 +13,16 @@ import org.mozilla.fenix.ext.settings
*/ */
object FxaServer { object FxaServer {
const val CLIENT_ID = "a2270f727f45f648" private const val CLIENT_ID = "a2270f727f45f648"
const val REDIRECT_URL = "https://accounts.firefox.com/oauth/success/$CLIENT_ID"
@Suppress("ConstantConditionIf", "UNUSED_PARAMETER") fun redirectUrl() = "urn:ietf:wg:oauth:2.0:oob:oauth-redirect-webchannel"
fun redirectUrl(context: Context) = if (FeatureFlags.asFeatureWebChannelsDisabled) {
REDIRECT_URL
} else {
"urn:ietf:wg:oauth:2.0:oob:oauth-redirect-webchannel"
}
fun config(context: Context): ServerConfig { fun config(context: Context): ServerConfig {
val serverOverride = context.settings().overrideFxAServer val serverOverride = context.settings().overrideFxAServer
val tokenServerOverride = context.settings().overrideSyncTokenServer.ifEmpty { null } val tokenServerOverride = context.settings().overrideSyncTokenServer.ifEmpty { null }
if (serverOverride.isEmpty()) { if (serverOverride.isEmpty()) {
return ServerConfig(Server.RELEASE, CLIENT_ID, redirectUrl(context), tokenServerOverride) return ServerConfig(Server.RELEASE, CLIENT_ID, redirectUrl(), tokenServerOverride)
} }
return ServerConfig(serverOverride, CLIENT_ID, redirectUrl(context), tokenServerOverride) return ServerConfig(serverOverride, CLIENT_ID, redirectUrl(), tokenServerOverride)
} }
} }
...@@ -26,7 +26,7 @@ class Services( ...@@ -26,7 +26,7 @@ class Services(
private val accountManager: FxaAccountManager private val accountManager: FxaAccountManager
) { ) {
val accountsAuthFeature by lazy { val accountsAuthFeature by lazy {
FirefoxAccountsAuthFeature(accountManager, FxaServer.redirectUrl(context)) { context, authUrl -> FirefoxAccountsAuthFeature(accountManager, FxaServer.redirectUrl()) { context, authUrl ->
CoroutineScope(Dispatchers.Main).launch { CoroutineScope(Dispatchers.Main).launch {
val intent = SupportUtils.createAuthCustomTabIntent(context, authUrl) val intent = SupportUtils.createAuthCustomTabIntent(context, authUrl)
context.startActivity(intent) context.startActivity(intent)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment