From 52ba006fa027f7c91c5d7f5a9d228df99e3e583b Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Tue, 15 Mar 2022 02:05:36 -0400 Subject: [PATCH] Issue #11864: Enable UnusedPrivateMember rule for detekt --- .../engine/gecko/GeckoEngineSession.kt | 11 -------- .../engine/system/SystemEngineSessionState.kt | 11 -------- .../components/browser/storage/sync/Types.kt | 2 -- .../feature/accounts/FxaWebChannelFeature.kt | 3 --- .../accounts/FxaWebChannelFeatureTest.kt | 13 +++++---- .../intent/processing/TabIntentProcessor.kt | 3 --- .../processing/TabIntentProcessorTest.kt | 27 +++++++++---------- .../prompts/dialog/SaveLoginDialogFragment.kt | 6 ----- .../prompts/widget/MonthAndYearPicker.kt | 1 - .../tab/collections/TabCollectionStorage.kt | 2 -- .../InlineAutocompleteEditText.kt | 3 +-- config/detekt.yml | 2 +- docs/changelog.md | 6 +++++ .../samples/browser/DefaultComponents.kt | 2 +- .../org/mozilla/samples/sync/MainActivity.kt | 2 -- .../samples/toolbar/ToolbarActivity.kt | 4 ++- 16 files changed, 30 insertions(+), 68 deletions(-) diff --git a/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt b/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt index 007b910866d..f82ecaed073 100644 --- a/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt +++ b/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt @@ -796,17 +796,6 @@ class GeckoEngineSession( } } - private fun recoverGeckoSession() { - // Recover the GeckoSession after the process getting killed or crashing. We create a - // new underlying GeckoSession. - // Eventually we may be able to re-use the same GeckoSession by re-opening it. However - // that seems to have caused issues: - // https://github.com/mozilla-mobile/android-components/issues/3640 - - geckoSession.close() - createGeckoSession() - } - override fun onFullScreen(session: GeckoSession, fullScreen: Boolean) { notifyObservers { onFullScreenChange(fullScreen) } } diff --git a/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineSessionState.kt b/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineSessionState.kt index c71e8206e04..49da6cf95a4 100644 --- a/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineSessionState.kt +++ b/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineSessionState.kt @@ -66,17 +66,6 @@ private fun JsonReader.toBundle(): Bundle { return bundle } -private fun shouldSerialize(value: Any?): Boolean { - // For now we only persist primitive types - // https://github.com/mozilla-mobile/android-components/issues/279 - return when (value) { - is Number -> true - is Boolean -> true - is String -> true - else -> false - } -} - private fun JSONObject.toBundle(): Bundle { val bundle = Bundle() diff --git a/components/browser/storage-sync/src/main/java/mozilla/components/browser/storage/sync/Types.kt b/components/browser/storage-sync/src/main/java/mozilla/components/browser/storage/sync/Types.kt index 6e6d6ebe6e5..83d699c3d71 100644 --- a/components/browser/storage-sync/src/main/java/mozilla/components/browser/storage/sync/Types.kt +++ b/components/browser/storage-sync/src/main/java/mozilla/components/browser/storage/sync/Types.kt @@ -99,8 +99,6 @@ internal fun mozilla.appservices.places.uniffi.VisitTransition.into() = when (th mozilla.appservices.places.uniffi.VisitTransition.FRAMED_LINK -> VisitType.FRAMED_LINK } -private val intToVisitType: Map = VisitType.values().associateBy(VisitType::type) - internal fun mozilla.appservices.places.uniffi.HistoryVisitInfo.into(): VisitInfo { return VisitInfo( url = this.url, diff --git a/components/feature/accounts/src/main/java/mozilla/components/feature/accounts/FxaWebChannelFeature.kt b/components/feature/accounts/src/main/java/mozilla/components/feature/accounts/FxaWebChannelFeature.kt index 4f1e51e4141..04e4133bff0 100644 --- a/components/feature/accounts/src/main/java/mozilla/components/feature/accounts/FxaWebChannelFeature.kt +++ b/components/feature/accounts/src/main/java/mozilla/components/feature/accounts/FxaWebChannelFeature.kt @@ -4,7 +4,6 @@ package mozilla.components.feature.accounts -import android.content.Context import androidx.annotation.VisibleForTesting import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -51,7 +50,6 @@ enum class FxaCapability { * For more information https://github.com/mozilla/fxa/blob/master/packages/fxa-content-server/docs/relier-communication-protocols/fx-webchannel.md * This feature uses a web extension to communicate with FxA Web Content. * - * @property context a reference to the context. * @property customTabSessionId optional custom tab session ID, if feature is being used with a custom tab. * @property runtime the [WebExtensionRuntime] (e.g the browser engine) to use. * @property store a reference to the application's [BrowserStore]. @@ -59,7 +57,6 @@ enum class FxaCapability { * @property fxaCapabilities a set of [FxaCapability] that client supports. */ class FxaWebChannelFeature( - private val context: Context, private val customTabSessionId: String?, private val runtime: WebExtensionRuntime, private val store: BrowserStore, diff --git a/components/feature/accounts/src/test/java/mozilla/components/feature/accounts/FxaWebChannelFeatureTest.kt b/components/feature/accounts/src/test/java/mozilla/components/feature/accounts/FxaWebChannelFeatureTest.kt index 18c1bc85bea..40fe978fa12 100644 --- a/components/feature/accounts/src/test/java/mozilla/components/feature/accounts/FxaWebChannelFeatureTest.kt +++ b/components/feature/accounts/src/test/java/mozilla/components/feature/accounts/FxaWebChannelFeatureTest.kt @@ -27,7 +27,6 @@ import mozilla.components.support.test.any import mozilla.components.support.test.argumentCaptor import mozilla.components.support.test.eq import mozilla.components.support.test.mock -import mozilla.components.support.test.robolectric.testContext import mozilla.components.support.test.whenever import mozilla.components.support.webextensions.WebExtensionController import org.json.JSONException @@ -59,7 +58,7 @@ class FxaWebChannelFeatureTest { val store: BrowserStore = mock() val accountManager: FxaAccountManager = mock() val serverConfig: ServerConfig = mock() - val webchannelFeature = FxaWebChannelFeature(testContext, null, engine, store, accountManager, serverConfig) + val webchannelFeature = FxaWebChannelFeature(null, engine, store, accountManager, serverConfig) webchannelFeature.start() val onSuccess = argumentCaptor<((WebExtension) -> Unit)>() @@ -90,7 +89,7 @@ class FxaWebChannelFeatureTest { val accountManager: FxaAccountManager = mock() val serverConfig: ServerConfig = mock() val controller: WebExtensionController = mock() - val webchannelFeature = FxaWebChannelFeature(testContext, null, engine, store, accountManager, serverConfig) + val webchannelFeature = FxaWebChannelFeature(null, engine, store, accountManager, serverConfig) webchannelFeature.extensionController = controller @@ -106,7 +105,7 @@ class FxaWebChannelFeatureTest { val accountManager: FxaAccountManager = mock() val serverConfig: ServerConfig = mock() val controller: WebExtensionController = mock() - val webchannelFeature = FxaWebChannelFeature(testContext, null, engine, store, accountManager, serverConfig) + val webchannelFeature = FxaWebChannelFeature(null, engine, store, accountManager, serverConfig) whenever(serverConfig.contentUrl).thenReturn("https://foo.bar") webchannelFeature.extensionController = controller @@ -134,7 +133,7 @@ class FxaWebChannelFeatureTest { val accountManager: FxaAccountManager = mock() val serverConfig: ServerConfig = mock() val controller: WebExtensionController = mock() - val webchannelFeature = FxaWebChannelFeature(testContext, null, engine, store, accountManager, serverConfig) + val webchannelFeature = FxaWebChannelFeature(null, engine, store, accountManager, serverConfig) whenever(serverConfig.contentUrl).thenReturn(Server.RELEASE.contentUrl) webchannelFeature.extensionController = controller @@ -163,7 +162,7 @@ class FxaWebChannelFeatureTest { BrowserStore(initialState = BrowserState(tabs = listOf(tab), selectedTabId = tab.id)) ) - val webchannelFeature = FxaWebChannelFeature(testContext, null, engine, store, accountManager, serverConfig) + val webchannelFeature = FxaWebChannelFeature(null, engine, store, accountManager, serverConfig) webchannelFeature.extensionController = controller webchannelFeature.start() @@ -825,6 +824,6 @@ class FxaWebChannelFeatureTest { whenever(port.senderUrl()).thenReturn("https://foo.bar/email") whenever(serverConfig.contentUrl).thenReturn("https://foo.bar") - return spy(FxaWebChannelFeature(testContext, null, mock(), store, accountManager, serverConfig, fxaCapabilities)) + return spy(FxaWebChannelFeature(null, mock(), store, accountManager, serverConfig, fxaCapabilities)) } } diff --git a/components/feature/intent/src/main/java/mozilla/components/feature/intent/processing/TabIntentProcessor.kt b/components/feature/intent/src/main/java/mozilla/components/feature/intent/processing/TabIntentProcessor.kt index 040b525603a..62f32523cd6 100644 --- a/components/feature/intent/src/main/java/mozilla/components/feature/intent/processing/TabIntentProcessor.kt +++ b/components/feature/intent/src/main/java/mozilla/components/feature/intent/processing/TabIntentProcessor.kt @@ -17,7 +17,6 @@ import mozilla.components.browser.state.state.SessionState import mozilla.components.browser.state.state.externalPackage import mozilla.components.concept.engine.EngineSession.LoadUrlFlags import mozilla.components.feature.search.SearchUseCases -import mozilla.components.feature.session.SessionUseCases import mozilla.components.feature.tabs.TabsUseCases import mozilla.components.support.ktx.kotlin.isUrl import mozilla.components.support.ktx.kotlin.toNormalizedUrl @@ -28,14 +27,12 @@ import mozilla.components.support.utils.WebURLFinder * Processor for intents which should trigger session-related actions. * * @property tabsUseCases An instance of [TabsUseCases] used to open new tabs. - * @property loadUrlUseCase A reference to [SessionUseCases.DefaultLoadUrlUseCase] used to load URLs. * @property newTabSearchUseCase A reference to [SearchUseCases.NewTabSearchUseCase] to be used for * ACTION_SEND intents if the provided text is not a URL. * @property isPrivate Whether a processed intent should open a new tab as private */ class TabIntentProcessor( private val tabsUseCases: TabsUseCases, - private val loadUrlUseCase: SessionUseCases.DefaultLoadUrlUseCase, private val newTabSearchUseCase: SearchUseCases.NewTabSearchUseCase, private val isPrivate: Boolean = false ) : IntentProcessor { diff --git a/components/feature/intent/src/test/java/mozilla/components/feature/intent/processing/TabIntentProcessorTest.kt b/components/feature/intent/src/test/java/mozilla/components/feature/intent/processing/TabIntentProcessorTest.kt index 6ca9f8d33a0..4b847929784 100644 --- a/components/feature/intent/src/test/java/mozilla/components/feature/intent/processing/TabIntentProcessorTest.kt +++ b/components/feature/intent/src/test/java/mozilla/components/feature/intent/processing/TabIntentProcessorTest.kt @@ -95,8 +95,7 @@ class TabIntentProcessorTest { @Test fun `open or select tab on ACTION_VIEW intent`() { - val useCases = SessionUseCases(store) - val handler = TabIntentProcessor(TabsUseCases(store), useCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(Intent.ACTION_VIEW) whenever(intent.dataString).thenReturn("http://mozilla.org") @@ -140,8 +139,7 @@ class TabIntentProcessorTest { @Test fun `open or select tab on ACTION_MAIN intent`() { - val useCases = SessionUseCases(store) - val handler = TabIntentProcessor(TabsUseCases(store), useCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(Intent.ACTION_MAIN) whenever(intent.dataString).thenReturn("https://mozilla.org") @@ -176,8 +174,7 @@ class TabIntentProcessorTest { @Test fun `open or select tab on ACTION_NDEF_DISCOVERED intent`() { - val useCases = SessionUseCases(store) - val handler = TabIntentProcessor(TabsUseCases(store), useCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(ACTION_NDEF_DISCOVERED) whenever(intent.dataString).thenReturn("https://mozilla.org") @@ -211,7 +208,7 @@ class TabIntentProcessorTest { @Test fun `open tab on ACTION_SEND intent`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(Intent.ACTION_SEND) @@ -263,7 +260,7 @@ class TabIntentProcessorTest { @Test fun `open tab and trigger search on ACTION_SEND if text is not a URL`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val searchTerms = "mozilla android" val searchUrl = "https://localhost/?q=mozilla%20android" @@ -284,7 +281,7 @@ class TabIntentProcessorTest { @Test fun `nothing happens on ACTION_SEND if no text is provided`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(Intent.ACTION_SEND) @@ -296,7 +293,7 @@ class TabIntentProcessorTest { @Test fun `nothing happens on ACTION_SEARCH if text is empty`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(Intent.ACTION_SEARCH) @@ -308,7 +305,7 @@ class TabIntentProcessorTest { @Test fun `open tab on ACTION_SEARCH intent`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(Intent.ACTION_SEARCH) @@ -334,7 +331,7 @@ class TabIntentProcessorTest { @Test fun `open tab and trigger search on ACTION_SEARCH intent if text is not a URL`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val searchTerms = "mozilla android" val searchUrl = "https://localhost/?q=mozilla%20android" @@ -355,7 +352,7 @@ class TabIntentProcessorTest { @Test fun `nothing happens on ACTION_WEB_SEARCH if text is empty`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(Intent.ACTION_WEB_SEARCH) @@ -367,7 +364,7 @@ class TabIntentProcessorTest { @Test fun `open tab on ACTION_WEB_SEARCH intent`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val intent: Intent = mock() whenever(intent.action).thenReturn(Intent.ACTION_WEB_SEARCH) @@ -392,7 +389,7 @@ class TabIntentProcessorTest { @Test fun `open tab and trigger search on ACTION_WEB_SEARCH intent if text is not a URL`() { - val handler = TabIntentProcessor(TabsUseCases(store), sessionUseCases.loadUrl, searchUseCases.newTabSearch) + val handler = TabIntentProcessor(TabsUseCases(store), searchUseCases.newTabSearch) val searchTerms = "mozilla android" val searchUrl = "https://localhost/?q=mozilla%20android" diff --git a/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/dialog/SaveLoginDialogFragment.kt b/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/dialog/SaveLoginDialogFragment.kt index 60b311d6e0c..3a34483ecfe 100644 --- a/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/dialog/SaveLoginDialogFragment.kt +++ b/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/dialog/SaveLoginDialogFragment.kt @@ -36,7 +36,6 @@ import kotlinx.coroutines.cancelAndJoin import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.withContext -import mozilla.components.concept.storage.Login import mozilla.components.concept.storage.LoginEntry import mozilla.components.concept.storage.LoginValidationDelegate.Result import mozilla.components.feature.prompts.R @@ -45,7 +44,6 @@ import mozilla.components.support.base.log.logger.Logger import mozilla.components.support.ktx.android.content.res.resolveAttribute import mozilla.components.support.ktx.android.view.hideKeyboard import mozilla.components.support.ktx.android.view.toScope -import java.util.concurrent.CopyOnWriteArrayList import kotlin.reflect.KProperty import com.google.android.material.R as MaterialR @@ -86,10 +84,6 @@ internal class SaveLoginDialogFragment : PromptDialogFragment() { private var validateStateUpdate: Job? = null - // List of potential dupes ignoring username. We could potentially both read and write this list - // from different threads, so we are using a copy-on-write list. - private var potentialDupesList: CopyOnWriteArrayList? = null - override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { return BottomSheetDialog(requireContext(), R.style.MozDialogStyle).apply { setCancelable(true) diff --git a/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/widget/MonthAndYearPicker.kt b/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/widget/MonthAndYearPicker.kt index 93de9b854b1..c8edf49e7e1 100644 --- a/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/widget/MonthAndYearPicker.kt +++ b/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/widget/MonthAndYearPicker.kt @@ -153,7 +153,6 @@ internal class MonthAndYearPicker @JvmOverloads constructor( private const val SPEED_MONTH_SPINNER = 200L private const val SPEED_YEAR_SPINNER = 100L - private const val DEFAULT_VALUE = -1 @VisibleForTesting internal const val DEFAULT_MAX_YEAR = 9999 diff --git a/components/feature/tab-collections/src/main/java/mozilla/components/feature/tab/collections/TabCollectionStorage.kt b/components/feature/tab-collections/src/main/java/mozilla/components/feature/tab/collections/TabCollectionStorage.kt index 02d1f8fbee5..0175aff34a6 100644 --- a/components/feature/tab-collections/src/main/java/mozilla/components/feature/tab/collections/TabCollectionStorage.kt +++ b/components/feature/tab-collections/src/main/java/mozilla/components/feature/tab/collections/TabCollectionStorage.kt @@ -8,7 +8,6 @@ import android.content.Context import androidx.paging.DataSource import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map -import mozilla.components.browser.session.storage.serialize.BrowserStateReader import mozilla.components.browser.session.storage.serialize.BrowserStateWriter import mozilla.components.browser.state.state.TabSessionState import mozilla.components.feature.tab.collections.adapter.TabAdapter @@ -25,7 +24,6 @@ import java.util.UUID */ class TabCollectionStorage( context: Context, - private val reader: BrowserStateReader = BrowserStateReader(), private val writer: BrowserStateWriter = BrowserStateWriter(), private val filesDir: File = context.filesDir ) { diff --git a/components/ui/autocomplete/src/main/java/mozilla/components/ui/autocomplete/InlineAutocompleteEditText.kt b/components/ui/autocomplete/src/main/java/mozilla/components/ui/autocomplete/InlineAutocompleteEditText.kt index fd644ddd37c..58a5385d848 100644 --- a/components/ui/autocomplete/src/main/java/mozilla/components/ui/autocomplete/InlineAutocompleteEditText.kt +++ b/components/ui/autocomplete/src/main/java/mozilla/components/ui/autocomplete/InlineAutocompleteEditText.kt @@ -101,8 +101,7 @@ open class InlineAutocompleteEditText @JvmOverloads constructor( data class AutocompleteResult( val text: String, val source: String, - val totalItems: Int, - private val textFormatter: TextFormatter? = null + val totalItems: Int ) { fun startsWith(text: String): Boolean = this.text.startsWith(text) } diff --git a/config/detekt.yml b/config/detekt.yml index fe64953a798..f36015480ff 100644 --- a/config/detekt.yml +++ b/config/detekt.yml @@ -591,7 +591,7 @@ style: UnusedPrivateClass: active: true UnusedPrivateMember: - active: false + active: true allowedNames: '(_|ignored|expected|serialVersionUID)' UseAnyOrNoneInsteadOfFind: active: false diff --git a/docs/changelog.md b/docs/changelog.md index ce7fa0e889a..2c8c5f2a6eb 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -11,12 +11,18 @@ permalink: /changelog/ * [Gecko](https://github.com/mozilla-mobile/android-components/blob/main/buildSrc/src/main/java/Gecko.kt) * [Configuration](https://github.com/mozilla-mobile/android-components/blob/main/.config.yml) +* **feature-autofill** + * ⚠️ **This is a breaking change**: Removed unused `context` parameter in `FxaWebChannelFeature`. [#11864](https://github.com/mozilla-mobile/android-components/pull/11864). + * **feature-autofill** * 🚒 Bug fixed [issue #11869](https://github.com/mozilla-mobile/android-components/issues/11869) - Fix regression causing autofill to not work after unlocking the app doing the autofill or after accepting that the authenticity of the autofill target could not be verified. * **feature-contextmenu** * 🚒 Bug fixed [issue #11829](https://github.com/mozilla-mobile/android-components/pull/11830) - To make the additional note visible in landscape mode. +* **feature-intent** + * ⚠️ **This is a breaking change**: Removed unused `loadUrlUseCase` parameter in `TabIntentProcessor`. [#11864](https://github.com/mozilla-mobile/android-components/pull/11864). + * **browser-toolbar** * Removed reflective access to non-public SDK APIs controlling the sensitivity of the gesture detector following which sparingly and for very short time a pinch/spread to zoom gesture might be identified first as a scroll gesture and move the toolbar a little before snapping to it's original position. diff --git a/samples/browser/src/main/java/org/mozilla/samples/browser/DefaultComponents.kt b/samples/browser/src/main/java/org/mozilla/samples/browser/DefaultComponents.kt index c6686b795a2..d5f13ed87e7 100644 --- a/samples/browser/src/main/java/org/mozilla/samples/browser/DefaultComponents.kt +++ b/samples/browser/src/main/java/org/mozilla/samples/browser/DefaultComponents.kt @@ -235,7 +235,7 @@ open class DefaultComponents(private val applicationContext: Context) { // Intent val tabIntentProcessor by lazy { - TabIntentProcessor(tabsUseCases, sessionUseCases.loadUrl, searchUseCases.newTabSearch) + TabIntentProcessor(tabsUseCases, searchUseCases.newTabSearch) } val externalAppIntentProcessors by lazy { listOf( diff --git a/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt b/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt index 421d4231460..2e6168d1330 100644 --- a/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt +++ b/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt @@ -57,8 +57,6 @@ import org.mozilla.samples.sync.databinding.ActivityMainBinding import java.lang.Exception import kotlin.coroutines.CoroutineContext -private const val PASSWORDS_ENCRYPTION_KEY_STRENGTH = 256 - class MainActivity : AppCompatActivity(), LoginFragment.OnLoginCompleteListener, diff --git a/samples/toolbar/src/main/java/org/mozilla/samples/toolbar/ToolbarActivity.kt b/samples/toolbar/src/main/java/org/mozilla/samples/toolbar/ToolbarActivity.kt index f5e193c7890..af220533ef6 100644 --- a/samples/toolbar/src/main/java/org/mozilla/samples/toolbar/ToolbarActivity.kt +++ b/samples/toolbar/src/main/java/org/mozilla/samples/toolbar/ToolbarActivity.kt @@ -461,13 +461,16 @@ class ToolbarActivity : AppCompatActivity() { private var back = true private fun canGoForward(): Boolean = forward + @Suppress("UnusedPrivateMember") private fun canGoBack(): Boolean = back + @Suppress("UnusedPrivateMember") private fun goBack() { back = !(forward && back) forward = true } + @Suppress("UnusedPrivateMember") private fun goForward() { forward = !(back && forward) back = true @@ -522,7 +525,6 @@ class ToolbarActivity : AppCompatActivity() { companion object { private val PROGRESS_RANGE = 0..100 - private const val SPACING_SIZE_DP = 128 private const val RELOAD_STEP_SIZE = 5 } }