Commit graph

24 commits

Author SHA1 Message Date
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
codrut.topliceanu
3bd5ddb4a0 [components] For https://github.com/mozilla-mobile/android-components/issues/10603 - Adds createdAt to TabSessionState 2021-08-02 10:07:38 +00:00
Sebastian Kaspari
ce323400dd [components] Run ktlintFormat to fix new ktlint errors. 2021-07-28 12:03:23 +00:00
Mugurell
d67a681ba6 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Add a new mediaSessionActive property to LastMediaAccessState
This new property helps with separating the current responsibilities of
lastMediaAccess such that after this:
- lastMediaAccess is only updated when media starts playing allowing clients to
order media tabs and find the first / last tab with in progress media.
- lastHadMediaSessionActive indicates whether a MediaSession should be active
for this tab and serves as a backup for lastMediaUrl for the situations where a
website might allow media to continue playing even when the users accesses
another page (with another URL) in that same HTML document.
2021-07-21 19:10:46 +00:00
Mugurell
58cf65e681 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Persist and restore tab LastMediaAccessState 2021-07-21 19:10:46 +00:00
Mugurell
0c7b4d7866 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Migrate TabSessionState's lastMediaAccess to LastMediaAccessState
LastMediaAccessState contains both
- lastMediaAccess - timestamp for the last time media started playing
(which is reset to 0 when GV deactivates the MediaSession)
- lastMediaUrl - tab url when media started playing

By combining this two properties we'll know that a tab has in progress media
even when:
- the user navigates to another page in the same document
but media continues to play, MediaSession exists, lastMediaAccess is not reset,
- media starts playing in another tab
but the previous media tab has the same url as lastMediaUrl.

After media starting to play in a tab only if
- user navigated to another website and
- MediaSession is deactivated (happens when navigating to another website or
when media starts playing in another tab)
will we consider that this tab doesn't anymore have in progress media.
2021-07-21 19:10:46 +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
4e14471fa6 [components] For https://github.com/mozilla-mobile/android-components/issues/10470 - Persist and restore lastMediaAccess of TabSessionState 2021-07-08 17:08:25 +00: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
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
Christian Sadilek
5e611f396b [components] Persist history metadata tab state 2021-06-01 21:02:36 +00:00
Sebastian Kaspari
6b7d487589 [components] Issue https://github.com/mozilla-mobile/android-components/issues/10070: Only keep one GeckoView component (tracking Nightly) 2021-04-20 18:51:39 +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
Sebastian Kaspari
8753b66468 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8370: Remove EngineSessionState.toJSON(). 2021-01-08 15:02:53 +00:00
Christian Sadilek
332672fb3a [components] Fix unit test classpath in browser-session-storage 2021-01-07 17:31:51 +00:00
Christian Sadilek
ea26229608 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9323: Add ability to filter tabs to TabsUseCases.restore 2021-01-07 15:04:58 +00:00
Sebastian Kaspari
8c9479eb8c [components] GeckoEngineSessionState: Handle empty engine session state. 2021-01-05 12:16:46 +00:00
Sebastian Kaspari
7964ec0108 [components] RecoverableBrowserState: Update kdoc. 2021-01-05 12:16:46 +00:00
Sebastian Kaspari
76621f83a6 [components] Add additional test cases to RestoringBrowsingSessionsTest. 2021-01-05 12:16:46 +00:00
Christian Sadilek
8522c7ccb0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9292: Crash when deserializing sessions with source field 2021-01-05 12:16:46 +00:00
Sebastian Kaspari
cf5dbc3cd0 [components] PR https://github.com/mozilla-mobile/android-components/pull/9250: Address review comments. 2021-01-05 12:16:46 +00:00
Sebastian Kaspari
bfbe4e5945 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9183, https://github.com/mozilla-mobile/android-components/issues/9199: Move SessionStorage from browser-session to browser-session-storage.
This is one piece of browser-session that we want to keep and moving it out allows more components to
not depend on browser-session anymore.

Multiple things are in this patch:
* Storage related code moved from browser-session to browser-session-storage
* BrowserStateSerializer gets split into BrowserStateWriter and BrowserStateReader
* SessionManager.Snapshot has been removed and we now save and restore independened from SessionManager.
  We already saved BrowserState. Now we restore into a generic `BrowsingSession`.
* feature-tab-collections no longer depends on browser-session.
* All restore code now goes through TabsUseCases instead of SessionManager directly.
2021-01-05 12:16:46 +00:00