Commit graph

1101 commits

Author SHA1 Message Date
mcarare
6d98cb9623 [components] For https://github.com/mozilla-mobile/android-components/issues/12500: Update navigation, lifecycle, core and fragment dependencies. 2022-10-11 07:17:12 +00:00
Mozilla L10n Automation Bot
fa9f4b9ef1 [components] Import l10n. 2022-09-10 00:20:45 +00:00
Alexandru2909
d12b67a0ec [components] For https://github.com/mozilla-mobile/android-components/issues/12151 - Support step attribute in TimePicker 2022-09-08 14:37:09 +00:00
mcarare
92fe0c0234 [components] For https://github.com/mozilla-mobile/android-components/issues/12724: Upgrade compose to 1.2.1 version.
Split versioning of compose compiler.
Enable Xjvm-default to allow inheriting from interfaces with '@JvmDefault' members
like RememberObserver.
2022-09-08 08:22:09 +00:00
Mozilla L10n Automation Bot
1b14baec2a [components] Import l10n. 2022-09-08 00:20:22 +00:00
mcarare
8dd066c883 [components] For https://github.com/mozilla-mobile/android-components/issues/12381: Suppress AppBundleLocaleChanges warning. 2022-08-31 09:47:47 +00:00
mcarare
97ae5efa57 [components] For https://github.com/mozilla-mobile/android-components/issues/12381: Remove VisibleForTesting annotation.
Values are also accessed from code, not just from tests.
2022-08-31 09:47:47 +00:00
Mozilla L10n Automation Bot
291f58aa12 [components] Import l10n. 2022-08-29 00:25:29 +00:00
Marcus Hoffmann
b16810ea41 [components] Close https://github.com/mozilla-mobile/android-components/issues/12689: Make sharing images work with Direct Share
Image sharing currently only works when sharing to an app but not when
using the Android Direct Share feature, where it fails with a
SecurityException.

"Direct Share" is what Android calls the app created shortcuts,
i.e. individual chats from a messaging application.

The code pretty much already does the right thing (i.e. setting
the FLAG_GRANT_READ_URI_PERMISSION on the target intent as well as the
Chooser action, as described in ACTION_CHOOSE Api docs[1]) but there's
some platform internals that seem to go wrong here but we can work
around it with this patch.

https://issuetracker.google.com/issues/151386328 describes a similar
Problem, especially https://github.com/mozilla-mobile/android-components/issues/12 in there offers a similar workaround and an
explanation:

  The underlying problem is that ACTION_SEND is using EXTRA_STREAM for the
  content URI. But the FLAG_GRANT_*_URI_PERMISSION mechanism only works
  with URIs in Intent.data and Intent.clipData. The framework contains
  some code that tries to work around this limitation. But it doesn't
  handle this particular case. Intent.createChooser() migrates the flags
  and data/clipData from the target Intent, but it does so before the
  framework had a chance to fix up the target Intent via Intent.migrateExtraStreamToClipData().

And indeed moving the clipData into the inner intent makes Direct Share
work and preserves the image preview in the Intent.

[1] file:///<SDK-DIR>/docs/reference/android/content/Intent.html#ACTION_CHOOSER
  If you need to grant URI permissions through a chooser, you must specify
  the permissions to be granted on the ACTION_CHOOSER Intent in addition to
  the EXTRA_INTENT inside. This means using setClipData(ClipData) to
  specify the URIs to be granted as well as FLAG_GRANT_READ_URI_PERMISSION
  and/or FLAG_GRANT_WRITE_URI_PERMISSION as appropriate.
2022-08-26 09:20:04 +00:00
Tarik Eshaq
f52779dfab [components] Upgrades appservices to 94.1.0 2022-08-19 12:35:38 +00:00
Mozilla L10n Automation Bot
a4c99e58fc [components] Import l10n. 2022-08-19 00:29:30 +00:00
Jonathan Almeida
7bb88450b5 [components] Close https://github.com/mozilla-mobile/android-components/issues/12267: Add support for Save to PDF in GeckoEngineSession
Adds support for Save to PDF from the GeckoSession by plugging the
API into `onExternalResponse` to provide the same flow as a typical
file download experience would be.

Co-authored-by: Olivia Hall <ohall@mozilla.com>
2022-08-15 14:29:34 +00:00
Mozilla L10n Automation Bot
3c3e730c27 [components] Import l10n. 2022-08-13 00:21:38 +00:00
Ben Dean-Kawamura
1515fd04b8 [components] Removing the support-migration component now that it's no longer used 2022-08-12 13:55:29 +00:00
Mozilla L10n Automation Bot
23a7b3f437 [components] Import l10n. 2022-08-08 00:27:30 +00:00
indu
30fb4f6fbe [components] For https://github.com/mozilla-mobile/android-components/issues/12544: Allow screen to turn off after media is paused/stopped (https://github.com/mozilla-mobile/android-components/pull/12560)
* For https://github.com/mozilla-mobile/android-components/issues/12544: Allow screen to turn off after media is paused/stopped

This fix allows the device to sleep when the media being played is paused/stopped after the system screen timeout is passed

Co-Authored-By: Mugurell <Mugurell@users.noreply.github.com>
Co-Authored-By: Mihai Adrian Carare <48995920+mcarare@users.noreply.github.com>

* For https://github.com/mozilla-mobile/android-components/issues/12544: Allow screen to turn off after media is paused/stopped

This fix allows the device to sleep when the media being played is paused/stopped after the system screen timeout is passed

Co-Authored-By: Mugurell <Mugurell@users.noreply.github.com>
Co-Authored-By: Mihai Adrian Carare <48995920+mcarare@users.noreply.github.com>

Co-authored-by: Mugurell <Mugurell@users.noreply.github.com>
Co-authored-by: Mihai Adrian Carare <48995920+mcarare@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-08-05 09:42:21 +00:00
Mozilla L10n Automation Bot
a4b61db992 [components] Import l10n. 2022-07-28 00:26:37 +00:00
Ben Dean-Kawamura
e163f82bc2 [components] Dumping app-services to v93.6.0 2022-07-15 19:31:07 +00:00
Ben Dean-Kawamura
a21c5956cc [components] Don't try to parse migration metrics from importLoginsAsync
A change in AS v93.6.0 made it so the underlying function
`LoginsStore.import_multiple` no longer returns the metrics as a JSON
string string.  Instead it just encodes the unit struct. This was a
breaking change, but it's not listed properly in the CHANGELOG.

The fix is pretty simple: just assume that no logins failed to import.
2022-07-15 19:31:07 +00:00
Mugurell
044f8b777b [components] For https://github.com/mozilla-mobile/android-components/issues/12441 - Update metrics.md files from glean_parser v6.1.1 2022-07-06 16:29:58 +00:00
Mozilla L10n Automation Bot
b957002826 [components] Import l10n. 2022-06-29 00:26:15 +00:00
Jan-Erik Rediger
706f1eb240 [components] Use patched Glean Gradle plugin to fix Windows build issues
The plugin has a single small change:
1c9577144a
2022-06-20 16:21:57 +00:00
Jonathan Almeida
bd35d30334 [components] Issue https://github.com/mozilla-mobile/android-components/issues/12230: Speculative fix for test failures in PromptFeatureTest 2022-06-15 19:23:49 +00:00
Ben Dean-Kawamura
ff019a3f4f [components] Add support for app-services error reporting.
- Added new component that hooks into the new app-services error
  reporter and listens for events.  When it sees an event it submits it
  to the crash reporter.
- Added support for customizing crash reports for these errors.
2022-06-14 17:51:29 +00:00
Jan-Erik Rediger
77db779226 [components] Fix order of imports 2022-06-09 18:08:13 +00:00
Jan-Erik Rediger
705c223b8a [components] Adopt APIs from Glean UniFFI 2022-06-09 18:08:13 +00:00
MatthewTighe
a22d90edc0 [components] for https://github.com/mozilla-mobile/android-components/issues/12065: add a SyncStore and some initial state properties 2022-05-27 17:22:48 +00:00
Mugurell
205f8c10dd [components] For https://github.com/mozilla-mobile/android-components/issues/12207 - Support optionally persisting the default value of a string preference
Moved the tests for string preferences to a new file where we can use
Robolectric for just this preferences type and test the actual behavior without
relying on mocking which would prevent full testing the change because of the
two readings using a `null` default.
2022-05-23 13:36:22 +00:00
Mozilla L10n Automation Bot
b251645572 [components] Import l10n. 2022-05-17 17:30:54 +00:00
Mozilla L10n Automation Bot
c3fcd60943 [components] Import l10n. 2022-05-13 00:22:43 +00:00
Mugurell
d78b06b6bf [components] For https://github.com/mozilla-mobile/android-components/pull/11175 - Migrate runBlocking and runBlockingTest to runTest in unit tests
Used `runTestOnMain` where `MainCoroutineRule` was used or needed to be used,
`runTest` elsewhere.

