Commit graph

96 commits

Author SHA1 Message Date
Issam Mani
e18d4f3671 Bug 1880075 - Use single name field for addresses 2024-02-26 18:18:40 +00:00
Tarik Eshaq
5bbaa8a7b9 Bug 1870923: Removes wipe from SyncableLoginsStorage 2023-12-20 16:38:01 +00:00
Mark Hammond
c5bdf6fff4 Bug 1858789 - vastly more efficient counting of bookmarks for the home activity. 2023-12-12 23:18:02 +00:00
Sammy Khamis
1c35a86353 Bug 1862350 - Remove old History delete APIs 2023-11-02 19:37:28 +00:00
Sammy Khamis
5dfad08a18 Bug 1855586 - Update VisitType enum from a-s 2023-10-17 13:15:40 +00:00
mcarare
063c553913 Bug 1849833 - Replace deprecated compileSdkVersion.
This is replaced by defaultConfig compileSdk.
2023-09-11 06:36:20 +00:00
MatthewTighe
076307442c Bug 1839158 - Ignore invalid credit card save requests 2023-08-01 23:48:17 +00:00
MatthewTighe
c87183c8b5 Bug 1843168 - Expose Mockito through test support component 2023-07-24 18:02:09 +00:00
rahulsainani
52aa9e8471 Bug 1836447 - Make extension functions member functions of BookmarkNode 2023-06-06 09:55:52 +00:00
mcarare
1f589a2e0b Bug 1802817 - Set namespace via DSL in gradle build files.
See https://developer.android.com/studio/build/configure-app-module#set-namespace
and https://issuetracker.google.com/issues/172361895
2023-03-02 17:13:09 +00:00
mcarare
922b5f6643 Bug 1802817 - Rename AC Dependencies to ComponentsDependencies.
This change is needed in order to avoid clashes with Dependencies class introduced
in Gradle from 7.6 version.
2023-03-02 17:13:09 +00:00
Mugurell
29325133df Bug 1800268 - Refactor ToolbarAutocompleteFeature to allow easily changing providers
This class drives the autocomplete feature and previously only allowed for
adding a history or domains autocomplete provider.
With the new changes it will support adding and removing any autocomplete
provider individually or in bulk.
2023-01-31 11:15:37 +00:00
Mugurell
fdde48d8c7 Bug 1804258 - Prevent overlapping of cancel requests for history reads
With more search providers querying the same history storage but only after
they try to cancel the in-progress queries it is possible for the cancel
requests to overlap and one search provider to cancel the queries of another.

