* Bug 1817245 - new Nimbus feature for controlling client-deduplication ping
This feature will enable/disable the sending of the `client-deduplication`
ping that will be added in a later PR.
* Bug 1817029 - Add the client-deduplication ping
The `client-deduplication` ping will be used to determine if
client IDs are being regenerated erroneously. This ping uses
the lifecycle observers to (almost) replicate the same scheduling
as the baseline ping.
* Bug 1817029 - Suggested changes
changelog
- add `reason` for new ping
- update the unit test for the new ping
- add new metrics
- allow for custom salt when hashing the Ad ID
- move the Nimbus check to the lifecycle observer
- record the new metrics
* Bug 1817029 - Update fenix/.experimenter.yaml
Co-authored-by: Alessio Placitelli <alessio.placitelli@gmail.com>
* Bug 1817029 - remove unnecessary pass-through function
* Bug 1817029 - add the GleanTestRule for tests
* Bug 1817029 - Update fenix/app/src/test/java/org/mozilla/fenix/components/metrics/clientdeduplication/ClientDeduplicationPingTest.kt
Co-authored-by: Travis Long <tlong@mozilla.com>
* Bug 1817029 - remove unnecessary call to main thread
* Bug 1817029 - update comment about hashing
---------
Co-authored-by: Alessio Placitelli <alessio.placitelli@gmail.com>
Co-authored-by: Travis Long <tlong@mozilla.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This also upgrades to use the large android worker since unit tests
take over 60mins to run otherwise.
Two tests in BrowserFragmentTest relied on FeatureFlags that are
dependent on the environment. Refactored those in line with our
other tests e.g., the SettingsFragmentTest.
BrowsersCacheTest will need some more work and is covered by a ticket.
AppRequestInterceptorTest just needed an additional mock.
* Bug 1810631 - Display name instead of e-mail in menu.
* Bug 1810631 - Display name instead of e-mail in menu
---------
Co-authored-by: gitstart <gitstart@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Change IntentReceiverActivity so that if the incoming intent has the private_browsing_mode extra set to true, it overrides the openLinksInAPrivateTab setting. This allows external apps to set this flag for sites they want opened in a private app explicitly.
External apps cannot force the link to open in a non-private tab if openLinksInAPrivateTab is enabled, in that case the extra will be ignored.
This is similar to an old fennec feature ( https://bugzilla.mozilla.org/show_bug.cgi?id=1347583 ), however I used the "private_browsing_mode" extra name since it already appears in the code, instead of the "private_tab" extra that fennec used.
Bugzilla bug is 1807531, GitHub bug is #26158
Restore showing a different description of the Tracking Protection feature in
application's onboarding if the Total Cookie Protection feature is not yet
public.
The new description mentioning Total Cookie Protection will only be shown if
the Total Cookie Protection CFR is to also be shown.
While debugging a UI test, we found that the messaging feature was being
queried during the storage initialization and acting on the cached value
alone. This could lead us to no longer receiving new messages during the
app lifetime.
For the unit tests, we switched from mocking the entire feature to
mocking just the `FeaturesInterface` as the test was providing
false-positive results. It's better to create a real feature in any case
for the other testing needs.
Co-authored-by: Benjamin Forehand Jr <bennyjr169@gmail.com>
* For 1811851: Change MessageNotificationWorker.kt to handle when a user clicks or dismisses a Notification.
* For 1811851: Re-work based on review
---------
Co-authored-by: t-p-white <t-p-white>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This comes to solve the issue seen in the error logs by adding the anchor
change done for the snackbar to the operation queue on thread Main thread.
Should allow to avoid chaning the snackbar's anchor in between onMeasure and
onLayout.
* For https://github.com/mozilla-mobile/fenix/issues/25588, hide password in android 13 clipboard preview
This patch hide passwords copied from "Saved logins" in android 13 clipboard preview
Closes https://github.com/mozilla-mobile/fenix/issues/25588
* fix: show a toast for android 12 and lower
* For mozilla-mobilehttps://github.com/mozilla-mobile/fenix/issues/25588, hide password in android 13 clipboard preview
* fix: move metrics to new listeners
* fix: actually move metrics to new listeners
---------
Co-authored-by: cschanaj <cschanaj@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Everywhere the toolbar which needs to show autocomplete suggestions is used we
show a `ToolbarView`. So instead of having this configurable in 2 or more
places as it happened before the autocomplete functionality is configured only
from the `ToolbarView` class.
It will contain a `ToolbarAutocompleteFeature` that will be immediately updated
with the appropriate autocomplete providers or remove all such providers to
immediately update the current autocomplete or remove it entirely depending on
the new search engine selected.
Depending on the selected search engine:
- if it is a topic specific one show bookmarks and tabs from just the it's host
domain
- if it is a general one then don't show bookmarks and tabs at all
- if it is the default search engine then show all bookmarks and tabs.
Previously the check for the "Search -> Show search suggestions" user setting
was only used in the default SearchFragmentState but not again if users change
the current search engine as part of the unified search feature.
This comes to ensure that that check is always made when needing to configure
new search engine results.
For all search engines minus the application added ones we will also show past
search terms used for previous searches with the currently selected search
engine.
If the current search engine is not one added by the application and not the
default one then:
- if it is a topic specific one show history from just the it's host domain
- if it is a general one then don't show history at all
- if it is the default search engine then show all history.
This uses the same direction as the before patch - inflating a new View that
can then serve as an anchor for the Snackbar.
Here we could use directly the AC layout as it needed no special customization.
Tried to mimic the UX of a modal dialog while using Android Views.
This meant including a scrim that would consume all touches and theming the
navigation bar and status bar.
Avoiding a dialog and a separate window will allow the snackbar to see the
new "dialog" as a sibling in a CoordinatorLayout parent and so be able to
position itself based on the new "dialog".
This patch also added "start_download_dialog_layout" from A-C as it leads to
simpler and less code needed to style the layout - colors / shapes with
everything happening in XML versus calculating the values then setting them
programatically.
Previously Android-Components - BrowserToolbarBehavior would be responsible
for positioning the snackbar above the toolbar.
With that responsibility removed we can handle in Fenix positioning the
snackbar depending on the toolbar and many more cases - like positioning it
depending on the download dialogs.
* For 1809444: Added a MessageNotificationWorker to poll Nimbus for new messages and create a notification configured using the highest priority new message (if available).
* For 1809444: Changes from PR review
Co-authored-by: t-p-white <t-p-white>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Since the crash was caused by having the current tab set as inactive
while the user was still able to see it, now we ignore the current
tab if it is selected to be set as inactive.
* Move messaging fml to a separate file
* Add surface property to message data
* Get messages for just a single surface
* Add surface to messaging middleware
* ktlint
* Add tests for filtering by surface
* Add homescreen to default-browser message
* Move surface param to MessageActions instead of MessagingMiddleware
* Added computed property for surface to message
* ktlint
* Address reviewer comment
* Fixup tests
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
The engine icon was set after the screen was visible leading to a delay.
With this solution, the icon will be set before the screen is visible
eliminating any visible artefacts.
With the new telemetry will immediately report when a certain Pocket sponsored
story is shown (visible more than 50%) or clicked by the user.
The reasons for the new ping help easily identify the probe being sent and the
type of shim data.
* Add "Open all in new tabs" options in bookmarks
* Add "Open all in private tabs" options in bookmarks
* Add metrics tracking if the usage of "Open all in..." in bookmarks
Co-authored-by: Pg <pg.developper.fr@gmail.com>
If the app is opened from the search widget and the MR onboarding is shown then
the backstack will have the following structure:
- root, homeFragment, searchDialogFragment, onboardingFragment
as opposed to otherwise
- root, homeFragment, searchDialogFragment.
This patch allows to avoid the MR onboarding fragment causing the
SearchDialogFragment to not know that below it is the HomeFragment and
consequently not applying transparency or propagate user touches to the parent
Activity.
- Create element to be displayed
- Update the interface and bind in the view holder
Set the filter to limit this action to FOLDER.
- Create core function
Main logic is done on the controller (has it should be done). The whole
process is done in one coroutine to be non-blocking as many
(sub)folders & links can be present. If folder is empty, a toast is
displayed. Else iterate on items. When item is:
- a FOLDER -> restart process (without toast) on the folder
- a ITEM -> open it
- a SEPARATOR -> do nothing
Once finished, show the tabs tray.
Toast message is defined in fragment to have access to context.
- Create androidTest for openAllInTabs
- Create tests for handleBookmarkFolderOpening
- Display 'open all' options only if folder has at least on child:
A coroutine and suspended functions have to be used, since `getTree`
is async.
Unify the TCP feature with the TCP setting allowing both to be controlled
through the same Nimbus experiment.
Allow changing the default cookie policy to TCP based on the Nimbus experiment.
Split loading the bitmap from storage and actually setting it in two operations
with one that can run in parallel with onCreateView for HomeFragment and one
that can be used serially on the main thread to actually set the wallpaper.
This seems like the best compromise to ensure that everytime the homescreen is
shown it will have the wallpaper set but does affect the performance - there is
a delay in showing HomeFragment to account for waiting for the wallpaper to be
set.
In testing the new delay seems close to the one from the initial wallpapers
implementation. See more in https://github.com/mozilla-mobile/fenix/pull/26794.
Using Dispatchers.IO allowed the observer to react faster to wallpaper state
updates but caused issues with updating the wallpaper in fragment layout.
Using Dispatchers.Main.immediate gives us a bit slower reaction time but still
faster than Dispatchers.Main and allows us to still execute before the fragment
is visible.