Extra effort for removing all `runBlocking` occurrences in unit tests.
`kotlinx.coroutines.test.runTest` is a test specific API that seems like a more
appropriate way for running tests in a coroutine than the general
`kotlinx.coroutines.runBlocking` api.
2022-05-10 13:45:03 +00:00
Mugurell
2458be9143 [components] For https://github.com/mozilla-mobile/android-components/pull/11175 - Add a new runTestOnMain top level function
This attempts to run the test in a new coroutine using the `TestDispatcher`
previously set through `Dispatchers.setMain(..)`.
2022-05-10 13:45:03 +00:00
Mugurell
2963708053 [components] For https://github.com/mozilla-mobile/android-components/issues/11755 - Replace TestCoroutineDispatcher with UnconfinedTestDispatcher
- Refactor out all usages of TestCoroutineDispatcher and TestCoroutineScope
- Refactor MainCoroutineRule to now use UnconfinedTestDispatcher by default.
This dispatcher will eagerly enter all launch or async blocks being more suited
to our codebase.
2022-05-10 13:45:03 +00:00
Mozilla L10n Automation Bot
ca994a2bb8 [components] Import l10n. 2022-05-10 00:23:03 +00:00
Mozilla L10n Automation Bot
acf35ca8b2 [components] Import l10n. 2022-05-09 00:25:31 +00:00
Mozilla L10n Automation Bot
8e44ec6a2b [components] Import l10n. 2022-05-08 23:01:10 +00:00
Gabriel Luong
6be587c3fc [components] Issue https://github.com/mozilla-mobile/android-components/issues/9838: Introduce CreditCardValidationDelegate and implement onCreditCardSave in GeckoCreditCardsAddressesStorageDelegate
- Introduces `CreditCardValidationDelegate` and a default implementation in `DefaultCreditCardValidationDelegate`
- Implements `onCreditCardSave` in `GeckoCreditCardsAddressesStorageDelegate`
- Refactors `CreditCard` from concept-engine to `CreditCardEntry` in concept-storage so that it can validated with the `CreditCardValidationDelegate`
2022-05-04 03:52:37 +00:00
Mozilla L10n Automation Bot
8997afe61d [components] Import l10n. 2022-04-29 00:21:59 +00:00
mcarare
c26a0753fc [components] For https://github.com/mozilla-mobile/android-components/issues/9684: Return false instead of throwing NPE. 2022-04-28 10:39:46 +00:00
mcarare
98761c0204 [components] For https://github.com/mozilla-mobile/android-components/issues/9684: Run all view tests on sdk 30. 2022-04-28 08:33:29 +00:00
Ben Dean-Kawamura
8f0ae3d397 [components] Added features to support application-services branch builds
Added support for branch-build settings in `local.properties`:
  - If `branchBuild.android-components.version` is set, then we
    set the android-components version to that exact string.

  - If `branchBuild.application-services.dir` is set, then run
    `build-scripts/substitute-local-appservices.gradle` script, like we
    do with `autoPublish`.  However, in this case, that script expects
    the app-services packages to be be built ahead of time with a
    specific version name specified by
    `branchBuild.application-services.version`.

  - Added support for the absolute paths when running the substutition
    scripts.

  - Updated `substitute-local-ac.gradle` to check the
    `localProperties.branchBuild.android-components.version`.

The plan is to use this feature to build/test fenix using a particular
checkout of application-services and androd-components, with the
versions set to the git commit ID.
2022-04-20 19:00:38 +00:00
Mugurell
f91cb8abe1 [components] For https://github.com/mozilla-mobile/android-components/issues/11753 - Update compose to 1.1.1 and Kotlin to 1.6.10
This also required updating room to >= 2.4.0.
This new version adds a deprecation of the `MigrationTestHelper` api used in
`LoginExceptionStorageTest` that is to be later fixed in https://github.com/mozilla-mobile/android-components/issues/11765.

`activity_compose` was also update to the latest stable version to ensure a
better match with the latest stable version for compose.

