android-components / / PlacesBookmarksStorage


open class PlacesBookmarksStorage : PlacesStorage, BookmarksStorage, SyncableStore (source)

Implementation of the BookmarksStorage which is backed by a Rust Places lib via PlacesApi.


Name Summary
<init> PlacesBookmarksStorage(context: <ERROR CLASS>)
Implementation of the BookmarksStorage which is backed by a Rust Places lib via PlacesApi.


Name Summary
logger open val logger: Logger

Inherited Properties

Name Summary
crashReporter val crashReporter: CrashReporting?


Name Summary
addFolder open suspend fun addFolder(parentGuid: String, title: String, position: Int?): String
Adds a new bookmark folder to a given node.
addItem open suspend fun addItem(parentGuid: String, url: String, title: String, position: Int?): String
Adds a new bookmark item to a given node.
addSeparator open suspend fun addSeparator(parentGuid: String, position: Int?): String
Adds a new bookmark separator to a given node.
deleteNode open suspend fun deleteNode(guid: String): Boolean
Deletes a bookmark node and all of its children, if any.
getBookmark open suspend fun getBookmark(guid: String): BookmarkNode?
Obtains the details of a bookmark without children, if one exists with that guid. Otherwise, null.
getBookmarksWithUrl open suspend fun getBookmarksWithUrl(url: String): List<BookmarkNode>
Produces a list of all bookmarks with the given URL.
getHandle open fun getHandle(): Long
This should be removed. See:
getTree open suspend fun getTree(guid: String, recursive: Boolean): BookmarkNode?
Produces a bookmarks tree for the given guid string.
importFromFennec fun importFromFennec(dbPath: String): <ERROR CLASS>
Import bookmarks data from Fennec’s browser.db file. Before running this, first run PlacesHistoryStorage.importFromFennec to import history and visits data.
readPinnedSitesFromFennec fun readPinnedSitesFromFennec(dbPath: String): List<BookmarkNode>
Read pinned sites from Fennec’s browser.db file.
searchBookmarks open suspend fun searchBookmarks(query: String, limit: Int): List<BookmarkNode>
Searches bookmarks with a query string.
sync suspend fun sync(authInfo: SyncAuthInfo): SyncStatus
Runs syncBookmarks() method on the places Connection
updateNode open suspend fun updateNode(guid: String, info: BookmarkInfo): Unit
Edits the properties of an existing bookmark item and/or moves an existing one underneath a new parent guid.

Inherited Functions

Name Summary
cleanup open fun cleanup(): Unit
Cleans up background work and database connections
handlePlacesExceptions fun handlePlacesExceptions(operation: String, block: () -> Unit): Unit
Runs block described by operation, ignoring non-fatal exceptions.
runMaintenance open suspend fun runMaintenance(): Unit
Internal database maintenance tasks. Ideally this should be called once a day.
syncAndHandleExceptions fun syncAndHandleExceptions(syncBlock: () -> Unit): SyncStatus
Runs a syncBlock, re-throwing any panics that may be encountered.
warmUp open suspend fun warmUp(): Unit
Make sure underlying database connections are established.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.