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 {
hasUserGesture: Boolean,
isSameDomain: Boolean
): RequestInterceptor.InterceptionResponse? {
var result: RequestInterceptor.InterceptionResponse? = null
// 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
return context.components.services.appLinksInterceptor
.onLoadRequest(engineSession, uri, hasUserGesture, isSameDomain)
}
override fun onErrorRequest(
......
......@@ -10,25 +10,6 @@ object FeatureFlags {
*/
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
*/
......
......@@ -37,7 +37,6 @@ import mozilla.components.support.rusthttp.RustHttpConfig
import mozilla.components.support.rustlog.RustLog
import mozilla.components.support.utils.logElapsedTime
import mozilla.components.support.webextensions.WebExtensionSupport
import org.mozilla.fenix.FeatureFlags.webPushIntegration
import org.mozilla.fenix.components.Components
import org.mozilla.fenix.components.metrics.MetricServiceType
import org.mozilla.fenix.ext.settings
......@@ -239,10 +238,7 @@ open class FenixApplication : LocaleAwareApplication() {
// Install the AutoPush singleton to receive messages.
PushProcessor.install(it)
if (webPushIntegration) {
// 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.
PushFxaIntegration(it, lazy { components.backgroundServices.accountManager }).launch()
......
......@@ -560,8 +560,6 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
view.swipeRefresh.setOnChildScrollUpCallback { _, _ -> true }
}
@Suppress("ConstantConditionIf")
if (!FeatureFlags.asFeatureWebChannelsDisabled) {
webchannelIntegration.set(
feature = FxaWebChannelFeature(
requireContext(),
......@@ -575,7 +573,6 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
owner = this,
view = view
)
}
initializeEngineView(toolbarHeight)
}
......
......@@ -84,20 +84,12 @@ class BackgroundServices(
// If sync has been turned off on the server then disable syncing.
@Suppress("ConstantConditionIf")
@VisibleForTesting(otherwise = PRIVATE)
val syncConfig = if (FeatureFlags.asFeatureSyncDisabled) {
null
} else {
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 {
/* Make the "history", "bookmark", "passwords", and "tabs" stores accessible to workers
......
......@@ -6,7 +6,6 @@ package org.mozilla.fenix.components
import android.content.Context
import mozilla.components.service.fxa.ServerConfig
import mozilla.components.service.fxa.ServerConfig.Server
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.ext.settings
/**
......@@ -14,22 +13,16 @@ import org.mozilla.fenix.ext.settings
*/
object FxaServer {
const val CLIENT_ID = "a2270f727f45f648"
const val REDIRECT_URL = "https://accounts.firefox.com/oauth/success/$CLIENT_ID"
private const val CLIENT_ID = "a2270f727f45f648"
@Suppress("ConstantConditionIf", "UNUSED_PARAMETER")
fun redirectUrl(context: Context) = if (FeatureFlags.asFeatureWebChannelsDisabled) {
REDIRECT_URL
} else {
"urn:ietf:wg:oauth:2.0:oob:oauth-redirect-webchannel"
}
fun redirectUrl() = "urn:ietf:wg:oauth:2.0:oob:oauth-redirect-webchannel"
fun config(context: Context): ServerConfig {
val serverOverride = context.settings().overrideFxAServer
val tokenServerOverride = context.settings().overrideSyncTokenServer.ifEmpty { null }
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(
private val accountManager: FxaAccountManager
) {
val accountsAuthFeature by lazy {
FirefoxAccountsAuthFeature(accountManager, FxaServer.redirectUrl(context)) { context, authUrl ->
FirefoxAccountsAuthFeature(accountManager, FxaServer.redirectUrl()) { context, authUrl ->
CoroutineScope(Dispatchers.Main).launch {
val intent = SupportUtils.createAuthCustomTabIntent(context, authUrl)
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