Used 1.6.10 for Kotlin although 1.6.20 is available to prevent any issues with
Compose 1.1.1 reported as an error at compile time:
"e: This version (1.1.1) of the Compose Compiler requires Kotlin version 1.6.10
but you appear to be using Kotlin version 1.6.20 which is not known to be
compatible.  Please fix your configuration (or
`suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!)."
2022-04-18 17:28:25 +00:00
jknair
dab5e6e10e [components] For https://github.com/mozilla-mobile/android-components/issues/11998 lowercase-ing the scheme added while Normalizing the Url 2022-04-14 10:43:18 +00:00
Mozilla L10n Automation Bot
c2107d31cd [components] Import l10n. 2022-04-13 00:38:47 +00:00
Mozilla L10n Automation Bot
c839b8b4aa [components] Import l10n. 2022-03-21 22:01:32 +00:00
Mozilla L10n Automation Bot
1a59fe0d8f [components] Import l10n. 2022-03-19 00:25:14 +00:00
mcarare
5cd63ba807 [components] For https://github.com/mozilla-mobile/android-components/issues/11670: Use TestCoroutineDispatcher for runBlocking tests.
This avoids tests timing out.
2022-03-18 12:43:16 +00:00
mcarare
b90e41d3fe [components] For https://github.com/mozilla-mobile/android-components/issues/11670: Temporarily suppress deprecation for addResolveInfoForIntent. 2022-03-18 12:43:16 +00:00
mcarare
33d5df7988 [components] For https://github.com/mozilla-mobile/android-components/issues/11670: Use shadowOf(getMainLooper()).idle() to execute all posted tasks.
This is needed due to the new default Looper Mode - PAUSED in Robolectric.
2022-03-18 12:43:16 +00:00
Mozilla L10n Automation Bot
c6eeb51a18 [components] Import l10n. 2022-03-13 00:25:09 +00:00
mcarare
688d5b2c8c [components] For https://github.com/mozilla-mobile/android-components/issues/11725: Switch to using WindowInsetsCompat instead of WindowInsets. 2022-03-09 11:25:28 +00:00
Mugurell
f04e8b683c [components] Revert "For https://github.com/mozilla-mobile/android-components/issues/11753 - Update compose to 1.1.0 and Kotlin to 1.6.10"
This reverts commit 3feac3db3901ef73efcd0e14c04b47cbdab2e7ff.
2022-02-28 22:27:21 +00:00
Mugurell
97b77729c7 [components] For https://github.com/mozilla-mobile/android-components/issues/11753 - Update compose to 1.1.0 and Kotlin to 1.6.10
This also required updating room to >= 2.4.0.
This new version adds a deprecation of the `MigrationTestHelper` api used in
`LoginExceptionStorageTest` that is to be later fixed in https://github.com/mozilla-mobile/android-components/issues/11765.

activity_compose was also update to the latest stable version to ensure a
better match with the latest stable version for compose.
2022-02-24 10:12:43 +00:00
Gabriel Luong
1c21cf8793 [components] Issue https://github.com/mozilla-mobile/android-components/issues/11732: Refactor Frequency into support-base component 2022-02-22 21:35:51 +00:00
Mozilla L10n Automation Bot
0ca1e422b7 [components] Import l10n. 2022-02-15 00:33:12 +00:00
Grigory Kruglov
03794ddc5b [components] Avoid eagerly rehydrating EngineSessionState for recently closed tabs
This change splits out tab-specific data from RecoverableTab data class
into a separate TabState (so, it doesn't have the EngineSessionState).

Then, once we have the simplified TabState, everything that touches RecentlyClosedTabs
is converted to use that instead of its more expensive sibling.

This way we avoid having to eagerly process EngineSessionState simply to populate BrowserState.closedTabs.
This saves us from having to hit disk (where the EngineSessionState is persisted) on initializing BrowserState (so, startup in most cases).
It also saves us from having to parse/rehydrate that persisted state.

At the point we actually need the EngineSessionState for a tab we'd like to restore, we can read/process it.
2022-02-14 14:54:00 -08:00
Arturo Mejia
57ce57b581 [components] Closes https://github.com/mozilla-mobile/android-components/issues/11682: Make Fenix nightly the official Firefox nightly on Browsers 2022-02-10 21:47:27 +00:00
Mugurell
d1ed87e71c [components] For https://github.com/mozilla-mobile/android-components/issues/11666 - Use PendingUtils.defaultFlags to specify mutability 2022-02-07 11:07:37 +00:00
Mugurell
138d8a45d2 [components] For https://github.com/mozilla-mobile/android-components/issues/11666 - Add PendingUtils.defaultFlags helper 2022-02-07 11:07:37 +00:00
Sammy Khamis
31fdffa11a [components] Uniffi Places (https://github.com/mozilla-mobile/android-components/pull/11487)
* fixup the VisitObservation, HistoryVisitInfo APIs based on changes in a-s

* Uniffi top frecent site info (https://github.com/mozilla-mobile/android-components/issues/3)

* uses VisitTransition in HistoryVisitInfo (https://github.com/mozilla-mobile/android-components/issues/4)

* fixup the VisitObservation, HistoryVisitInfo APIs based on changes in a-s

* updated based on bookmarks being uniffied

* fix issues with how we are rethrowing places exceptions

* bump appservices version

* fix ktlint lexiographic and ununsed import errors

* updated fennec migration code

Co-authored-by: Tarik Eshaq <tarikeshaq@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-21 04:36:54 +00:00
Mugurell
32a0dea47c [components] For https://github.com/mozilla-mobile/android-components/issues/11527 - Allow the decor view time to process the incoming insets
There was a race between how insets are applied when entering immersive mode
and enabling immersive mode restore by setting an insets listener which is now
resolved by ensuring the decor view has the time needed to process the incoming
insets, solution recommended on issuetracker
https://issuetracker.google.com/u/2/issues/214012501 .

Removed the onWindowFocusChangeListener extension property since by having to
offer it through a getter the current implementation would always leak the old
one.
Fenix wasn't using it when this APIs allowed Fenix to pass such a listener and
there was no issue observed so there should be no observable negative impact.
2022-01-18 08:37:04 +00:00
Mozilla L10n Automation Bot
3d267546da [components] Import l10n. 2022-01-07 00:40:22 +00:00
Mugurell
4757a0a4ca [components] For https://github.com/mozilla-mobile/android-components/issues/11374 - Handle focus changes in our own private listener
Previously we'd allow a listener being passed in and we'd hope it will
correctly handle restoring immersive mode.
Now we are handling focus changes and restoring immersive mode on ourselves
also allowing for a simpler public API.
2022-01-06 10:04:21 +00:00
Mugurell
82f71e0bec [components] For https://github.com/mozilla-mobile/android-components/issues/11374 - New insets listener to restore immersive mode 2022-01-06 10:04:21 +00:00
Mozilla L10n Automation Bot
12afbcd07d [components] Import l10n. 2021-12-22 00:25:35 +00:00
Mozilla L10n Automation Bot
7fdf730cc4 [components] Import l10n. 2021-12-21 00:24:03 +00:00
Matt Tighe
65f94370a3 [components] move path walking tests to PlacesHistoryStorageTest 2021-12-09 21:01:48 +00:00
Grisha Kruglov
d3506d84ee [components] Added test cases for path segment matching 2021-12-09 21:01:48 +00:00
Matt Tighe
60bacaab83 [components] Strip common subdomains when matching incoming toolbar queries. 2021-12-09 21:01:48 +00:00
Sebastian Kaspari
b68d7f6c47 [components] Move FakeContext and FakeSharedPreferences to support-test-fakes component 2021-12-06 15:19:50 +00:00
Sebastian Kaspari
c92b48efaf [components] Create support-test-fakes component and move FakeEngine implementation to it 2021-12-06 15:19:50 +00:00
Arturo Mejia
9845f4ddb8 [components] Closes https://github.com/mozilla-mobile/android-components/issues/11360: Strip non-digit characters when calling getCreditCardIIN 2021-12-03 21:49:45 +00:00
Mozilla L10n Automation Bot
15c1628bac [components] Import l10n. 2021-11-17 01:03:00 +00:00
Mozilla L10n Automation Bot
66030bd986 [components] Import l10n. 2021-11-12 00:23:14 +00:00
Ionut Cristian Bedregeanu
76ac88d12a [components] For https://github.com/mozilla-mobile/android-components/issues/11201 - Add Firefox Focus packages to known browsers list 2021-11-01 14:25:21 +00:00
Mozilla L10n Automation Bot
8c97c1b3e1 [components] Import l10n. 2021-10-31 00:26:46 +00:00
Mozilla L10n Automation Bot
f9302c26d5 [components] Import l10n. 2021-10-25 17:30:12 +00:00
Sebastian Kaspari
90ec41fc3a [components] Update Kotlin and Jetpack Compose versions. 2021-10-25 10:58:07 +00:00
Ben Dean-Kawamura
457beff2e7 [components] Added SQLCipher migration logic and updating the crypto handling
Copied the crypto code from autofill and adapted it for logins.  At some
point it would be nice to combine the common parts here, but I figure
that can be a later issue.

Added code to migrate from a SQLCipher database to the new plaintext
ones.  Choose the unimaginative "logins2.db" filename, feel free to pick
a different one.

Fixed some linter errors.
2021-10-13 20:30:28 -07:00
Ben Dean-Kawamura
040dc84977 [components] Updating the migration code to work with the new logins API
Updated FennecLoginsMigration to use the a-c `Login` class rather than
`ServerPassword` (AKA the a-s `Login` class).  They're hold exactly the
same data, this prevents an extra conversion.
2021-10-13 20:30:28 -07:00
mcarare
e9e401aeb6 [components] For https://github.com/mozilla-mobile/android-components/issues/8517: Use WindowInsetsControllerCompat for immersive mode. 2021-10-08 07:32:30 +00:00
Grisha Kruglov
dcadb73fee [components] Prepend 'http' to URLs in intents whith no schemes
We observed via Sentry that we were hitting a bunch of 'url without
base' exceptions coming out of metadata observation API. One of these
cases where we'll end-up trying to process a URL without a base (e.g.
without a scheme) is when we're processing external intent and see
something like "example.com", instead of "https://example.com".

In our toolbar, we use String.toNormalizedUrl to handle this case.

In this patch, we now do the same for URLs we encounter in external
intents, as well.
2021-10-06 15:16:04 +00:00
proninyaroslav
19cbcc2e8d [components] Closes issue https://github.com/mozilla-mobile/android-components/issues/11054: Ignore semicolons at the end of the filename* ContentDisposition segment 2021-10-01 12:55:25 +00:00
Mozilla L10n Automation Bot
19628d9c83 [components] Import l10n. 2021-09-30 00:21:29 +00:00
Sebastian Kaspari
ce85af7843 [components] ImageLoader(): Avoid effect loading image to leave composition too early.
Previously the call to `PerformLoad()` was shielded by mutable state (hasStartedLoading). When this state
was changed then the `PerformLoad()` composable would leave the composition and the coroutine scope
performing the load gets cancelled. This can cause loads to not happen.

It turns out `hasStartedLoading` is not needed at all: The key we pass to LaunchedEffect already guards
against multiple loads and will only perform a reload if the URL changes.
2021-09-03 14:44:27 +00:00
Sebastian Kaspari
73a40a8cad [components] Issue https://github.com/mozilla-mobile/android-components/issues/10835: Add first simple version of an Jetpack Compose image loader using a Client implementation 2021-08-30 13:10:10 +00:00
Mozilla L10n Automation Bot
06bf2369d8 [components] Import l10n. 2021-08-29 00:19:31 +00:00
Grisha Kruglov
a0fa906833 [components] Closes https://github.com/mozilla-mobile/fenix/issues/20830: Make migration state reader more robust
See detailed comment in the patch.
2021-08-13 16:46:22 -07:00
Gabriel Luong
c81ed1976a [components] Issue https://github.com/mozilla-mobile/android-components/issues/10798 - Refactor getRepresentativeSnippet and getRepresentativeCharacter from browser-icons to support-ktx 2021-08-12 16:36:53 +00:00
Jonathan Almeida
478711a6bf [components] Close https://github.com/mozilla-mobile/android-components/issues/10677: Update Mockito to 3.11.2
Co-authored-by: Mugurell <Mugurell@users.noreply.github.com>
2021-08-12 02:25:56 +00:00
Mozilla L10n Automation Bot
b74636142b [components] Import l10n. 2021-08-10 00:19:37 +00:00
Roger Yang
8bdd41b2da [components] Issue https://github.com/mozilla-mobile/android-components/issues/10719: Check for transparency when determining text colour 2021-08-05 20:56:32 +00:00
Grisha Kruglov
2cb270feed [components] Introduced 'restored' content state for tracking tab restoration 2021-08-05 11:47:54 -07:00
Grisha Kruglov
14a116801f [components] Support for tracking external sources
Mainly, does two things:
- refactors SessionState.Source into a richer form (splitting sources
  into Internal and External, where External ones track information
  about originating package)
- adds persistence of External sources into tab session state; we don't
  want to persist Internal sources as that was explicitly removed before
  for causing various issues (e.g. UI behaving incorrectly after
  restoring tabs with various internal sources set)
2021-08-05 11:47:54 -07:00
Sebastian Kaspari
ce323400dd [components] Run ktlintFormat to fix new ktlint errors. 2021-07-28 12:03:23 +00:00
Michael Comella
06e80c6e10 [components] For https://github.com/mozilla-mobile/android-components/issues/10604: remove remaining unused imports automatically.
This commit was automatically generated with:
```sh
./gradlew ktlint --args="-F"
```
2021-07-27 19:39:04 +00:00
Michael Comella
9f3e6f1a1b [components] For https://github.com/mozilla-mobile/android-components/issues/10604: reuse new TestCoroutineDispatcher in additional tests.
These follow a few more simple patterns I was able to find:
- the testDispatcher is not used anywhere else: remove it
- the testDispatcher is used to set a main dispatcher: this is redundant
to the test rule so remove it both the dispatcher & the main dispatcher
- the testDispatcher is actually used elsewhere: for simplicity, change
the reference to point at the MainCoroutineRule.
2021-07-27 19:39:04 +00:00
Michael Comella
851f8a624d [components] For https://github.com/mozilla-mobile/android-components/issues/10604: add MainCoroutineRule.runBlockingTest. 2021-07-27 19:39:04 +00:00
Michael Comella
c29c7a2886 [components] For https://github.com/mozilla-mobile/android-components/issues/10604: change MainCoroutineRule to take TestCoroutineDispatcher. 2021-07-27 19:39:04 +00:00
Michael Comella
b3c2050afa [components] For https://github.com/mozilla-mobile/android-components/issues/10604: deprecate createTestCoroutinesDispatcher.
This is redundant to the built-in TestCoroutineDispatcher() method.
TestCoroutineDispatcher is also preferred because it has enhanced
testing functionality including defining a context-specific
`runBlockingTest` function, the ability to control `delay` timings, etc.
2021-07-27 19:39:04 +00:00
Stefan Arentz
a719bbf6ce [components] For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master branch to main (https://github.com/mozilla-mobile/android-components/pull/10647)
* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (GitHub Workflows)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (Pull Request Template)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (README)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (l10n.toml)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (GitHubPlugin.kt)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (Documentation & Comments)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (TaskCluster)
2021-07-21 09:59:30 -04:00
Mugurell
a3b7931bff [components] For https://github.com/mozilla-mobile/android-components/issues/10633 - toDisplayUrl - don't crash for empty strings
"isRtl" would try to iterate through the provided String and crash if that is
empty so we need our own before check.
2021-07-20 11:58:36 +00:00
Mugurell
fb8a0e54dd [components] For 10633 - Check directionality before adding the LTR mark 2021-07-19 12:50:21 +00:00
Sebastian Kaspari
9fb6953940 [components] Upgrade Android Gradle Plugin to 4.2.2 and Gradle to 6.7.1. 2021-07-19 09:32:44 +00:00
Sebastian Kaspari
33230e7c20 [components] Update to Kotlin 1.5.20. 2021-07-19 09:32:44 +00:00
Sebastian Kaspari
28a76101be [components] Update Kotlin to 1.5.10 (and Coroutines to 1.5.0 and Room to 2.3.0). 2021-07-19 09:32:44 +00:00
Mugurell
bc7d6c05c0 [components] For https://github.com/mozilla-mobile/android-components/issues/10598 - Always display URLs left to right 2021-07-16 11:25:30 +00:00
mcarare
8fac017c47 [components] For https://github.com/mozilla-mobile/android-components/issues/9554: Use WindowInsetsControllerCompat to avoid null controllers. 2021-07-09 06:31:12 +00:00
Mozilla L10n Automation Bot
451641af27 [components] Import l10n. 2021-07-08 00:21:14 +00:00
mcarare
ab0cf03349 [components] For https://github.com/mozilla-mobile/android-components/issues/9554: Remove deprecated systemUiVisibility and flags. 2021-07-07 08:39:21 +00:00
Mozilla L10n Automation Bot
a8bab3fb2a [components] Import l10n. 2021-06-23 00:19:11 +00:00
Arturo Mejia
497d1d2c35 [components] Improvements to site permissions 2021-06-21 12:12:35 +00:00
mcarare
636adaf2a9 [components] For https://github.com/mozilla-mobile/android-components/issues/10404: Remove deprecated kotlin-android-extensions plugin
(cherry picked from commit d99621583ceb11e7d91ebe284e40aec145793e48)
2021-06-15 08:32:26 +00:00
Sammy Khamis
72e748cc4a [components] Conversion to using uniffi for logins component (https://github.com/mozilla-mobile/android-components/pull/10262)
Co-authored-by: Grisha Kruglov <gkruglov@mozilla.com>
2021-06-14 21:47:38 +00:00
Christian Sadilek
4dfb6d92c1 [components] Revert "For https://github.com/mozilla-mobile/android-components/issues/10404: Remove deprecated kotlin-android-extensions plugin"
This reverts commit d99621583ceb11e7d91ebe284e40aec145793e48.
2021-06-14 18:09:24 +00:00
Jan-Erik Rediger
163330b349 [components] Upgrade to Glean v39.0.3
This also adjusts sync-telemetry to use the non-deprecated form of
events now.
2021-06-14 15:48:35 +00:00
mcarare
17c2336fde [components] For https://github.com/mozilla-mobile/android-components/issues/10404: Remove deprecated kotlin-android-extensions plugin 2021-06-14 10:05:57 +00:00
Sebastian Kaspari
62fd5b6fa0 [components] Issue https://github.com/mozilla-mobile/android-components/issues/10301: Add facts for collecting telemetry to feature-autofill component. 2021-06-14 08:13:05 +00:00
Mozilla L10n Automation Bot
a8fdec01fe [components] Import l10n. 2021-06-14 00:15:29 +00:00
Sebastian Kaspari
e02a012bcb [components] Revert "Upgrade to Glean v39.0.0"
This reverts commit 5af3322f80c7a67b5b99c4d57d739dac74cf93c9.
2021-06-08 17:54:42 +02:00
Sebastian Kaspari
b7d77a521d [components] Complete migration from browser-session to browser-state.
* Issue https://github.com/mozilla-mobile/android-components/issues/10197: Move EngineObserver and EngineMiddleware to browser-state and refactor SessionManager dependency away.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: Migrate TabsUseCases to use BrowserStore exclusively.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Migrate SessionUseCases to use BrowserStore exclusively.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532, https://github.com/mozilla-mobile/android-components/issues/10209: Migrate components to use new UseCase APIs.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Migrate UndoMiddleware to use BrowserStore.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: Migrate CustomTabsUseCases to use BrowserStore.
* Issue https://github.com/mozilla-mobile/android-components/issues/10211: Migrate sample-browser to not depend on browser-session.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Remove browser-session dependency.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: feature-tabs: Remove browser-session dependency.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Fix UndoMiddlewareTest
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Refactor SessionUseCasesTest to not use SessionManager.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Fix SessionFeatureTest.
* Refactor support-migration tests to not use SessionManager.
* Fix tests in feature-contextmenu.
* Refactor feature-recentlyclosed tests to not use SessionManager
* Refactor browser-session-storage tests to not use SessionManager
* Refactor feature-intent tests to not use SessionManager
* Refactor feature-tabs tests to not use SessionManager pt. 1
* Refactor feature-customtabs tests to not depend on browser-session.
* Make sure initial load url flags are correct
* Refactor feature-tabs tests to not use SessionManager pt. 2
* Refactor browser-state tests to not depend on browser-session.
* SearchUseCasesTest: Use addTab use case instead of addPrivateTab.
* Samples Browser: Remove unused drawable.
* Fix feature-pwa tests
* Remove browser-session.
* Make sure engine session is linked for window requests
* Make sure engine session is linked when provided with tab
* Make sure engine session is linked when provided with tab pt. 2
* Prevent engine session from being created multiple times
* Prevent engine session from being created multiple times pt. 2
* Prevent engine session from being created multiple times pt. 3
* Part 4: REFACTOR ALL THE THINGS
* Update tests.
* Add additional test for multiple CreateEngineSessionAction dispatching.
* Refactor, some docs and tests
* Fix CustomTabs tests...
2021-06-08 14:44:09 +00:00
Jan-Erik Rediger
18f3609666 [components] Upgrade to Glean v39.0.0
This also adjusts sync-telemetry to use the non-deprecated form of
events now.
2021-06-08 09:31:46 +00:00
Sebastian Kaspari
ff784931ec [components] Revert "Complete migration from browser-session to browser-state."
This reverts commit c5474f00085cf5011e06e3826f611831c50c95b0.
2021-06-07 13:14:34 -04:00
Sebastian Kaspari
230c3e8a4b [components] Complete migration from browser-session to browser-state.
* Issue https://github.com/mozilla-mobile/android-components/issues/10197: Move EngineObserver and EngineMiddleware to browser-state and refactor SessionManager dependency away.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: Migrate TabsUseCases to use BrowserStore exclusively.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Migrate SessionUseCases to use BrowserStore exclusively.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532, https://github.com/mozilla-mobile/android-components/issues/10209: Migrate components to use new UseCase APIs.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Migrate UndoMiddleware to use BrowserStore.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: Migrate CustomTabsUseCases to use BrowserStore.
* Issue https://github.com/mozilla-mobile/android-components/issues/10211: Migrate sample-browser to not depend on browser-session.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Remove browser-session dependency.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: feature-tabs: Remove browser-session dependency.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Fix UndoMiddlewareTest
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Refactor SessionUseCasesTest to not use SessionManager.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Fix SessionFeatureTest.
* Refactor support-migration tests to not use SessionManager.
* Fix tests in feature-contextmenu.
* Refactor feature-recentlyclosed tests to not use SessionManager
* Refactor browser-session-storage tests to not use SessionManager
* Refactor feature-intent tests to not use SessionManager
* Refactor feature-tabs tests to not use SessionManager pt. 1
* Refactor feature-customtabs tests to not depend on browser-session.
* Make sure initial load url flags are correct
* Refactor feature-tabs tests to not use SessionManager pt. 2
* Refactor browser-state tests to not depend on browser-session.
* SearchUseCasesTest: Use addTab use case instead of addPrivateTab.
* Samples Browser: Remove unused drawable.
* Fix feature-pwa tests
* Remove browser-session.
* Make sure engine session is linked for window requests
* Make sure engine session is linked when provided with tab
* Make sure engine session is linked when provided with tab pt. 2
* Prevent engine session from being created multiple times
* Prevent engine session from being created multiple times pt. 2
* Prevent engine session from being created multiple times pt. 3
* Part 4: REFACTOR ALL THE THINGS
* Update tests.
* Add additional test for multiple CreateEngineSessionAction dispatching.
* Refactor, some docs and tests
* Fix CustomTabs tests...
2021-06-07 15:29:14 +00:00
Mozilla L10n Automation Bot
5f4b14eec7 [components] Import l10n. 2021-06-05 00:18:44 +00:00
Mozilla L10n Automation Bot
eee7f8d4cc [components] Import l10n. 2021-05-30 00:24:36 +00:00
Grisha Kruglov
ac3b15d5c8 [components] Telemetry for sync engines - credit cards, addresses, tabs 2021-05-28 17:48:46 +00:00
Gabriel Luong
33dbca874c [components] Issue https://github.com/mozilla-mobile/android-components/issues/9813 - Add CreditCardUtils to parse credit card types from a card number and retrieve their logos 2021-05-25 23:31:52 +00:00
Sebastian Kaspari
98ab7b1b5f [components] Fix or suppress warnings from new detekt version. 2021-05-25 15:22:17 +00:00
Roger Yang
5c90793129 [components] For https://github.com/mozilla-mobile/android-components/issues/4495: Use smaller minimum icon size requirement for browser icons 2021-05-22 01:30:10 +00:00
Roger Yang
6e13e9d353 [components] No issue: update metrics.md 2021-05-21 18:44:08 +00:00
Mozilla L10n Automation Bot
d218d523cc [components] Import l10n. 2021-05-21 00:21:02 +00:00
Mozilla L10n Automation Bot
c17cb9921d [components] Import l10n. 2021-05-15 00:22:17 +00:00
Mozilla L10n Automation Bot
4aa33b72f9 [components] Import l10n. 2021-05-13 00:23:28 +00:00
Mozilla L10n Automation Bot
90d249752b [components] Import l10n. 2021-05-10 00:19:43 +00:00
Mozilla L10n Automation Bot
888624d690 [components] Import l10n. 2021-05-09 00:18:48 +00:00
Roger Yang
8b4d5a05a0 [components] No issue: update metrics.md 2021-05-03 20:05:06 +00:00
Mozilla L10n Automation Bot
1d43fc6ed4 [components] Import l10n. 2021-04-30 00:20:10 +00:00
Kevin Brosnan
db2e6003c9 [components] Fixes 10177 Telemetry renewal for expiring migration probes (https://github.com/mozilla-mobile/android-components/pull/10178) 2021-04-29 16:20:29 -04:00
Sebastian Kaspari
60c4e7fce3 [components] Remove browser-search and migrate leftover functionality to feature-search.
Now that Fenix and Focus have migrated to using search functionality from the state in
BrowserStore (provided by feature-search), we can remove browser-search. The client
for search suggestions and the assets still lived in browser-search and this patch
moves those to feature-search too.
2021-04-21 15:00:44 +00:00
Mozilla L10n Automation Bot
ff42a7aaae [components] Import l10n. 2021-04-17 00:20:35 +00:00
Mozilla L10n Automation Bot
0026a455a2 [components] Import l10n. 2021-04-15 00:25:01 +00:00
Grisha Kruglov
cdfa305091 [components] Pre: mark ObserverRegistry lifecycle register method as MainThread
On newer AndroidX versions of lifecycle library, interactions with a lifecycle registry,
by default, must happen on the main thread. While in this code we don't control how lifecycle
registries are created, and so we can't be sure if this default behaviour is present, it's likely
safe to assume that our consumers won't create custom lifecycle registries with non-main thread interactions
allowed.
2021-04-12 08:50:58 +00:00
Mozilla L10n Automation Bot
8fc62d6ac9 [components] Import l10n. 2021-04-11 00:20:31 +00:00
Mozilla L10n Automation Bot
9b9949bfab [components] Import l10n. 2021-04-10 00:22:55 +00:00
Mozilla L10n Automation Bot
1018dc3ef9 [components] Import l10n. 2021-04-08 00:20:57 +00:00
Mozilla L10n Automation Bot
6e18ad2b07 [components] Import l10n. 2021-04-05 00:22:33 +00:00
Mozilla L10n Automation Bot
2dce640d00 [components] Import l10n. 2021-04-04 00:21:19 +00:00
Mozilla L10n Automation Bot
b17b68b046 [components] Import l10n. 2021-04-02 00:14:52 +00:00
Mozilla L10n Automation Bot
a999cf4597 [components] Import l10n. 2021-03-30 00:21:24 +00:00
Roger Yang
8d8ef1a44b [components] Closes https://github.com/mozilla-mobile/android-components/issues/9991: Add ColorStateList support for TabCounter 2021-03-29 21:58:52 +00:00
Michael Droettboom
8c604e1155 [components] Bug 1689162: Upgrade to new version of Glean metrics.yaml schema (https://github.com/mozilla-mobile/android-components/pull/9990)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-03-29 14:27:14 +00:00
Elise Richards
ec06c7b894 [components] Reset locale optionally updates store 2021-03-24 15:47:06 +00:00
Mozilla L10n Automation Bot
73a6dd7358 [components] Import l10n. 2021-03-24 00:20:14 +00:00
Elise Richards
5919d6184b [components] Closes https://github.com/mozilla-mobile/android-components/issues/9954: intermittent test for locale middleware (https://github.com/mozilla-mobile/android-components/pull/9956)
* Ignore for intermittent test failure

* Wait for store to finish before verifying in middleware test

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-03-23 21:26:35 +00:00
Elise Richards
afdfeed617 [components] Ignore for intermittent test failure 2021-03-23 18:07:57 +00:00
Elise Richards
2a94964ca4 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9754: add locale to browser state (https://github.com/mozilla-mobile/android-components/pull/9779)
* Add locale to our browser state. Create an action for updating this state.

* Observe changes to locale in the service and dispatch changes in the locale manager

* Separate the building of the notification so it can be reused

* Create a use case for local updates to be used in the locale manager

Add channel id so that the existing notification can be accessed and updated

Send notification id instead of tag

Locale use cases test

Put locale action in sealed action class

Test locale scope

* Add refresh functionality to the service

Add locale actions and reducer for restoring state

Restore state for locale use case. Make getters for ids in notification service

Test locale use case notification in the locale manager

Test covering all locale use cases

* Add locale middleware to handle restore from disk

* Middleware tests for locale

* Locale action tests

* Locale state reducer tests

* Changelog

* Lint and cleanup

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-03-22 16:59:29 +00:00
Mozilla L10n Automation Bot
3f1a0c570b [components] Import l10n. 2021-03-21 00:18:34 +00:00
Mozilla L10n Automation Bot
fb0237a52a [components] Import l10n. 2021-03-20 00:24:29 +00:00
Mozilla L10n Automation Bot
bc0f784724 [components] Import l10n. 2021-03-19 00:22:58 +00:00
Christian Sadilek
c9d791c53b [components] Adjust detekt TooManyFunctions threshold 2021-03-18 15:25:40 +00:00
Mozilla L10n Automation Bot
f1552144b6 [components] Import l10n. 2021-03-17 00:17:15 +00:00
Mozilla L10n Automation Bot
20870b1271 [components] Import l10n. 2021-03-16 00:18:11 +00:00
Mozilla L10n Automation Bot
fbe06980e1 [components] Import l10n. 2021-03-14 00:22:50 +00:00
Mugurell
1bc622b5ed [components] Closes https://github.com/mozilla-mobile/android-components/issues/9821 - DownloadService will use a default mime type if otherwise empty (https://github.com/mozilla-mobile/android-components/pull/9822)
Speculative fix (cannot reproduce the issue) for crashes where based on the
stacktrace the download's mime type was empty.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-03-10 11:44:10 +00:00
João Sena
9073175606 [components] Use new API's for immersive mode on Android 11 2021-03-09 14:25:30 +00:00
Arturo Mejia
fd17de7f1d [components] Close issue https://github.com/mozilla-mobile/android-components/issues/9823 Make users aware that download was not performed because of a denied permission 2021-03-08 17:23:53 +00:00
Michael Droettboom
f0a9e90e0d [components] Upgrade to Glean 35.0.0 2021-02-26 15:50:59 +00:00
Sebastian Kaspari
7003643384 [components] Autofill: Limit webDomain based autofilling to known browsers. 2021-02-25 17:28:19 +00:00
Mozilla L10n Automation Bot
b3ce384e2c [components] Import l10n. 2021-02-25 00:28:15 +00:00
Mozilla L10n Automation Bot
83cc420397 [components] Import l10n. 2021-02-23 00:27:48 +00:00
mcarare
6aae963497 [components] For https://github.com/mozilla-mobile/android-components/issues/9552: Fix systemWindowInsetTop deprecation in SDK 30. 2021-02-16 14:38:20 +00:00
Arturo Mejia
e0713ad112 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8148 Limit the number of languages
fetched when retrieving add-ons.
2021-02-15 22:21:06 +00:00
Michael Comella
89c283dac1 [components] For https://github.com/mozilla-mobile/android-components/issues/9638: name threads in Executors.new* calls.
I omitted:
- Store, as its a super-class
- Fennec migration code
2021-02-10 00:35:59 +00:00
Michael Comella
989c339b01 [components] For https://github.com/mozilla-mobile/android-components/issues/9638: add NamedThreadFactory. 2021-02-10 00:35:59 +00:00
codrut.topliceanu
354fdf44cb [components] For https://github.com/mozilla-mobile/android-components/issues/9606 - Adds defaultSettings when creating a new GeckoEngineSession
This fixes the issue where some new WebExtension tabs would have no ETP setting in Fenix.

For https://github.com/mozilla-mobile/android-components/issues/9606 - Removes fallback policy, adds settings to onOpenOptionsPage

For https://github.com/mozilla-mobile/android-components/issues/9606 - Adds defaultSettings to onToggleActionPopup on init GeckoEngineSession

For https://github.com/mozilla-mobile/android-components/issues/9606 - Removes new instance of trackingPolicy and uses passed parameter

For https://github.com/mozilla-mobile/android-components/issues/9606 - Adds documentation to new defaultSettings parameter

For https://github.com/mozilla-mobile/android-components/issues/9606 - Fixes formatting
2021-02-09 19:32:12 +00:00
mcarare
7586242be2 [components] For https://github.com/mozilla-mobile/android-components/issues/8519: Suppress SDK 30 deprecations in tests and link to opened issues. 2021-02-09 18:03:01 +00:00
mcarare
46b450643f [components] For https://github.com/mozilla-mobile/android-components/issues/8519: Suppress SDK 30 deprecations and link to opened issues. 2021-02-09 18:03:01 +00:00
mcarare
13cd254a40 [components] For https://github.com/mozilla-mobile/android-components/issues/8519: Fix nullability changes in SDk 30. 2021-02-09 18:03:01 +00:00
Sebastian Kaspari
e9b345e5a8 [components] Issue https://github.com/mozilla-mobile/android-components/issues/9366: Create dedicated BrowserAction for "engine session killed" and track engine session lifetime.
* Once we link an `EngineSession` to a `Session` we track the time.
* The separate `BrowserAction` allows us to write a Middleware for this event.
* I was unhappy with SystemClock requiring the Android stdlib and therefore making mocking a pain, or
  requiring the slow Robolectric test runner. I ended up with this wrapper class, that seems to work
  well in Fenix when writing unit tests.

The next step is to write a Middleware in Fenix that looks at those events and records metrics in Glean.
I will open a PR for that soon.
2021-02-09 09:56:17 +00:00
Mozilla L10n Automation Bot
9bd22333d0 [components] Import l10n. 2021-02-05 00:27:06 +00:00
Michael Comella
df45108217 [components] For https://github.com/mozilla-mobile/fenix/issues/17816: add Action.IMPLEMENTATION_DETAIL in Facts.
After discussing with Sebastian, we decided it might be good to add
Profiler markers via Facts rather than the main alternative which was
calling the Profiler API directly. We thought so for the following
reasons:

1. we don't know what profiler markers are useful so we want to be able
to iterate quickly. Adding dependencies on the Profiler and landing
these changes across two repos hinders that
2. we want to instrument the code as close to specific method calls as
possible (e.g. GeckoSession.loadUrl) but it's not always easy to do so
(e.g. in the previous example, passing a Profiler reference to
GeckoEngineSession is difficult because GES is not a global dependency)
3. we can only add Profiler markers from the main thread so adding
markers will become more difficult if we have to understand the
threading needs of each Profiler call site

An additional benefit with having this infrastructure is that it's easy
to add Profiler markers for local debugging.

The downside with the Fact approach is that it's less explicit and our
tools would be less effective at modifying that code (e.g. refactors).

That being said, if we find a location where it would be valuable to
have a long term Profiler marker, we should consider instrumenting it
via the Profiler API.
2021-02-04 21:16:45 +00:00
Mozilla L10n Automation Bot
a33cd93564 [components] Import l10n. 2021-02-04 18:02:54 +00:00
Arturo Mejia
9181677d7c [components] Closes https://github.com/mozilla-mobile/android-components/issues/9553: Sanitize downloads content type 2021-02-01 16:53:07 +00:00
Mugurell
b55384ba67 [components] For https://github.com/mozilla-mobile/android-components/pull/9417 - Add support for sharing actual website images (https://github.com/mozilla-mobile/android-components/pull/9420)
Prior to this when the user selected to share an image from the contextual menu
the apps would only share the URL, not the actual resource.

This patch adds a new `ShareDownloadFeature` that will listen for
`AddShareAction` and download, cache locally and then share the Internet
resource contained in Action's state.

Giving the time needed to actually download these resources this feature is
only used for image sharing, not for other types of potentially bigger
resource types.

This is a breaking change with clients expected to create and register a new
instance of the this new feature otherwise the "Share image" from the
browser contextual menu will do nothing.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-01 15:43:51 +00:00
Arturo Mejia
d91267d58b [components] Closes https://github.com/mozilla-mobile/android-components/issues/9526 guessFileName handle generic content types 2021-01-28 11:55:44 +00:00
Michael Comella
137575085f [components] For https://github.com/mozilla-mobile/fenix/issues/17451: add comment warning about Log.Priority.VERBOSE.
The reason we did this is mentioned in
https://github.com/mozilla-mobile/android-components/pull/9451#issuecomment-763747148
as:

> To limit the options to an accepted subset. (We also did not add the
> ASSERT level).

For a satisfying answer, I think we'd need to ask "Why?" again. However,
I don't want to spend more time on this so I didn't follow up on it. This
is why I didn't mention any reasoning for this in the code comment.
2021-01-27 17:45:11 +00:00
Roger Yang
2d945235ff [components] Revert "For https://github.com/mozilla-mobile/fenix/issues/16832: Separate facts for addon install and addon enabled" (https://github.com/mozilla-mobile/android-components/pull/9499)
* Revert "Remove unused line"

This reverts commit 8506f232c1a05545354e47db1ddde744c6a4d24e.

* Revert "Fix web extension support test"

This reverts commit e4b9bcd90f120a76e41e2eae3d60bc9f6f3efaba.

* Revert "Separate web extention install and enable facts"

This reverts commit 7157eba988015afcfff7fb11854136fe0c3157fe.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-01-26 16:05:49 +00:00
Mozilla L10n Automation Bot
0245ee0aeb [components] Import l10n. 2021-01-26 00:18:52 +00:00
Elise Richards
aa56aa1f74 [components] Remove unused line 2021-01-25 21:46:55 +00:00
Elise Richards
c27862271d [components] Fix web extension support test 2021-01-25 21:46:55 +00:00
Elise Richards
552072712d [components] Separate web extention install and enable facts 2021-01-25 21:46:55 +00:00
Sebastian Kaspari
a6e621fcd5 [components] Migrate support-migration to not depend on browser-session. 2021-01-25 14:54:11 +00:00
Jonathan Almeida
4ab0b9a488 [components] Issue https://github.com/mozilla-mobile/android-components/issues/8598: Change signature for ActivityDelegate 2021-01-22 16:01:35 +00:00
Jonathan Almeida
8d3c5608d8 [components] Issue https://github.com/mozilla-mobile/android-components/issues/8598: Add ActivityResultHandler for features 2021-01-18 12:45:49 +00:00
Mozilla L10n Automation Bot
3275e0549d [components] Import l10n. 2021-01-15 00:21:45 +00:00
Mugurell
0382528f45 [components] For https://github.com/mozilla-mobile/android-components/issues/9338 - Introduce SafeUrl to strip unwanted uri schemes
Interested clients can overwrite "mozac_url_schemes_blocklist" with a custom
list of uri schemes that will be recursively removed from the front of the uri.
2021-01-07 14:34:45 +00:00
Mozilla L10n Automation Bot
a074547dd9 [components] Import l10n. 2020-12-29 00:20:41 +00:00
Mozilla L10n Automation Bot
e6368dc807 [components] Import l10n. 2020-12-24 00:20:09 +00:00
Christian Sadilek
38514d37e8 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9196: Intermittent failures in EngineObserverTest 2020-12-18 13:36:39 +00:00
Christian Sadilek
b1ca348f8c [components] Closes https://github.com/mozilla-mobile/android-components/issues/9210: White page shown in custom tab when ublock blocks page 2020-12-16 16:59:12 +00:00
Sebastian Kaspari
dca326ea45 [components] Reland "Issue https://github.com/mozilla-mobile/android-components/issues/8873: Migrate feature-tab-collections to use browser-state."
This reverts commit 31659483d081ddd98b767d438db1d834587eded2.
2020-12-16 09:30:32 +00:00
Christian Sadilek
6a5dcadba5 [components] Revert "Issue https://github.com/mozilla-mobile/android-components/issues/8873: Migrate feature-tab-collections to use browser-state."
This reverts commit 30d3ebb4130d05846a2b3e7fd488eef128be262c.
2020-12-15 17:20:12 +00:00
Sebastian Kaspari
800fb0d46f [components] Issue https://github.com/mozilla-mobile/android-components/issues/8873: Migrate feature-tab-collections to use browser-state. 2020-12-15 15:37:00 +00:00
Christian Sadilek
39d71d1ded [components] Closes https://github.com/mozilla-mobile/android-components/issues/7247: Deprecate Session[Manager] observable methods 2020-12-10 11:00:37 +00:00
Sebastian Kaspari
2191eda94e [components] Closes https://github.com/mozilla-mobile/android-components/issues/4571: Introduce API to purge (back/forward) history of tabs.
* For `PurgeHistoryUseCase` I decided to not introduce a "tab ID" parameter and instead have
  it purge the history of all tabs. It seems like this is what we need and individual tab
  history removal is not needed for now.
* Some tabs may not have an `EngineSession` assigned. Creating one just to call purgeHistory()
  seems excessive. Instead I am dropping an attached `EngineSessionState` which will cause
  those tabs to just reload the URL with not back/forward history when they get restored.
2020-12-08 19:43:08 +00:00
Christian Sadilek
de36351126 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9157: Move desktopMode state from Session to Store 2020-12-08 17:14:59 +00:00
Sebastian Kaspari
79ca201320 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9127: Refactor SearchUseCases to no longer depend on SessionManager.
Multiple things are happening in this patch:
* `TabsUseCases` now returns the ID of new tabs instead of `Session` instances.
* `SearchUseCases` now delegates to a `TabsUseCases` instance to create tabs instead of using `SessionManager`
* Search terms have been removed from `Session` and are now only accessible on `ContentState`
* `CaptureActionsMiddleware` is a new helper to inspect actions dispatched on a `Store` in unit tests.
2020-12-07 09:47:45 +00:00
Emilio Cobos Álvarez
41d375b7d9 [components] ktlint: Add missing newlines.
Running ./gradlew ktlint locally reports a lot of stuff like:

/home/emilio/src/moz/android-components/components/support/migration/src/test/java/mozilla/components/support/migration/MigrationIntentProcessorTest.kt:1:1: File must end with a newline (\n)

This fixes it with:

    for f in $(cat files | cut -d : -f 1); do echo "" >> $f; done

Making ./gradlew ktlint pass.
2020-12-03 17:24:44 +00:00
Sebastian Kaspari
b067fd7e21 [components] Fix new lint errors after AndroidX update. 2020-12-02 12:17:31 +00:00
Arturo Mejia
0013bea26e [components] Closes https://github.com/mozilla-mobile/android-components/issues/9073 remove unwanted dots in the file name 2020-12-02 00:54:58 +00:00
Mozilla L10n Automation Bot
7e250bf34b [components] Import l10n. 2020-11-25 00:21:59 +00:00
Grisha Kruglov
5b5dfac4b6 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8864: Allow migrating FxA with Chinese servers 2020-11-17 07:03:28 +00:00
Grisha Kruglov
fccdfe85de [components] Post: update metrics.md files 2020-11-13 23:46:17 +00:00
Mozilla L10n Automation Bot
0556fe0333 [components] Import l10n. 2020-11-12 00:14:35 +00:00
Sebastian Kaspari
c56f79ca03 [components] Revert "Import l10n." (lint errors)
This reverts commit 8942f787ed901de4a170f436ba843918c9900966.
2020-11-11 16:31:53 +01:00
Mozilla L10n Automation Bot
f0aad721ff [components] Import l10n. 2020-11-11 14:41:19 +00:00
Travis Long
cd0e42b8e8 [components] [SYNC-1682] Create a new Nimbus component that uses the nimbus-sdk
This adds a new Nimbus component that will act as a wrapper around the uniffi generated Kotlin code from mozilla/nimbus-sdk, as well as be a point of Glean integration, at least initially.

- Integrate service-nimbus with samples-glean for testing
- Set up default endpoint for debug and release, debug pointing at the dev Kinto endpoint and release at the production endpoint.
- Adds the documentation on how to set up the Kinto dev endpoint.
- Updates samples-glean README with Nimbus wording
2020-11-11 12:22:40 +00:00
Michael Comella
1feca23e0b [components] For https://github.com/mozilla-mobile/android-components/issues/8911: await for threading to complete in LazyComponent test.
I wasn't able to reproduce so this is a speculative fix.
2020-11-10 15:10:39 +00:00
Michael Comella
d3561ccbb9 [components] For #15279 - review: set LazyComponent.isInitialized to internal. 2020-11-05 19:00:31 +00:00
Michael Comella
68e04ef68b [components] For https://github.com/mozilla-mobile/fenix/issues/15279 - review: clarify LazyComponent comments. 2020-11-05 19:00:31 +00:00
Michael Comella
00080d7267 [components] For https://github.com/mozilla-mobile/fenix/issues/15279: add LazyComponent, tests. 2020-11-05 19:00:31 +00:00
Mozilla L10n Automation Bot
665146892b [components] Import l10n. 2020-10-31 00:21:41 +00:00
Stefan Arentz
c234ccf2a0 [components] Fixes 8796 - Telemetry renewal for expiring migration probes (https://github.com/mozilla-mobile/android-components/pull/8844) 2020-10-29 19:55:01 +00:00
Sebastian Kaspari
e445c6eb58 [components] Update to Gradle 6.1.1, Android Gradle plugin 4.0.1, Kotlin 1.4 and Coroutines 1.3.9.
This patch reintroduces the changes from PR https://github.com/mozilla-mobile/android-components/pull/8360 that we reverted in PR https://github.com/mozilla-mobile/android-components/pull/8623. Now the issues in
Fenix are resolved and we can land this again.
2020-10-19 07:01:53 +00:00
Roger Yang
181b80b39f [components] Closes https://github.com/mozilla-mobile/android-components/issues/8653: Send structured java stack trace in crash reports to Socorro 2020-10-16 15:00:13 +00:00
Arturo Mejia
075e18b446 [components] Closes issue https://github.com/mozilla-mobile/android-components/issues/8425: Allow filename to be optional in the ContentDisposition regex 2020-10-16 13:11:38 +00:00
Mozilla L10n Automation Bot
db3ec2b886 [components] Import l10n. 2020-10-14 00:21:45 +00:00
Mozilla L10n Automation Bot
3a10b25427 [components] Import l10n. 2020-10-09 00:18:12 +00:00
Sebastian Kaspari
87b356108c [components] Issue https://github.com/mozilla-mobile/android-components/issues/7863: Add RegionMiddleware that adds a RegionState to the store. 2020-10-08 13:39:22 +00:00
Sebastian Kaspari
9a5e48b10b [components] support-test: Add fake implementations for Context, SharedPreferences and wrapping System.currentTimeMillis. 2020-10-08 13:39:22 +00:00
Christian Sadilek
240cb89f55 [components] Closes https://github.com/mozilla-mobile/android-components/issues/7976: Use different port for article and reader pages 2020-10-07 01:33:30 +00:00
Christian Sadilek
f210e82256 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8609: Intermittent test failues in WebExtensionSupportTest 2020-10-06 23:12:43 +00:00
Roger Yang
b8953c942d [components] Closes https://github.com/mozilla-mobile/android-components/issues/8619: Add maximum length for Socorro crash report stack trace 2020-10-06 15:36:37 +00:00
Jonathan Almeida
ac73bae091 [components] Close https://github.com/mozilla-mobile/android-components/issues/8040: Move ImageLoader to support-base
The `ImageLoader` API is public and we should have it in a better place.
2020-10-06 14:39:58 +00:00
Sebastian Kaspari
9afa3a75f7 [components] Revert Gradle, Android Gradle Plugin and Kotlin upgrade. (PR https://github.com/mozilla-mobile/android-components/pull/8360)
Revert "Address even more lint errors."

This reverts commit e98ee991b34d318e671c644d63daec53902e68ff.

Revert "Update to Gradle 6.6.1."

This reverts commit cdda701c8f2be6c0486ddf1494885accf78aab00.

Revert "Address lint errors."

This reverts commit 26cb5b27bc2be672c89e7e0c63eeeda9f64c0d08.

Revert "Move JNA configuration to root project."

This reverts commit 694ef37cc30e727f3ec5d275c0e9583385980a43.

Revert "Issue https://github.com/mozilla-mobile/android-components/issues/8319: Update to Kotlin 1.4, Coroutines 1.3.9 and Android lint 27.0.1."

This reverts commit ad675c35e794050dbf8514a2d2fe7506ce0c546c.

Revert "Update Glean to 33.0.4."

This reverts commit 4731c4e2fa52d40f4062a47f02078ca0c85de632.

Revert "Update Glean to 33.0.0."

This reverts commit 352cf88a4d4bad64330d0ec997814fd8b13928c2.

Revert "Update Gradle to 6.1.1."

This reverts commit 18e88aa1a2528b10f7d81ff9dbf1df094071b6ce.

Revert "Update Android Gradle Plugin to 4.0.1."

This reverts commit f915a3b47b0f5584889ff62a80c9642bccfa36ce.
2020-10-06 14:57:11 +02:00
Mozilla L10n Automation Bot
36ce0e9fb8 [components] Import l10n. 2020-10-06 00:27:25 +00:00
Arturo Mejia
593c25629e [components] Closes https://github.com/mozilla-mobile/android-components/issues/8312:Adds support for ContentDelegate#onExternalResponse 2020-10-05 17:32:38 +00:00
Mozilla L10n Automation Bot
35c8de4ab5 [components] Import l10n. 2020-10-05 00:29:08 +00:00
Mozilla L10n Automation Bot
51662a3fe3 [components] Import l10n. 2020-10-04 00:25:33 +00:00
Sebastian Kaspari
6429e13dea [components] Move JNA configuration to root project. 2020-10-02 18:44:27 +00:00
Sebastian Kaspari
b5ba7558a2 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8529: Dispatch a generic InitAction from BrowserStore
Co-authored-by: Christian Sadilek  <christian.sadilek@gmail.com>
2020-09-30 17:31:15 +00:00
Mozilla L10n Automation Bot
7286b82036 [components] Import l10n. 2020-09-30 10:13:19 +00:00
mcarare
cd6d271c2a [components] For https://github.com/mozilla-mobile/android-components/issues/8298: Limit title length in HitResult. 2020-09-29 10:33:37 +00:00
Grisha Kruglov
11d4f67fe1 [components] Glean doc update 2020-09-25 18:58:08 +00:00
Mozilla L10n Automation Bot
b427b25d68 [components] Import l10n. 2020-09-25 00:22:10 +00:00
Mozilla L10n Automation Bot
297806486b [components] Import l10n. 2020-09-23 00:20:11 +00:00
Grisha Kruglov
f45574c5fb [components] Lint and test fixes 2020-09-22 20:40:24 +00:00
Grisha Kruglov
ee28f42d71 [components] Account manager state machine refactoring 2020-09-22 20:40:24 +00:00
Grisha Kruglov
63a08db530 [components] Short-circuit MP presence check for non-Fennec installs 2020-09-18 23:33:22 -07:00