Hemera::SoftwareManagement::SoftwareManager Class Reference

Provides access to Hemera's software management, such as updates and application installation and removal. More...

#include <HemeraSoftwareManagement/SoftwareManager>

Inheritance diagram for Hemera::SoftwareManagement::SoftwareManager:

Signals

void availableUpdatesChanged ()
 Emitted when available system and/or application updates changed. More...
 
void lastCheckForUpdatesChanged (const QDateTime &lastCheck)
 Emitted when the system is successfully checked for updates, and the last check occurrence changes. More...
 
void installedApplicationsChanged ()
 Emitted when applications are installed or removed, hence the installed applications on the system change. More...
 
- Signals inherited from Hemera::AsyncInitObject
void ready ()
 

Public Member Functions

QDateTime lastCheckForUpdates () const
 Returns the last occurrence of a check for updates. More...
 
Hemera::SoftwareManagement::ApplicationUpdates availableApplicationUpdates () const
 Returns available application updates. More...
 
Hemera::SoftwareManagement::SystemUpdate availableSystemUpdate () const
 Returns the available system update, if any. More...
 
Hemera::SoftwareManagement::ApplicationPackages installedApplications () const
 Returns all the applications installed on this system. More...
 
Hemera::OperationcheckForUpdates ()
 Checks for available application and system updates. More...
 
Hemera::OperationdownloadApplicationUpdates (const Hemera::SoftwareManagement::ApplicationUpdates &updates)
 Downloads selected application updates. More...
 
Hemera::OperationdownloadSystemUpdate ()
 Downloads the available system update. More...
 
Hemera::OperationupdateApplications (const Hemera::SoftwareManagement::ApplicationUpdates &updates)
 Updates selected applications. More...
 
Hemera::OperationupdateSystem ()
 Updates the system. More...
 

Additional Inherited Members

- Public Slots inherited from Hemera::AsyncInitObject
Hemera::Operationinit ()
 
- Protected Slots inherited from Hemera::AsyncInitObject
void setReady ()
 
void setInitError (const QString &errorName, const QString &message=QString())
 
void setOnePartIsReady ()
 
- Protected Member Functions inherited from Hemera::AsyncInitObject
void setParts (uint parts)
 

Detailed Description

Provides access to Hemera's software management, such as updates and application installation and removal.

SoftwareManager enables an application to act as a software manager, by updating the system and its applications, and installing and removing applications.

Usually, only one single SoftwareManager object should be instantiated for each application for performance reasons.

Security and permissions

By default, every Hemera application has read-only access to the SoftwareManager. Access to operations can be enabled by enabling more features in the application's manifest file. In case a method is called and the application has no permissions to execute it, the corresponding Operation will return Hemera::Literals::Error::notAllowed.

System-wide availability of SoftwareManager

SoftwareManager is part of Gravity, as explained in Software Management in Hemera, and can be entirely disabled from the vendor. This class serves as a mere interface to Gravity, and its initialization will fail if the system SoftwareManager is not installed or not available.

See also
Application

Member Function Documentation

QDateTime Hemera::SoftwareManagement::SoftwareManager::lastCheckForUpdates ( ) const

Returns the last occurrence of a check for updates.

Returns
The last occurrence of a check for updates as a QDateTime object.
Hemera::SoftwareManagement::ApplicationUpdates Hemera::SoftwareManagement::SoftwareManager::availableApplicationUpdates ( ) const

Returns available application updates.

This update set refers to the last update set retrieved on lastCheckForUpdates.

Returns
A list of available application updates.
See also
lastCheckForUpdates
ApplicationUpdate
Hemera::SoftwareManagement::SystemUpdate Hemera::SoftwareManagement::SoftwareManager::availableSystemUpdate ( ) const

Returns the available system update, if any.

This update refers to the last update set retrieved on lastCheckForUpdates.

Returns
The available system update, or an invalid SystemUpdate object if no update is available.
See also
lastCheckForUpdates
SystemUpdate
Hemera::SoftwareManagement::ApplicationPackages Hemera::SoftwareManagement::SoftwareManager::installedApplications ( ) const

Returns all the applications installed on this system.

This update refers to the last update set retrieved on lastCheckForUpdates.

Returns
The installed applications.
Operation * Hemera::SoftwareManagement::SoftwareManager::checkForUpdates ( )

Checks for available application and system updates.

