android-components / mozilla.components.browser.session.storage / AutoSave

AutoSave

class AutoSave (source)

Types

Name Summary
Storage interface Storage

Constructors

Name Summary
<init> AutoSave(sessionManager: SessionManager, sessionStorage: Storage, minimumIntervalMs: Long)

Functions

Name Summary
periodicallyInForeground fun periodicallyInForeground(interval: Long = 300, unit: TimeUnit = TimeUnit.SECONDS, scheduler: ScheduledExecutorService = Executors.newSingleThreadScheduledExecutor(), lifecycle: Lifecycle = ProcessLifecycleOwner.get().lifecycle): AutoSave
Saves the state periodically when the app is in the foreground.
whenGoingToBackground fun whenGoingToBackground(lifecycle: Lifecycle = ProcessLifecycleOwner.get().lifecycle): AutoSave
Saves the state automatically when the app goes to the background.
whenSessionsChange fun whenSessionsChange(): AutoSave
Saves the state automatically when the sessions change, e.g. sessions get added and removed.

Companion Object Properties

Name Summary
DEFAULT_INTERVAL_MILLISECONDS const val DEFAULT_INTERVAL_MILLISECONDS: Long