By using a feature tag we can avoid having to define new tags in the Glean
annotations repository.
The list of available tags needed to be regenerated to be able to reference the
new "Wallpapers" tag.
Because the tags regeneration also brought a change in tags from "TopSites" to
"Shortcuts" all previous telemetry using "TopSites" had to be migrated to use
the new "Shortcuts" tag.
A previous check for whether the persisted name of the current wallpaper is
empty made checking whether the default wallpaper is to be shown brittle.
Instead of duplicating such a check in multiple places it is now extracted in
one method that can be used in multiple places including the new telemetry.
These are mostly mechanical changes to replace usage of `testHasValue`
with `testGetValue`.
`testGetValue` will now return `null` instead of throwing an exception
if no data is available.
This avoids having to pass another LifecycleOwner from outside and will ensure
the View is update only in the bounds of it being attached.
The observe-update code is moved to bind(..) as that seems like a more
idiomatic callback for updating an already constructed View rather than
createView() which should only create and return a View.
* For #25397 - Telemetry for credit card save and update
* Use Fenix Issue fro Bugs
Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>
Co-authored-by: Roger Yang <royang@mozilla.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
A new way to be able to reliably record actual impressions of sponsored stories
was needed and based on this data we can ensure we are promoting fresh stories
(with fewer impressions) or the ones with a higher priority.
PocketStoriesChange was called only once - to clean the shown stories when the
user gets to the homescreen and the Pocket feature is disabled - useful for the
situations in which the user returns after disabling the feature in settings.
Populating the store with recommended stories to show was already happening
based on 'PocketStoriesCategoriesChange' and sponsored stories will be added by
using 'PocketSponsoredStoriesChange' so renaming 'PocketStoriesChange' will
help on reducing any confusion in the future.
Also added documentation for all Pocket related actions from AppStore and
removed the 'UndocumentedPublicClass' detekt suppressions.
The default was already 8. This is now being moved closer to the source from
where the stories to be shown are emitted.
With the addition of sponsored stories at fixed positions having to support a
variable number of stories being returned from AppState#getFilteredStories
means increased complexity with no benefit.