1
0
Fork 0

No issue: Fixes compilation errors with a-c 47.0

master
Sawyer Blatz 2019-03-14 08:09:53 -07:00 committed by Jeff Boek
parent 4f6cc8efec
commit 463ab8bf79
3 changed files with 7 additions and 6 deletions

View File

@ -25,6 +25,7 @@ import mozilla.components.feature.session.HistoryDelegate
import mozilla.components.feature.session.bundling.SessionBundleStorage
import mozilla.components.lib.crash.handler.CrashHandlerService
import org.mozilla.fenix.AppRequestInterceptor
import org.mozilla.fenix.ext.components
import org.mozilla.geckoview.GeckoRuntime
import org.mozilla.geckoview.GeckoRuntimeSettings
import java.util.concurrent.TimeUnit
@ -75,8 +76,9 @@ class Core(private val context: Context) {
GeckoViewFetchClient(context, runtime)
}
val sessionStorage by lazy {
SessionBundleStorage(context, bundleLifetime = Pair(BUNDLE_LIFETIME_IN_MINUTES, TimeUnit.MINUTES))
val sessionStorage: SessionBundleStorage by lazy {
SessionBundleStorage(context, bundleLifetime = Pair(BUNDLE_LIFETIME_IN_MINUTES, TimeUnit.MINUTES),
engine = engine)
}
/**
@ -90,7 +92,7 @@ class Core(private val context: Context) {
// Restore a previous, still active bundle.
GlobalScope.launch(Dispatchers.Main) {
val snapshot = async(Dispatchers.IO) {
sessionStorage.restore()?.restoreSnapshot(engine)
sessionStorage.restore()?.restoreSnapshot()
}
// There's an active bundle with a snapshot: Feed it into the SessionManager.

View File

@ -229,7 +229,7 @@ class HomeFragment : Fragment() {
when (it) {
is SessionsAction.Select -> {
requireComponents.core.sessionStorage.archive(requireComponents.core.sessionManager)
it.archivedSession.bundle.restoreSnapshot(requireComponents.core.engine)?.apply {
it.archivedSession.bundle.restoreSnapshot()?.apply {
requireComponents.core.sessionManager.restore(this)
homeScrollView.smoothScrollTo(0, 0)
}

View File

@ -12,7 +12,6 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.android.extensions.LayoutContainer
import kotlinx.android.synthetic.main.session_bottom_sheet.view.*
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.home.sessions.ArchivedSession
class SessionBottomSheetFragment : BottomSheetDialogFragment(), LayoutContainer {
@ -76,7 +75,7 @@ class SessionBottomSheetFragment : BottomSheetDialogFragment(), LayoutContainer
is SessionType.Current -> it.titles
is SessionType.Private -> it.titles
is SessionType.Archived ->
it.archivedSession.bundle.restoreSnapshot(requireComponents.core.engine)?.let { snapshot ->
it.archivedSession.bundle.restoreSnapshot()?.let { snapshot ->
snapshot.sessions.map { item -> item.session.title }
}
}