To mitigate this a new method is available which will use the current input to
query the storage for as a way to drop new cancel requests for the same input.
2023-01-30 16:20:03 +00:00
Tarik Eshaq
5e7c910e0d Bug 1803632 - Removes remaining Fennec to Fenix migration functions (https://github.com/mozilla-mobile/firefox-android/pull/245)
* Bug 1803632: Removes fennec migration code

* Adds changlog for fennec to fenix migration removal

* Fixes ktlint errors

* Fixes broken test build
2022-12-01 22:04:56 +00:00
Christian Sadilek
4091b14a33 Fix android lint in composite builds 2022-11-21 13:40:53 -05:00
kycn
73c1c15596 Bug 1795903 - Introduce StorageMaintenanceWorker that runs periodically to prune places storage.
WorkManager's Worker is created for periodically running storage maintenance operation on places database.
DB size limit is exposed from A-S that indicates the maximum DB size to aim for, in bytes. If the database
exceeds this size, a small number of visits will be pruned. This operation is done periodically by a periodic
work request that, optimally, will run once a day as long as the worker constraints are met.
2022-11-02 17:46:39 +00:00
Gabriel Luong
d9d783b698 [components] Issue https://github.com/mozilla-mobile/android-components/issues/12939: Address all ktlint issues 2022-10-17 17:07:40 -04:00
Mugurell
994b3515f0 [components] For https://github.com/mozilla-mobile/android-components/issues/12469 - Cancel in progress storage requests before new awesomebar suggestions 2022-07-18 11:29:45 +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
Gabriel Luong
8d5bf13b1c [components] Issue https://github.com/mozilla-mobile/android-components/issues/12365 - Return an address label based on the available address properties 2022-06-22 13:41:41 +00:00
Gabriel Luong
16930d4ab3 [components] Issue https://github.com/mozilla-mobile/android-components/issues/12348 - Pass the full name to the Autocomplete.Address.Builder 2022-06-17 15:36:18 +00:00
Noah Bond
c4888ae0b0 [components] For https://github.com/mozilla-mobile/android-components/issues/12188 - Fix crash caused by an empty expiration year or month 2022-05-19 23:19:14 +00:00
Gabriel Luong
25f179051d [components] Issue https://github.com/mozilla-mobile/android-components/issues/11338: Add a SaveCreditCard dialog to handle saving and updating a credit card 2022-05-10 21:44:28 +00:00
Alexandru2909
c0cfad31b3 [components] For https://github.com/mozilla-mobile/android-components/issues/12060 - Add support for select address prompt request 2022-05-09 08:11:24 +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
Gabriel Luong
9e8e37e04b [components] Issue https://github.com/mozilla-mobile/android-components/issues/12019: Make the Address data class parcelable 2022-04-17 23:17:39 +00:00
mavduevskiy
a9bc32eff1 [components] Closes https://github.com/mozilla-mobile/android-components/issues/11655: expose HistoryVisitInfo.isRemote; update A-S to 91.0.1 (https://github.com/mozilla-mobile/android-components/pull/11656)
* Closes https://github.com/mozilla-mobile/android-components/issues/11655: expose HistoryVisitInfo.isRemote

* Closes https://github.com/mozilla-mobile/android-components/issues/11655: expose HistoryVisitInfo.isRemote

Co-authored-by: mike a <mavduevskiy@gmail.com>
2022-02-02 19:38:55 -08: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
Grisha Kruglov
3564cdab80 [components] Remove debug lock owner from the KeyManager mutex
I've misread the API, specifying this `owner` is causing lots of ISEs,
while this code shouldn't deadlock in practice.
2021-12-16 10:19:51 -08:00
Grisha Kruglov
122ebc35ee [components] Closes https://github.com/mozilla-mobile/android-components/issues/11099: Introduce KeyManager structure
This adds an abstract KeyManager class to our storage component, which
establishes a pattern of managing keys as used by our storage classes
that require encryption.

AutofillCrypto and LoginsCrypto become implementors of this basis class,
allowing them to explicitly share structure and some core functionality.
2021-12-14 20:10:38 +00:00
Grisha Kruglov
af9ea54a0d [components] Closes https://github.com/mozilla-mobile/android-components/issues/11368 - Handle key recovery flow for credit cards storage
- remove KeyRecoveryHandler indirection, I don't think it was adding
  any value
- AutofillCrypto and LoginsCrypto are now taking shape of a 'key
  manager' type objects - they know how to get, validate and store keys,
  as well as recover corresponding storage classes from key loss.
- AutofillCrypto now scrubs credit cards - removes encrypted CC numbers
  and resets the sync engine - in case of key loss.
2021-12-14 20:10:38 +00:00
Christian Sadilek
83f85e62d7 [components] Support deletion of history metadata by url 2021-11-23 16:22:28 -05:00
Ben Dean-Kawamura
747783ef34 [components] Make findLoginToUpdate suspend
It access the DB, so it should be suspend like the other methods.
2021-11-16 22:47:25 +00:00
Grisha Kruglov
53817d0ad1 [components] Move shouldStoreUri to storage; short-circuit engine delegates
In feature-session we had some logic to filter out certain URIs. This
patch moves this logic into the storage layer, so that it has a broader
coverage - whenever we attempt to write some URL into the storage, we'll
now go through this filter.

Before, we'd only go through this filter for writes that were routed via
the HistoryDelegate.

After this change, direct writes (such as for metadata) are also
covered.

This shouldn't change all that much - the storage implementation is
likely to have rejected these URIs. Now, instead of letting it through
exceptions at us (which we catch and report via sentry), we simply don't
even call into the storage if we don't expect these calls to succeed.

This should reduce volume of "url without base" type of 'info' events we
see in Sentry.
2021-11-16 00:22:35 +00:00
Grisha Kruglov
70bad89d04 [components] Post: Simplify handling of PageVisit#redirectSource
Most of the time redirectSource isn't set, so this makes that field
optional, and switches away from a special enum (NOT_A_SOURCE) to just a
simple nullable.
2021-11-09 21:27:05 +00:00
Ashutosh Singh
642b034e4d [components] Removal of browser-storage-memory (https://github.com/mozilla-mobile/android-components/pull/11211)
* deleted module and related files along with occurrences

* lint fixes

* used PlacesHistoryStorage for storage and readmeFix

* test fixes 1

* Update feature-awesomebar tests to use mocked HistoryStorage

* Linter fixes for feature-awesomebar

* toolbar fix 1

* toolbar fix

* final code cleanup

Co-authored-by: Grisha Kruglov <gkruglov@mozilla.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-11-05 09:27:22 +00:00
Gabriel Luong
7fe5c17265 [components] Issue https://github.com/mozilla-mobile/android-components/issues/11155 - Integrate onPreviewImage API from GeckoView 2021-10-25 20:46:09 +00:00
Grisha Kruglov
a588b753bf [components] Make linters happy 2021-10-13 20:30:28 -07: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
57aa69af8e [components] Upating the LoginsStorage API to match the changes from a-s.
Updated `GeckoLoginStorageDelegate` to use the new `addOrUpdate()`
function.

Updated `LoginValidationDelegate` to use the new `findLoginToUpdate()`
function.  Removed the Result.Error class.  It was only returned from
`ensureValidAsync`, which we don't call anymore because `addOrUpdate()`
now does the validation.  This means that we will now throw an error
instead of doing a no-op, hopefully that's okay.  Removed the not
threadsafe warnings.  I think this the login storage code should be
threadsafe in general because we use Arc/Mutex on the rust side

A key difference is that `shouldUpdateOrCreateAsync()` now inputs
`LoginEntry` rather than a `Login`.  The old code had some confusing
bits with how it handled the `guid` field.  For example, we could pass a
`Login` with a `guid` set to the `SaveLoginPrompt`, but depending on
what the final username was and how the dupe-checking turned out, we
could end up updating a login with a different `guid` or creating a new
login altogether.  Using `LoginEntry` hopefully makes the story clearer.

There are a few edge cases where the behavior may change now that we no
longer use a GUID in the dupe-calculation.  I'm pretty sure that it
shouldn't really change things from a user's point of view, but I need
to double-check the use cases here.

`Login.guid` is now non-nullable.  `LoginEntry` should be used for login
data to be saved.

Replaced the field-level documentation in the `service:sync-logins`
README with a note to check out docs from `cconcept-storage`.  The
README was just a copy of the documentation from `LoginsStorage.kt` and
it seems better refer people there rather than duplicate it.

Removed the unit tests.  The main thing they were testing was
the `LoginValidationDelegate` dupe-handling but now that code is very
simple and and there are tests for `findLoginToUpdate()` in a-s
(components/logins/src/login.rs).
2021-10-13 20:30:28 -07:00
Grisha Kruglov
385e0efd8e [components] Add API for deleting metadata search term groups 2021-09-29 18:45:18 -04:00
Grisha Kruglov
d6ab47d025 [components] Update to A-S 85.2.0, expose A-S highlights API 2021-09-29 14:24:34 -07:00
Gabriel Luong
2d5e708612 [components] Issue https://github.com/mozilla-mobile/android-components/issues/11008 - Make HistoryMetadataKey parcelable 2021-09-21 12:04:08 -04:00
Grisha Kruglov
5148be5381 [components] Account for breaking changes associated with previewImageUrl 2021-09-14 05:40:48 +00:00
Grisha Kruglov
b628c1badc [components] Adds history metadata delete API 2021-09-09 23:38:30 +00:00
Sebastian Kaspari
ce323400dd [components] Run ktlintFormat to fix new ktlint errors. 2021-07-28 12:03:23 +00:00
mcarare
23e050a3c3 [components] For https://github.com/mozilla-mobile/android-components/issues/10670: Add optional parameter to filter recent bookmarks based on added date. 2021-07-23 16:06:47 +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