1
0
Fork 0

Enable fennec Pinned Sites migration

master
Grisha Kruglov 3 years ago committed by Sebastian Kaspari
parent e73b3cfbec
commit 7a272a4564
  1. 8
      app/src/main/java/org/mozilla/fenix/components/TopSiteStorage.kt
  2. 5
      app/src/migration/java/org/mozilla/fenix/MigratingFenixApplication.kt

@ -14,7 +14,7 @@ import org.mozilla.fenix.test.Mockable
class TopSiteStorage(private val context: Context) {
var cachedTopSites = listOf<TopSite>()
private val topSiteStorage by lazy {
val storage by lazy {
TopSiteStorage(context)
}
@ -22,20 +22,20 @@ class TopSiteStorage(private val context: Context) {
* Adds a new [TopSite].
*/
fun addTopSite(title: String, url: String) {
topSiteStorage.addTopSite(title, url)
storage.addTopSite(title, url)
}
/**
* Returns a [LiveData] list of all the [TopSite] instances.
*/
fun getTopSites(): LiveData<List<TopSite>> {
return topSiteStorage.getTopSites()
return storage.getTopSites()
}
/**
* Removes the given [TopSite].
*/
fun removeTopSite(topSite: TopSite) {
topSiteStorage.removeTopSite(topSite)
storage.removeTopSite(topSite)
}
}

@ -16,7 +16,10 @@ class MigratingFenixApplication : FenixApplication() {
FennecMigrator.Builder(this, this.components.analytics.crashReporter)
.migrateOpenTabs(this.components.core.sessionManager)
.migrateHistory(this.components.core.historyStorage)
.migrateBookmarks(this.components.core.bookmarksStorage)
.migrateBookmarks(
this.components.core.bookmarksStorage,
this.components.core.topSiteStorage.storage
)
.migrateLogins(
this.components.core.asyncPasswordsStorage,
this.components.core.passwordsEncryptionKey

Loading…
Cancel
Save