fune/mobile/android/android-components/components/browser/storage-sync/src
Lina Butler 9950994d0d Bug 1895171 - Queue outgoing synced tabs commands. r=markh,jonalmeida,007,android-reviewers
This commit adopts the new `RemoteCommandStore` interface to queue
and flush outgoing tab management commands. It works like this:

* `DeviceCommandQueue` provides a generic interface for
  queueing and flushing device commands. Any queueable command can
  implement the `DeviceCommandQueue.Type` marker interface.
* `RemoteTabsCommandQueue` specializes `DeviceCommandQueue` for
  remote tabs commands. The implementation wraps the Rust
  `RemoteCommandStore` interface.
* `SyncedTabsCommands` connects a `RemoteTabsCommandQueue`
  to an `FxaAccountManager` for sending the commands.
* `BackgroundServices` observes the `SyncedTabsCommands` queue, and
  schedules a `SyncedTabsCommandsFlushWorker` to flush the queue
  when a command is added.
* The synced tabs `DefaultPresenter` also observes the
  `SyncedTabsCommands` queue, and refreshes the list of tabs when
  the queue is updated.

The queue allows for retries if the command can't be sent, for eventual
expiration of commands that haven't been sent, and for undoing a close,
though the latter two aren't implemented in this commit.

Differential Revision: https://phabricator.services.mozilla.com/D210887
2024-06-01 02:15:15 +00:00
..
main Bug 1895171 - Queue outgoing synced tabs commands. r=markh,jonalmeida,007,android-reviewers 2024-06-01 02:15:15 +00:00
test Bug 1895171 - Queue outgoing synced tabs commands. r=markh,jonalmeida,007,android-reviewers 2024-06-01 02:15:15 +00:00