Table of Contents

Interface IAppUpdaterProvider

Namespace
VpnHood.AppLib.Abstractions.Updaters
Assembly
VpnHood.AppLib.Abstractions.dll

The updater of the channel this copy came from: a store's, or the app's own where no store updates it (the website's APK). Each finds and applies the newer version its own way; the app asks it, shows what it reports and passes the person's presses on. Every call gets the feed's newer release: the app's own updater takes it, a store ignores it. Each call takes the window, or null where none is open, as in the desktop service: a provider that needs one throws UiContextNotAvailableException, and the check waits for one that has it.

public interface IAppUpdaterProvider

Properties

HasOwnScreen

Gets a value indicating whether a store's own screen shows the update, where the person decides: the check opens it by itself after a delay, the store's offer keeps the feed's notice away, and its "none" before a connect waits for the connect; otherwise, the app's notice offers the update, which starts at the person's press, or by itself where the channel's automatic update is on (IsAutomaticUpdateSupported).

bool HasOwnScreen { get; }

Property Value

bool

IsAutomaticUpdateSupported

Gets a value indicating whether the app turns the channel's automatic update on and off, as a desktop's own updater does; a store's is the store's own setting.

bool IsAutomaticUpdateSupported { get; }

Property Value

bool

IsInstalling

Gets a value indicating whether an install the app runs itself, and waits on, is under way, which stops the app once it puts the new version in; the app refuses connects meanwhile.

bool IsInstalling { get; }

Property Value

bool

Remarks

It is a desktop's: a store's install and Android's package installer are the system's, which stops the app itself.

Methods

Check(AppRelease?, IUiContext?, CancellationToken)

Asks the channel for an update now, which may take the network.

Task<AppUpdateState> Check(AppRelease? feedRelease, IUiContext? uiContext, CancellationToken cancellationToken)

Parameters

feedRelease AppRelease

The feed's newer release, or null.

uiContext IUiContext

The app's window, or null where none is open.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<AppUpdateState>

A task whose result is the update as it stands.

Exceptions

UiContextNotAvailableException

uiContext is null, and the channel needs a window, as a store's.

TimeoutException

The store did not answer its query in time, as Google Play's.

NotSupportedException

The store needs a desktop window, which the UI context is not, as the Microsoft Store's.

OperationCanceledException

cancellationToken was canceled.

CompleteUpdate(AppRelease?, IUiContext?, CancellationToken)

Installs the downloaded update: the person's Install, where the channel stops after the download.

Task CompleteUpdate(AppRelease? feedRelease, IUiContext? uiContext, CancellationToken cancellationToken)

Parameters

feedRelease AppRelease

The feed's newer release, or null.

uiContext IUiContext

The app's window, or null where none is open.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that completes once the install has started, or, where the system must first let the app install apps (IsInstallPermissionNeeded), once the system's page for it is open.

Exceptions

NotSupportedException

The channel has no such step.

InvalidOperationException

There is no newer version, or its update is not downloaded.

UiContextNotAvailableException

The channel needs a compatible UI context, as Android's, and uiContext is null or not one.

OperationCanceledException

cancellationToken was canceled.

GetState(AppRelease?)

Gets the update as it stands, which the notice reads whenever it refreshes: it takes no network. With no release, what an earlier one left behind goes.

AppUpdateState GetState(AppRelease? feedRelease)

Parameters

feedRelease AppRelease

The feed's newer release, or null.

Returns

AppUpdateState

The update's state; none where the channel does not update this copy, whose notice keeps the feed's link.

IsAutomaticUpdateOn(CancellationToken)

Gets whether the automatic update is on, read where the platform keeps it each time, as its installer and its own tools change it too.

Task<bool> IsAutomaticUpdateOn(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<bool>

A task whose result is true where it is on.

Exceptions

NotSupportedException

The channel has no such switch.

OperationCanceledException

cancellationToken was canceled.

ResumeUpdate(IUiContext, CancellationToken)

Brings back the screen of an update the person started and left before it finished; the app asks it with a window in front, apart from the checks' interval.

Task<bool> ResumeUpdate(IUiContext uiContext, CancellationToken cancellationToken)

Parameters

uiContext IUiContext

The app's window.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<bool>

A task whose result is false where there is no such update.

Exceptions

TimeoutException

The store did not answer its query in time, as Google Play's.

OperationCanceledException

cancellationToken was canceled.

SetAutomaticUpdate(bool, CancellationToken)

Turns the automatic update on or off; off stops only the automatic update, as the person's check, Update and Install still work.

Task SetAutomaticUpdate(bool isOn, CancellationToken cancellationToken)

Parameters

isOn bool

true to turn it on.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that completes once it is set.

Exceptions

NotSupportedException

The channel has no such switch.

InvalidOperationException

The platform's command failed, as Linux's systemctl.

OperationCanceledException

cancellationToken was canceled.

StartUpdate(AppRelease?, IUiContext?, CancellationToken)

Starts the update: the person's Update, or the store's screen the check opens.

Task StartUpdate(AppRelease? feedRelease, IUiContext? uiContext, CancellationToken cancellationToken)

Parameters

feedRelease AppRelease

The feed's newer release, or null.

uiContext IUiContext

The app's window, or null where none is open.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that completes at the channel's own stage: once the download has begun, where the app downloads the update; once the store's page is open, as the App Store's; once the store's update flow has ended, installed or dismissed, as Google Play's; or once the store's own download and install have ended, as the Microsoft Store's.

Exceptions

InvalidOperationException

There is no newer version to update to, the store has none to show, the store's update failed, or the release's package is not on https, as the desktop's refuses.

NotSupportedException

This copy cannot take the release, as the website's APK refuses a package that is not on https, or the store needs a desktop window, which the UI context is not, as the Microsoft Store's.

TimeoutException

The store did not answer its query in time, as Google Play's.

UiContextNotAvailableException

uiContext is null, and the channel needs a window, as a store's.

OperationCanceledException

cancellationToken was canceled.