android-components / / PlacesHistoryStorage


open class PlacesHistoryStorage : PlacesStorage, HistoryStorage, SyncableStore (source)

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


Name Summary
<init> PlacesHistoryStorage(context: <ERROR CLASS>, crashReporter: CrashReporting? = null)
Implementation of the HistoryStorage 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
deleteEverything open suspend fun deleteEverything(): Unit
Sync behaviour: will not remove any history from remote devices, but it will prevent deleted history from returning.
deleteVisit open suspend fun deleteVisit(url: String, timestamp: Long): Unit
Sync behaviour: will remove history from remote devices if this was the only visit for url. Otherwise, remote devices are not affected.
deleteVisitsBetween open suspend fun deleteVisitsBetween(startTime: Long, endTime: Long): Unit
Sync behaviour: may remove history from remote devices, if the removed visits were the only ones for a URL.
deleteVisitsFor open suspend fun deleteVisitsFor(url: String): Unit
Sync behaviour: will remove history from remote devices.
deleteVisitsSince open suspend fun deleteVisitsSince(since: Long): Unit
Sync behaviour: may remove history from remote devices, if the removed visits were the only ones for a URL.
getAutocompleteSuggestion open fun getAutocompleteSuggestion(query: String): HistoryAutocompleteResult?
Retrieves domain suggestions which best match the query.
getDetailedVisits open suspend fun getDetailedVisits(start: Long, end: Long, excludeTypes: List<VisitType>): List<VisitInfo>
Retrieves detailed information about all visits that occurred in the given time range.
getHandle open fun getHandle(): Long
This should be removed. See:
getSuggestions open fun getSuggestions(query: String, limit: Int): List<SearchResult>
Retrieves suggestions matching the query.
getTopFrecentSites open suspend fun getTopFrecentSites(numItems: Int): List<TopFrecentSiteInfo>
Returns a list of the top frecent site infos limited by the given number of items sorted by most to least frecent.
getVisited open suspend fun getVisited(uris: List<String>): List<Boolean>
Maps a list of page URIs to a list of booleans indicating if each URI was suspend fun getVisited(): List<String>
Retrieves a list of all visited pages.
getVisitsPaginated open suspend fun getVisitsPaginated(offset: Long, count: Long, excludeTypes: List<VisitType>): List<VisitInfo>
Return a “page” of history results. Each page will have visits in descending order with respect to their visit timestamps. In the case of ties, their row id will be used.
importFromFennec fun importFromFennec(dbPath: String): <ERROR CLASS>
Import history and visits data from Fennec’s browser.db file.
prune open suspend fun prune(): Unit
Should only be called in response to severe disk storage pressure. May delete all of the data, or some subset of it. Sync behaviour: will not remove history from remote clients.
recordObservation open suspend fun recordObservation(uri: String, observation: PageObservation): Unit
Records an observation about a page.
recordVisit open suspend fun recordVisit(uri: String, visit: PageVisit): Unit
Records a visit to a page.
sync suspend fun sync(authInfo: SyncAuthInfo): SyncStatus
Runs syncHistory() method on the places Connection

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.