flatpak: Introduce a utility to resolve default arch for refs
This is originated to address the case of external-appstream
that can be used to mention additional appdata for a given GsApp.
However, the `source` parameter for a flatpak GsApp is dependent
on the arch of the system. This patch allows the external appstream
to optionally omit the arch and gnome-software will assume the
default arch and re-create the source parameter with the correct ref.
The corrected ref is parsed through `flatpak_ref_parse` for sanity.
Example of an external appstream 'source' parameter resolution:
<bundle type="flatpak">app/org.telegram.desktop//stable</flatpak>
resolves to: `app/org.telegram.desktop/x86_64/stable` for a
x86_64 platform.
New "online-updates-timestamp" gsetting for online updates tracking
"online-updates-timestamp" will denote the last time the system was
online and got any update. It will play as one of the factor to drive
pending updates notification logic in gs-update-monitor (See
no_updates_for_a_week). This timestamp is set by plugin-loader
whenever there is a update or upgrade operation (that succeeds).
The reason we introduce a new gsetting instead of using a similar
one "install-timestamp is that, "install-timestamp" is used for
scheduling offline PackageKit update notifications. If we reuse this
one for flatpak updates as well, this can lead to PackageKit updates
never getting any notifications (as flatpak updates are autoinstalled).
appstream: Properly handle "all" desktop group for a category
The current logic only updates app-counter for parent categories
only if there are multiple groups/subcategories. However, this
is not correct as it may lead to categories with no groups/
subcategories, be hidden from the overview-page.
This bug was discovered inside Endless, where a custom category
with no groups/subcategories was added and it was not ending
up in the UI. Pendatically speaking, each parent category has
atleast one group/subcategory i.e. "all". In this patch,
we correct the handling of "all" and update the app-counter for
parent category correctly. Then if the parent cateogory has multiple
groups/subcategories, app-counter for those subcategories are
updated as well.