Commit Graph

62 Commits

Author SHA1 Message Date
Lina Butler
9fc26ee91c Bug 1891157 - Add a feature and a use case for closing synced tabs. r=jonalmeida,android-reviewers,007
This commit introduces plumbing for sending "close tab" commands to
other devices that are signed in to the same Mozilla account, and for
receiving "close tab" commands from other devices.

Differential Revision: https://phabricator.services.mozilla.com/D208051
2024-05-05 22:07:11 +00:00
Tarik Eshaq
9874577847 Bug 1878910: Fixes duplicate FxA sessions. r=android-reviewers,jonalmeida
We used to get a session token for Fenix using a special oauth scope,
however that scope leads to there being two session tokens assosiated
with Fenix, one assosiated with the web content and another with the
scope. This patch makes it so that there is only one session token
shared between the content and browser.

Differential Revision: https://phabricator.services.mozilla.com/D205381
2024-04-23 00:58:32 +00:00
Ben Dean-Kawamura
3b3e14c165 Bug 1855291 - Handle FxA exceptions in getManageAccountURL
I didn't make any unit tests for this since it seemed fairly trivial,
but I can add them if needed.
2023-10-12 17:45:00 +00:00
mcarare
063c553913 Bug 1849833 - Replace deprecated compileSdkVersion.
This is replaced by defaultConfig compileSdk.
2023-09-11 06:36:20 +00:00
Mark Hammond
0bc6185532 Bug 1810630 - add 'manage account' to the sync menu. (https://github.com/mozilla-mobile/firefox-android/pull/2566) 2023-06-22 19:47:50 +00:00
Tarik Eshaq
9b0af3d7bc Bug 1832676: Fixes handle push breaking changes 2023-05-24 21:33:58 +00:00
Tarik Eshaq
f09b5f43ec Bug 1804274: Adds entrypoints for firefox accounts
Co-authored-by: Matt Tighe <MatthewTighe>
Co-authored-by: Jonathan Almeida <jalmeida@mozilla.com>
Co-authored-by: Tarik Eshaq <teshaq@mozilla.com>
2023-05-19 04:01:09 +00:00
Jonathan Almeida
4c80c7d35d Bug 1794204 - Remove AccountSharing migration from FxaAccountManager 2023-03-30 16:53:12 +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
Christian Sadilek
4091b14a33 Fix android lint in composite builds 2022-11-21 13:40:53 -05: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
Grigory Kruglov
6cc93c9d7e [components] Allow observing if account manager is ready
'ready' here means that account manager can now be queried for the account state.
2022-03-08 21:44:22 +00:00
bendk
ca1959ab5e [components] Uniffi sync manager / Upgrade to A-S 87.1.0 (https://github.com/mozilla-mobile/android-components/pull/11256)
* Use registerWithSyncManager for places (https://github.com/mozilla-mobile/android-components/issues/10128)

* Remove the getHandle() method

Fixes https://github.com/mozilla/application-services/issues/1877

* Updating fxa code to work with the new UniFFIed SyncManager API

* Bumping appservices version

* Fixing PlacesHistoryStorageTest

* Bumping appservices version
2021-12-14 22:09:32 +00:00
Sebastian Kaspari
98ab7b1b5f [components] Fix or suppress warnings from new detekt version. 2021-05-25 15:22:17 +00:00
Grisha Kruglov
0d4aa38533 [components] Introduce AutofillCrypto and add encryptio/decryption and key management to credit card storage 2021-04-21 21:06:50 +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
Christian Sadilek
c9d791c53b [components] Adjust detekt TooManyFunctions threshold 2021-03-18 15:25:40 +00:00
Grisha Kruglov
0bfce9ce48 [components] Closes https://github.com/mozilla-mobile/android-components/pull/9864: Remove authorizeOAuthCode from the FirefoxAccount API 2021-03-11 04:24:21 +00:00
Grisha Kruglov
a90d794cfa [components] Add debug logging for Send Tab and Push code 2020-10-27 20:29:34 +00:00
Grisha Kruglov
77382eec47 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8492: Gracefully handle network failures while obtaining token server url 2020-09-25 18:58:08 +00:00
Grisha Kruglov
ee28f42d71 [components] Account manager state machine refactoring 2020-09-22 20:40:24 +00:00
Mark Hammond
9ad487fb67 [components] Update application-services to version 63.0.0 2020-09-16 11:58:54 +10:00
Grisha Kruglov
82693b875b [components] Closes https://github.com/mozilla-mobile/android-components/issues/7570: Add an auth-recovery circuit breaker
This adds a sliding time-window, within which allow for only a certain number
of authErrors to trigger our recovery flow. If the number of incoming errors
is higher than our limits, state machine is transitioned into an 'unauthorized'
state, which will break potential auth-recovery loops.
2020-07-01 00:31:56 -07:00
Edouard Oger
bc3a9abfca [components] Closes https://github.com/mozilla-mobile/android-components/issues/6253: Update application-services to v0.55.0 2020-03-16 15:48:16 -04:00
Grisha Kruglov
cafddbcb8c [components] Closes https://github.com/mozilla-mobile/android-components/issues/5715: Login storage refactor
This refactor changes how (most) consumers are expected to interact with the logins storage.
Instead of "locking"/"unlocking" the store whenever its needed, a connection to a storage
layer is now cached on first access and re-used for subsequent operations.

Various components relying on logins storage have been simplified.
2020-03-03 04:23:25 -08:00
Mark Hammond
4cc2e9888c [components] detekt/ktlint 2020-02-25 18:08:23 -08:00
Mark Hammond
e345e048de [components] Update to application-services 0.52.0. Fixes https://github.com/mozilla-mobile/android-components/issues/5999 2020-02-25 18:08:23 -08:00
Grisha Kruglov
fc0c5e5323 [components] Offline FxA migration support 2020-02-05 15:58:09 +01:00
Grisha Kruglov
c8ce05109e [components] Pre: bump a-s dependency to 0.48.1, expose migration metrics 2020-01-09 16:32:52 -08:00
Edouard Oger
edb7e4f504 [components] Closes https://github.com/mozilla-mobile/android-components/issues/5006: Add RemoteTabsStorage to storage-sync
The tabs engine `sync` method signature needs to be different than
the one currently defined in `SyncableStore.sync`.
`StorageSync` is the only user of the interface method and is deprecated
already.
This patch removes the `StorageSync` class and makes the store `sync`
methods not inherited from any interface.
2019-12-02 10:19:55 -05:00
Grisha Kruglov
21f9a897a6 [components] FxA cleanup: remove authErrorRegistry
The sole reason for authErrorRegistry was to expose an instance of FxaAccountManager
to internal components which don't have direct access to it. The registry acted
an internal singleton, but with a bunch of overhead and conceptual complexity around it.

This patch simplifies this: it adds an actual singleton instead of the registry, with a
simple API for components to call into if they encounter authentication errors.

Behaviour of `handleFxaExceptions` also changed slightly, to reduce cognitive overhead:
- instead of calling into an Async function on the observer, and ignoring the result,
this API is now simply `suspend`, which allows us to reason about error handling within
the FxA state machine terms of structured concurrency.

Other cleanup involves marking an expensive OAuthAccount method as async, as well as some
simplification of error handling in FirefoxAccount.
2019-11-18 15:48:04 -08:00
Grisha Kruglov
4a4cd730d4 [components] Address review feedback 2019-11-05 12:35:11 -08:00
Grisha Kruglov
66f263a668 [components] Cleanup dataprotect link/detekt issues, add tests 2019-11-04 17:33:33 -08:00
Grisha Kruglov
ed1f9af6d2 [components] Closes https://github.com/mozilla-mobile/android-components/issues/4741: lock/unlock password store while syncing 2019-11-04 16:26:43 -08:00
Colin Lee
09be62dba7 [components] Closes https://github.com/mozilla-mobile/android-components/issues/4926: service-fxa module needs authorizeOAuthCode methods 2019-11-01 14:53:28 -05:00
Grisha Kruglov
b1a7c46ea4 [components] Part 3: Rust SyncManager integration
Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
2019-09-27 12:39:48 -07:00
Grisha Kruglov
25f8283dc7 [components] Closes https://github.com/mozilla-mobile/android-components/issues/4445: expose getCurrentDeviceID and getSessionToken FxA methods
This bumps A-S to 0.39.1, which exposes these methods, and comes with a Sync Manager!
2019-09-18 01:46:32 -07:00
Grisha Kruglov
90c672875e [components] Closes https://github.com/mozilla-mobile/android-components/issues/4350: Allow for a missing action param in FxA auth flows
It's possible that `action` parameter may be missing. This patch adds handling for that case,
and tests for the interceptor (which were missing entirely) that cover all combinations.
2019-09-09 14:10:05 -07:00
Grisha Kruglov
34bcecbf2a [components] Post: address review feedback and test/lint failures 2019-09-04 11:41:58 -07:00
Grisha Kruglov
aef7bd7dd5 [components] Part 2: FxA WebChannel account manager integration
This patch does a few things:
- adds a webextension for communicating with fxa web content
- provides a backend for said webextension, which understands webchannel communication protocol
and knows how to relay messages to the account manager, and query its state
- expands account manager a bit to support the webchannel authentication protocol
- adds a (rather detailed!) AuthType parameter to AccountObserver:onAuthenticated, instead of the very vague 'newAccount' flag

Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
Co-authored-by: vladikoff <vlad.filippov@gmail.com>
2019-09-04 11:41:56 -07:00
Grisha Kruglov
dc5c888a08 [components] Part 3: Simplify device management code
This removes ability to automatically poll for device events.
That removal allows for a nice simplification of the two awkward classes
that split the same responsibilities.

Ability to automatically poll in the background is removed because we now
have proper push support (see `feature-push` and friends). Automatic polling
isn't something we'd like to see applications engage in, so let's not enable them.

Manual event polling is still possible via a simplified API call.
Refreshing constellation state is now possible without polling for events.
2019-08-19 13:04:39 -07:00
Jonathan Almeida
ee1ca64190 [components] Closes https://github.com/mozilla-mobile/android-components/issues/4069: Update docs for newAccount param 2019-08-14 09:11:14 -04:00
Grisha Kruglov
129ba79445 [components] No issue: bump a-s to 0.37.1 2019-08-13 14:52:36 -07:00
Grisha Kruglov
4adfb862a5 [components] Revert "No issue: bump a-s to 0.37.0"
This reverts commit 6c04b3ca8a.
2019-08-09 14:15:33 -04:00
Grisha Kruglov
767ca6532a [components] No issue: bump a-s to 0.37.0
Some nice improvements:
- 0.37.0 fixes behaviour of `FirefoxAccount.disconnect` - device records will now be removed on logout.
- 'wantsKeys' is no longer necessary, so we get a simpler API
- new device type for upcoming integrations
2019-08-09 10:52:31 -07:00
Grisha Kruglov
51d2acaacb [components] No issue: use 'FirefoxAccount@disconnect' instead of destroying current device
'disconnect' API was introduced recently which destroys the device record.
This means we can remove relevant code from a-c which used to do the same work.
2019-08-07 13:52:29 -07:00
Jonathan Almeida
52569607d3 [components] Closes https://github.com/mozilla-mobile/android-components/issues/3964: Add onAuthenticatedLogin to AccountObserver 2019-08-01 20:50:14 -04:00
Jonathan Almeida
c23c061608 [components] Closes https://github.com/mozilla-mobile/android-components/issues/3734: Add default impl for AccountObserver 2019-08-01 20:50:14 -04:00
Grisha Kruglov
1c6d4c3bbc [components] Closes https://github.com/mozilla-mobile/android-components/issues/2775: Support signing in with shared Firefox account 2019-07-26 15:09:36 -04:00