android-components / / InMemoryHistoryStorage


class InMemoryHistoryStorage : HistoryStorage (source)

An in-memory implementation of


Name Summary
<init> InMemoryHistoryStorage()
An in-memory implementation of


Name Summary
cleanup fun cleanup(): Unit
Cleans up background work and database connections
deleteEverything suspend fun deleteEverything(): Unit
Remove all locally stored data.
deleteVisit suspend fun deleteVisit(url: String, timestamp: Long): Unit
Remove a specific visit for a given url.
deleteVisitsBetween suspend fun deleteVisitsBetween(startTime: Long, endTime: Long): Unit
Remove history visits in an inclusive range from startTime to endTime.
deleteVisitsFor suspend fun deleteVisitsFor(url: String): Unit
Remove all history visits for a given url.
deleteVisitsSince suspend fun deleteVisitsSince(since: Long): Unit
Remove history visits in an inclusive range from since to now.
getAutocompleteSuggestion fun getAutocompleteSuggestion(query: String): HistoryAutocompleteResult?
Retrieves domain suggestions which best match the query.
getDetailedVisits 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.
getSuggestions fun getSuggestions(query: String, limit: Int): List<SearchResult>
Retrieves suggestions matching the query.
getVisited suspend fun getVisited(uris: List<String>): List<Boolean>
Maps a list of page URIs to a list of booleans indicating if each URI was visited.suspend fun getVisited(): List<String>
Retrieves a list of all visited pages.
getVisitsPaginated 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.
prune suspend fun prune(): Unit
Prune history storage, removing stale history.
recordObservation suspend fun recordObservation(uri: String, observation: PageObservation): Unit
Records an observation about a page.
recordVisit suspend fun recordVisit(uri: String, visit: PageVisit): Unit
Records a visit to a page.
runMaintenance suspend fun runMaintenance(): Unit
Runs internal database maintenance tasks

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.