This operation forces a refresh of all sources known to the system at the time of this call. This includes network updates, removable media updates, USB OTG updates and any media supported by the system. Once the operation is completed, availableApplicationUpdates and availableSystemUpdate might be updated with new values.

Note
This method always returns a valid Operation
This method requires feature CheckForUpdates to be enabled for being executed successfully.
Returns
An Operation representing the update check.
Operation * Hemera::SoftwareManagement::SoftwareManager::downloadApplicationUpdates ( const Hemera::SoftwareManagement::ApplicationUpdates updates)

Downloads selected application updates.

This operation downloads and caches to the system selected application updates, making them ready for installation.

Note
The update list must be consistent with available updates. If the list includes updates not available on the system, the method will return a null pointer.
The system might be configured to automatically download updates.
This method requires feature DownloadUpdates to be enabled for being executed successfully.

updates A list of updates to download

Returns
An Operation representing the update download, or a null pointer if updates is inconsistent.
Operation * Hemera::SoftwareManagement::SoftwareManager::downloadSystemUpdate ( )

Downloads the available system update.

This operation downloads and caches to the system the available system update, making it ready for installation.

Note
There must be an available system update to call this method. If no system update is available, the method will return a null pointer.
A system update might require a lot of available disk space, be sure to check the disk before starting the operation. Also, SystemUpdate always reports its download and installation size.
The system might be configured to automatically download updates.
This method requires feature DownloadUpdates to be enabled for being executed successfully.
Returns
An Operation representing the update download, or a null pointer if no system update is available.
Operation * Hemera::SoftwareManagement::SoftwareManager::updateApplications ( const Hemera::SoftwareManagement::ApplicationUpdates updates)

Updates selected applications.

This operation updates selected application. The operation will first download all the needed updates, and install them afterwards. You don't need to call downloadApplicationUpdates before this method. If downloadApplicationUpdates was called previously or the system is configured for automatically downloading updates, the download phase will likely be skipped.

Orbit restart

Orbits affected by the update (as in: orbits running applications affected by the update) will be stopped before the update procedure begins and restarted once the update procedure ends. Gravity will not change the active orbit in the process, but will instead leave the handler with no active orbit during the update if the active orbit is affected by the update.

If the orbit in which the application requesting the update lives is affected by the update, it will be restarted as well. This won't influence the update process, which will continue as requested.

This behavior, albeit discouraged, can be overridden on a per-application basis or on a system basis. Please see Gravity's applicationUpdatePolicy and application feature DoNotRestartOnUpdate.

Note
The update list must be consistent with available updates. If the list includes updates not available on the system, the method will return a null pointer.
This method requires feature UpdateApplications to be enabled for being executed successfully.

updates A list of updates to install

Returns
An Operation representing the update procedure, or a null pointer if updates is inconsistent.
Operation * Hemera::SoftwareManagement::SoftwareManager::updateSystem ( )

Updates the system.

This operation updates the system to a new release. The operation will first download all the update, and install it afterwards. You don't need to call downloadSystemUpdate before this method. If downloadSystemUpdate was called previously or the system is configured for automatically downloading updates, the download phase will likely be skipped.

Update procedure

A system update is always performed in a protected environment to minimize any potential risk of compromising the system. As such, the update will be first downloaded, the system will then reboot in a special update mode. It is possible to supply Hemera with a QML interface to display progress during the system update.

In Hemera's update mode, pretty much every system feature is disabled - Gravity itself will boot in update mode and will disable orbit management. As such, provided QML files can make no use of Hemera's SDK, except for the resource protocol.

Note
There must be an available system update to call this method. If no system update is available, the method will return a null pointer.
A system update might require a lot of available disk space, be sure to check the disk before starting the operation. Also, SystemUpdate always reports its download and installation size.
This method requires feature UpdateSystem to be enabled for being executed successfully.
Due to the behavior of the system update, the operation will complete once the system starts rebooting in update mode.
Returns
An Operation representing the update procedure, or a null pointer if no system update is available.
void Hemera::SoftwareManagement::SoftwareManager::availableUpdatesChanged ( )
signal

Emitted when available system and/or application updates changed.

void Hemera::SoftwareManagement::SoftwareManager::lastCheckForUpdatesChanged ( const QDateTime &  lastCheck)
signal

Emitted when the system is successfully checked for updates, and the last check occurrence changes.

void Hemera::SoftwareManagement::SoftwareManager::installedApplicationsChanged ( )
signal

Emitted when applications are installed or removed, hence the installed applications on the system change.