android-components / mozilla.components.feature.addons.update / AddonUpdater

AddonUpdater

interface AddonUpdater (source)

Contract to define the behavior for updating addons.

Types

Name Summary
Frequency class Frequency
Indicates how often an extension should be updated.
Status sealed class Status
Indicates the status of a request for updating an addon.

Functions

Name Summary
onUpdatePermissionRequest abstract fun onUpdatePermissionRequest(current: WebExtension, updated: WebExtension, newPermissions: List<String>, onPermissionsGranted: (Boolean) -> Unit): Unit
Invoked when a web extension has changed its permissions while trying to update to a new version. This requires user interaction as the updated extension will not be installed, until the user grants the new permissions.
registerForFutureUpdates abstract fun registerForFutureUpdates(addonId: String): Unit
Registers the given addonId for periodically check for new updates.
unregisterForFutureUpdates abstract fun unregisterForFutureUpdates(addonId: String): Unit
Unregisters the given addonId for periodically checking for new updates.
update abstract fun update(addonId: String): Unit
Try to perform an update on the given addonId.

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.

Inheritors

Name Summary
DefaultAddonUpdater class DefaultAddonUpdater : AddonUpdater
An implementation of AddonUpdater that uses the work manager api for scheduling new updates.