From 250c95eb28d2e79543ee8acf81ac69690166c189 Mon Sep 17 00:00:00 2001 From: Christian Sadilek Date: Thu, 16 Jul 2020 16:34:50 -0400 Subject: [PATCH] [fenix] Update Android Components to 51.0.20200717190031 --- app/src/main/java/org/mozilla/fenix/HomeActivity.kt | 4 ++-- .../java/org/mozilla/fenix/browser/BaseBrowserFragment.kt | 2 +- .../mozilla/fenix/customtabs/FennecWebAppIntentProcessor.kt | 4 ++-- .../home/intent/FennecBookmarkShortcutsIntentProcessor.kt | 3 ++- .../home/intent/FennecBookmarkShortcutsIntentProcessorTest.kt | 3 ++- buildSrc/src/main/java/AndroidComponents.kt | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt index 8acd3d7099..00a9911be1 100644 --- a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt @@ -33,8 +33,8 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.launch import mozilla.components.browser.search.SearchEngine -import mozilla.components.browser.session.Session import mozilla.components.browser.session.SessionManager +import mozilla.components.browser.state.state.SessionState import mozilla.components.browser.state.state.WebExtensionState import mozilla.components.browser.state.store.BrowserStore import mozilla.components.browser.tabstray.BrowserTabsTray @@ -545,7 +545,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { components.useCases.searchUseCases.newTabSearch .invoke( searchTerms, - Session.Source.USER_ENTERED, + SessionState.Source.USER_ENTERED, true, mode.isPrivate, searchEngine = engine 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 326b01b606..4750528047 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -808,7 +808,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session protected open fun removeSessionIfNeeded(): Boolean { getSessionById()?.let { session -> val sessionManager = requireComponents.core.sessionManager - return if (session.source == Session.Source.ACTION_VIEW) { + return if (session.source == SessionState.Source.ACTION_VIEW) { activity?.finish() sessionManager.remove(session) true diff --git a/app/src/main/java/org/mozilla/fenix/customtabs/FennecWebAppIntentProcessor.kt b/app/src/main/java/org/mozilla/fenix/customtabs/FennecWebAppIntentProcessor.kt index de67a087de..db76b423c6 100644 --- a/app/src/main/java/org/mozilla/fenix/customtabs/FennecWebAppIntentProcessor.kt +++ b/app/src/main/java/org/mozilla/fenix/customtabs/FennecWebAppIntentProcessor.kt @@ -11,9 +11,9 @@ import androidx.annotation.VisibleForTesting import androidx.core.content.ContextCompat import kotlinx.coroutines.runBlocking import mozilla.components.browser.session.Session -import mozilla.components.browser.session.Session.Source import mozilla.components.browser.session.SessionManager import mozilla.components.browser.state.state.CustomTabConfig +import mozilla.components.browser.state.state.SessionState import mozilla.components.concept.engine.EngineSession import mozilla.components.concept.engine.manifest.WebAppManifest import mozilla.components.concept.engine.manifest.WebAppManifestParser @@ -60,7 +60,7 @@ class FennecWebAppIntentProcessor( return if (!url.isNullOrEmpty() && matches(intent)) { val webAppManifest = runBlocking { loadManifest(safeIntent, url) } - val session = Session(url, private = false, source = Source.HOME_SCREEN) + val session = Session(url, private = false, source = SessionState.Source.HOME_SCREEN) session.webAppManifest = webAppManifest session.customTabConfig = webAppManifest?.toCustomTabConfig() ?: createFallbackCustomTabConfig() diff --git a/app/src/main/java/org/mozilla/fenix/home/intent/FennecBookmarkShortcutsIntentProcessor.kt b/app/src/main/java/org/mozilla/fenix/home/intent/FennecBookmarkShortcutsIntentProcessor.kt index fa51bcc378..cf36259568 100644 --- a/app/src/main/java/org/mozilla/fenix/home/intent/FennecBookmarkShortcutsIntentProcessor.kt +++ b/app/src/main/java/org/mozilla/fenix/home/intent/FennecBookmarkShortcutsIntentProcessor.kt @@ -9,6 +9,7 @@ import android.content.Intent.ACTION_VIEW import androidx.annotation.VisibleForTesting import mozilla.components.browser.session.Session import mozilla.components.browser.session.SessionManager +import mozilla.components.browser.state.state.SessionState import mozilla.components.concept.engine.EngineSession import mozilla.components.feature.intent.ext.putSessionId import mozilla.components.feature.intent.processing.IntentProcessor @@ -40,7 +41,7 @@ class FennecBookmarkShortcutsIntentProcessor( val url = safeIntent.dataString return if (!url.isNullOrEmpty() && matches(intent)) { - val session = Session(url, private = false, source = Session.Source.HOME_SCREEN) + val session = Session(url, private = false, source = SessionState.Source.HOME_SCREEN) sessionManager.add(session, selected = true) loadUrlUseCase(url, session, EngineSession.LoadUrlFlags.external()) diff --git a/app/src/test/java/org/mozilla/fenix/home/intent/FennecBookmarkShortcutsIntentProcessorTest.kt b/app/src/test/java/org/mozilla/fenix/home/intent/FennecBookmarkShortcutsIntentProcessorTest.kt index 34db89fb5d..8c8751d0fb 100644 --- a/app/src/test/java/org/mozilla/fenix/home/intent/FennecBookmarkShortcutsIntentProcessorTest.kt +++ b/app/src/test/java/org/mozilla/fenix/home/intent/FennecBookmarkShortcutsIntentProcessorTest.kt @@ -15,6 +15,7 @@ import io.mockk.verifyAll import kotlinx.coroutines.runBlocking import mozilla.components.browser.session.Session import mozilla.components.browser.session.SessionManager +import mozilla.components.browser.state.state.SessionState import mozilla.components.concept.engine.EngineSession import mozilla.components.feature.intent.ext.getSessionId import mozilla.components.feature.session.SessionUseCases @@ -56,7 +57,7 @@ class FennecBookmarkShortcutsIntentProcessorTest { val fennecShortcutsIntent = Intent(ACTION_FENNEC_HOMESCREEN_SHORTCUT) val testUrl = "http://mozilla.org" fennecShortcutsIntent.data = Uri.parse(testUrl) - val expectedSession = Session(testUrl, private = false, source = Session.Source.HOME_SCREEN) + val expectedSession = Session(testUrl, private = false, source = SessionState.Source.HOME_SCREEN) val wasIntentProcessed = processor.process(fennecShortcutsIntent) diff --git a/buildSrc/src/main/java/AndroidComponents.kt b/buildSrc/src/main/java/AndroidComponents.kt index 83590512ea..6315173b80 100644 --- a/buildSrc/src/main/java/AndroidComponents.kt +++ b/buildSrc/src/main/java/AndroidComponents.kt @@ -3,5 +3,5 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ object AndroidComponents { - const val VERSION = "51.0.20200717130954" + const val VERSION = "51.0.20200717190031" }