From fcee35b059f866b41145a63e131225986d21a28c Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Thu, 5 Sep 2019 18:05:37 +0200 Subject: [PATCH] [fenix] Remove ThumbnailsFeature. (https://github.com/mozilla-mobile/fenix/pull/5127) We currently do not use thumbnails anywhere in the app. Not using the feature means we are not taking thumbnails on every page load which means we are saving memory and CPU cycles. --- .../org/mozilla/fenix/browser/BrowserFragment.kt | 12 ------------ app/src/main/java/org/mozilla/fenix/ext/Session.kt | 4 +--- .../home/sessioncontrol/SessionControlComponent.kt | 4 +--- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt index 79eb039ec1..ab87d714b8 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt @@ -27,7 +27,6 @@ import kotlinx.coroutines.withContext import mozilla.appservices.places.BookmarkRoot import mozilla.components.browser.session.Session import mozilla.components.feature.readerview.ReaderViewFeature -import mozilla.components.feature.session.ThumbnailsFeature import mozilla.components.feature.sitepermissions.SitePermissions import mozilla.components.lib.state.ext.consumeFrom import mozilla.components.support.base.feature.BackHandler @@ -62,7 +61,6 @@ class BrowserFragment : BaseBrowserFragment(), BackHandler { private var quickActionSheetSessionObserver: QuickActionSheetSessionObserver? = null private val readerViewFeature = ViewBoundFeatureWrapper() - private val thumbnailsFeature = ViewBoundFeatureWrapper() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -92,16 +90,6 @@ class BrowserFragment : BaseBrowserFragment(), BackHandler { return super.initializeUI(view)?.also { - thumbnailsFeature.set( - feature = ThumbnailsFeature( - requireContext(), - view.engineView, - requireComponents.core.sessionManager - ), - owner = this, - view = view - ) - readerViewFeature.set( feature = ReaderViewFeature( requireContext(), diff --git a/app/src/main/java/org/mozilla/fenix/ext/Session.kt b/app/src/main/java/org/mozilla/fenix/ext/Session.kt index 99c063837b..a6b744cf13 100644 --- a/app/src/main/java/org/mozilla/fenix/ext/Session.kt +++ b/app/src/main/java/org/mozilla/fenix/ext/Session.kt @@ -14,7 +14,5 @@ fun Session.toTab(context: Context, selected: Boolean? = null): Tab { this.url, this.url.urlToTrimmedHost(context), this.title, - selected, - this.thumbnail - ) + selected) } diff --git a/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlComponent.kt b/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlComponent.kt index 09b6fa9339..5b796a581a 100644 --- a/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlComponent.kt +++ b/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlComponent.kt @@ -5,7 +5,6 @@ package org.mozilla.fenix.home.sessioncontrol import android.content.Context -import android.graphics.Bitmap import android.os.Parcelable import android.view.View import android.view.ViewGroup @@ -53,8 +52,7 @@ data class Tab( val url: String, val hostname: String, val title: String, - val selected: Boolean? = null, - val thumbnail: Bitmap? = null + val selected: Boolean? = null ) : Parcelable fun List.toSessionBundle(context: Context): MutableList {