Commit graph

323 commits

Author SHA1 Message Date
William Durand
1883946a8b Bug 1847088 - Show a notification in the Fenix add-on manager when the extensions process spawning is disabled 2023-10-09 22:02:14 +00:00
William Durand
f1f1138cc6 Bug 1810047 - Fixup WebExtensionPromptFeature 2023-10-05 21:08:45 +00:00
William Durand
126aebde87 Bug 1810047 - Implement UI for webextensions optional permissions. 2023-10-04 18:42:27 +00:00
rahulsainani
11a9d8f6d2 Bug 1847063 - Disable review checker in private mode 2023-09-27 10:40:07 +00:00
Gabriel Luong
d63efbb3d5 Bug 1853065 2023-09-20 17:33:34 +00:00
Cathy Lu
7d655590f3 Bug 1853309 - Expose Creating Shopping Analysis and Status API 2023-09-20 15:17:46 +00:00
Arturo Mejia
ca33172d7f Bug 1848100 - Implement add-ons installation failed listener 2023-09-12 16:18:54 +00:00
mcarare
063c553913 Bug 1849833 - Replace deprecated compileSdkVersion.
This is replaced by defaultConfig compileSdk.
2023-09-11 06:36:20 +00:00
mcarare
235c47209f Bug 1849833 - Replace deprecated kotlinOptions method. 2023-09-11 06:36:20 +00:00
mcarare
5a7b24763d Bug 1849833 - Replace qualified name with import. 2023-09-11 06:36:20 +00:00
mike a
7521c23079 Bug 1845613 – restore hidden engines for unified search settings 2023-09-08 01:34:02 +00:00
Matthew Tighe
45ca0bcb7d Bug 1721904 - update thumbnail caching on app open 2023-09-06 22:38:21 +00:00
Zac McKenney
8deb0f2a7a Bug 1846979 - Add extensions process spawning disabled dialog 2023-09-06 12:32:28 +00:00
owlishDeveloper
2a08983c96 Bug 1840693 - Expose Request Product Recommendations API 2023-08-10 02:39:42 +00:00
owlishDeveloper
1f27d0b055 Bug 1840692 - Expose Request Analysis Fakespot API 2023-08-09 21:29:34 +00:00
rahulsainani
51d3e44804 Bug 1840580 - Use BrowserState to detect product page for shopping experience 2023-08-09 10:20:37 +00:00
owlishDeveloper
803e68a86a Bug 1842638 - Expose GeckoView isProductUrl API to check if the current page is a product page [WIP][DO NOT MERGE] 2023-08-04 17:08:27 +00:00
t-p-white
031b375297 Bug 1842604 - Telemetry to measure Search results response time 2023-07-26 20:37:43 +00:00
MatthewTighe
c87183c8b5 Bug 1843168 - Expose Mockito through test support component 2023-07-24 18:02:09 +00:00
t-p-white
71d90ba619 Bug 1843586 - Update ContentState description to match current state 2023-07-17 14:27:40 +00:00
Arturo Mejia
674e01d7f1 Bug 1825124 - Change the way we show the post-install popup once an extension has been installed. 2023-06-21 16:46:00 +00:00
jackyzy823
3170224b8d Bug 1820404 - Persist ReaderView position state 2023-06-16 17:32:27 +00:00
jackyzy823
4540592440 Bug 1820404 - Keep ReaderView position state between active and inactive 2023-06-16 17:32:27 +00:00
Olivia Hall
0967f5078a Bug 1829213 - Update Save To PDF Telemetry and checkForPdfViewer Option
* Adds `checkForPdfViewer` to determine if page is a PDF Viewer page or not
* Adjusts save_to_pdf_failure to have extras of pdf, non-pdf, or unknown
* Adjusts save_to_pdf_failure to have extras of failure reason
* Adjusts save_to_pdf_tapped to have extras of pdf, non-pdf, or unknown
* Adds save_to_pdf_completed with extras of pdf, non-pdf, or unknown
2023-06-15 21:02:41 +00:00
Olivia Hall
4875874900 Bug 1836778 - Add Support for Printing in GeckoEngineSession
This bug adds an option to print the current page's content using the
Android Print Spooler via GeckoView with status on the Engine in AC.
2023-06-15 15:13:35 +00:00
mike a
b37b854ec6 Bug 1826473 – add new search engine settings screens 2023-06-12 23:18:18 +00:00
mcarare
07f8171b45 Bug 1831352 - Replace HitResult mocks with HitResult.UNKNOWN implementation.
Mockito cannot mock sealed classes.
2023-06-12 19:40:42 +00:00
mcarare
cf44574472 Bug 1831352 - Replace PromptRequest mock with PromptRequest.SingleChoice mocks.
Mockito cannot mock sealed classes.
2023-06-12 19:40:42 +00:00
William Durand
58a632b23d Bug 1825126 - Implement onInstallPermissionRequest in WebExtensionSupport.
Co-authored-by: William Durand <will+git@drnd.me>
Co-authored-by: arturo mejia <arturomejiamarmol@gmail.com>
2023-06-07 00:41:36 +00:00
Roger Yang
b61dc8f60d Bug 1830780 - Add support for adding distribution based default search engines list 2023-05-08 16:57:14 +00:00
Arturo Mejia
a7997d1829 Bug 1829371 - Expose an API to allow opening in third party app PDF files 2023-05-04 19:22:55 +00:00
Jeff Boek
735ff56ae1 Bug 1820211 - Adds tabKilled event to track when a tab was killed with form data. (https://github.com/mozilla-mobile/firefox-android/pull/1343)
* Bug 1820211 - Adds `tabKilled` event to track when a tab was killed with form data.

- Also includes if the tab was the active tab and whether the app was in the foreground.

* Bug 1820211 - Adds tests for TelemetryMiddleware and StoreLifecycleObserver

* Bug 1820211 - Renames CheckFormDataAction to UpdateHasFormData
- Removes @property hasFormData comment from sessionState
- Moves checking formdata from TabContentMiddleware to SessionPrioritizationMiddleware

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-04-05 22:03:25 +00:00
mcarare
278fa80cc2 Bug 1824717 - Remove unnecessary AndroidJUnit4 runner. 2023-04-05 12:44:13 +00:00
owlishDeveloper
83b0e8dc6c Bug 1806741 - Expose hasRuleForBrowsingContext API 2023-03-08 02:46:16 +00:00
Ryan VanderMeulen
0e5e70291c Bug 1820233 - Remove unneeded kotlin_stdlib inclusions and re-enable Werror in detekt build.gradle 2023-03-07 00:12:18 +00:00
t-p-white
194117d082 Bug 1809305 - Allow user to copy an image to the clipboard (https://github.com/mozilla-mobile/firefox-android/pull/948)
* Bug 1809305 - Allow user to copy an image to the clipboard

* Bug 1809305 - Update import & remove unnecessary gradle androidTestImplementation dependency

* Bug 1809305 - PR changes

* Bug 1819746 - Add explicit dependency to support-ktx

* Add buildconfig changes needed after adding support-ktx to componse-engine

---------

Co-authored-by: t-p-white <t-p-white>
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-03-06 12:16:22 +00:00
Ryan VanderMeulen
08532594e4 Bug 1820176 - Update AC to ktlint 0.48.2 2023-03-03 20:14:13 +00:00
mcarare
45f919de20 Bug 1802817 - Migrate packagingOptions DSL properties to resources sub-block.
exclude, pickFirst methods are deprecated.
2023-03-02 17:13:09 +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
Cathy Lu
7a27debf84 Bug 1800146 - Set tab's GeckoSession priority based on form data 2023-01-18 21:49:22 +00:00
Arturo Mejia
8a5bd1b7b6 Bug 1797568 - Allow to observe the cookie banner events for a given session. 2023-01-04 03:23:30 +00:00
Alexandru2909
fb35eb4eb7 Bug 1799679 - Preserve search terms for search engine result pages 2023-01-03 07:56:37 +00:00
Rahul Sainani
160cbe4f8c Bug 1796319 - Add functionality in SelectOrAddUsecase to ignore the fragment identifier part of the url (https://github.com/mozilla-mobile/firefox-android/pull/343)
* Bug 1796319 - Add functionality to match urls ignoring the fragment/anchor

* Bug 1796319 - Update SelectOrAddTabUsecase to add the ignoreFragment param

* Bug 1796319 - Add docs

Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
2022-12-19 15:42:33 +00:00
Christian Sadilek
4fcc97ab8d Revert "Bug 1799679 - Preserve search terms for search engine result pages"
This reverts commit bf984d2d9a1d6db4452393e0b4421e9b808f0bdf.
2022-12-13 12:39:05 -05:00
Gabriel Luong
386c363b22 Bug 1804594 - Differentiate search engines between "general" and "topic specific" when they are loaded 2022-12-12 21:51:07 +00:00
Alexandru2909
a8dc241789 Bug 1799679 - Preserve search terms for search engine result pages 2022-12-12 19:55:08 +00:00
Christian Sadilek
4091b14a33 Fix android lint in composite builds 2022-11-21 13:40:53 -05:00
DreVla
1b6e0def7e Bug 1800209 - Support for refreshing search engines when language is changed 2022-11-18 08:35:10 +00:00
Jonathan Almeida
11592be959 Bug 1799056 - Update onSaveToPdfError to onSaveToPdfException 2022-11-08 17:05:50 +00:00
Jonathan Almeida
61a134090e Bug 1795105 - Don't store thumbnails in BrowserState
Co-authored-by: ohall-m <93344309+ohall-m@users.noreply.github.com>
Co-authored-by: kycn <35106533+kycn@users.noreply.github.com>
2022-11-08 02:44:05 +00:00
Jonathan Almeida
7c764c6501 Revert "Bug 1795105 - Don't store thumbnails in BrowserState"
This reverts commit d9028ef2b230a03459fe20ab56bdce0acdce3aea.
2022-11-04 14:24:55 -04:00
Jonathan Almeida
bcc34f349e Bug 1795105 - Don't store thumbnails in BrowserState
Co-authored-by: ohall-m <93344309+ohall-m@users.noreply.github.com>
Co-authored-by: kycn <35106533+kycn@users.noreply.github.com>
2022-11-04 04:58:11 +00:00
Arturo Mejia
496f1135fc Bug 1796482 - Allow for notifying consumers on unsuccessful Save to PDF requests 2022-11-01 20:38:10 +00:00
mcarare
4ad330adbc [components] For https://github.com/mozilla-mobile/android-components/issues/12489: Upgrade kotlin, coroutines, compose compiler to latest versions.
Upgrade kotlin to 1.7.20, coroutines to 1.6.4 and compose compiler to 1.3.2.
Replace deprecated Xopt-in with op-in.
Replace deprecated Xjvm-default=enable with Xjvm-default=all.
Remove useIR property that is now default true.
2022-10-18 08:20:59 +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
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
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
mcarare
30e5a6f476 [components] For https://github.com/mozilla-mobile/android-components/issues/12402: Run Robolectric with SDK 32. 2022-06-29 16:31:33 +00:00
mcarare
2a1c468edc [components] For https://github.com/mozilla-mobile/android-components/issues/12376: Run Robolectric with SDK 31.
Current Robolectric version does not support SDK 32.
2022-06-28 13:42:14 +00:00
Alexandru2909
9096d03439 [components] For https://github.com/mozilla-mobile/android-components/issues/12217 - Add support for onPromptUpdate
- Handle ChoicePrompt updates
2022-06-02 15:01:29 +00:00
Arturo Mejia
b6b2484fcd [components] Closes https://github.com/mozilla-mobile/android-components/issues/12190: Create a middleware that allows to change tabs priority. 2022-05-26 13:38:30 +00:00
Roger Yang
09dd0c3e07 [components] Issue https://github.com/mozilla-mobile/android-components/issues/12149: Add support for application search engine type 2022-05-16 19:02:13 +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
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
mcarare
2275e49731 [components] For https://github.com/mozilla-mobile/android-components/issues/9684: Run tests on sdk 30. 2022-04-28 08:33:29 +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
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
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
Roger Yang
5fd04be267 [components] No issue: Add TabPartition tests 2022-01-19 23:43:56 +00:00
Roger Yang
5ebbe97126 [components] Close https://github.com/mozilla-mobile/android-components/issues/11383: Ensure each tab group does not have duplicate tab IDs 2022-01-12 23:18:58 +00:00
Roger Yang
fdd23e4a5f [components] Close https://github.com/mozilla-mobile/android-components/issues/11383: Add tabstray support for search term tab grouping logic with middleware 2022-01-12 15:27:26 +00:00
Jonathan Almeida
2916c0a537 [components] Close https://github.com/mozilla-mobile/android-components/issues/11444: Add optional user interaction param to goBack/goForward 2021-12-31 02:47:38 +00:00
Sebastian Kaspari
e2a4af5cf6 [components] Issue https://github.com/mozilla-mobile/android-components/issues/11300: EngineMiddleware: Add option for disabling TrimMemoryMiddleware 2021-11-23 18:43:44 +00:00
Christian Sadilek
e2b56538db [components] Closes https://github.com/mozilla-mobile/android-components/issues/11208: Add tab partitions and groups to BrowserState 2021-11-22 21:49:21 +00:00
Christian Sadilek
57173a94e0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/11241: TabSessionState.lastAccess not updated when application resumes 2021-11-09 13:57:57 -05: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
Sebastian Kaspari
90ec41fc3a [components] Update Kotlin and Jetpack Compose versions. 2021-10-25 10:58:07 +00:00
Grisha Kruglov
b356d9275a [components] Add DisbandSearchGroupAction to allow removing search groups from tab state 2021-10-13 10:13:39 -07:00
Christian Sadilek
743fcdaa5c [components] Issue https://github.com/mozilla-mobile/android-components/issues/11066: Make optimized load url case observable in middlewares 2021-10-13 15:42:38 +00:00
codrut.topliceanu
ef9c198245 [components] For https://github.com/mozilla-mobile/android-components/issues/10867 - Dismisses user prompt when GV calls onPromptDismiss 2021-10-06 14:47:52 +00:00
ssk97
6e1133eacf [components] Support Moving/Reordering Tabs (https://github.com/mozilla-mobile/android-components/pull/10936)
* Add MoveTabsAction and tests for it

* Add MoveTabsUseCase and a test

* Add getFilter to TabsFeature

* ktlint/detekt formating pass

* Changelog entry

* Fix cut off comment

* Remove action reference comment

* Remove unneeded setting of selectedTabId in copy

* Replace filter getter with just making the variable public
It's simpler and I can't see why it shouldn't be modifiable.

* API change from position+filter to target+placeAfter.
Also added a "tab not found" check.

* Add another test, clean up changelog

* Animate moving tabs via movement rather than add+delete.

* Put Private modifier back, improve documentation.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-22 15:16:29 +00:00
Roger Yang
f92d25401a [components] Close https://github.com/mozilla-mobile/android-components/issues/10984: Persist search term in content state 2021-09-15 15:56:34 +00:00
Sebastian Kaspari
0a59c1785a [components] RemoveAllPrivateTabsAction: Clear selectedTabId if no new selection is available. 2021-09-06 12:49:36 +00:00
Noah Bond
6d21d293b6 [components] Undo tab position fix - fix for https://github.com/mozilla-mobile/fenix/issues/18210 (https://github.com/mozilla-mobile/android-components/pull/10777)
* Refactored the tab restoration flow to support restoring tabs at their original index.

* Lint check fixes

* Refactored the index class variable name and made it non-null

* Refactored RestoreAction to take an ENUM for a restoration location.

* Cleaned up tests and lint errors

* Fixed broken test after restore tab refactor

* Refactored the location of RestoreLocation and revised instances of "removalIndex"

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-08-31 19:06:48 +00:00
Noah Bond
ae756f53a9 [components] For https://github.com/mozilla-mobile/android-components/issues/10560: Fixed bug causing external links to open tabs irrespective of the session's private status (https://github.com/mozilla-mobile/android-components/pull/10857)
* For https://github.com/mozilla-mobile/android-components/issues/10560: Fixed bug causing external links to open tabs irrespective of the session's private status

* Updated findTabByUrl function names and comments for better clarity

* Fixed import detekt issue

* Refactored selectors test for better clarity

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-08-31 18:53:52 +00:00
Mugurell
e277dd03f0 [components] For https://github.com/mozilla-mobile/android-components/issues/10803 - Force expanding the toolbar if requested by GeckoView 2021-08-16 07:46:15 +00:00
Jonathan Almeida
e7d3f34077 [components] Close https://github.com/mozilla-mobile/android-components/issues/10769: Add DebugAction.UpdateCreatedAtAction with reducer
We wanted to introduce this action for testing purposes in client apps
that want to "turn back time" for a certain tab.

The difficulty is in ensuring clients do not misuse these actions, and
we thought of a few strategies:

- Option 1: Make a separate grouping called `DebugAction` and document
that these are special actions.

- Option 2: Using a middleware, we only allow changes to the store
depending on some dynmamic logic in the client app. This is a bit
complicated and requries the user to restart the app to add this
special middleware.

- Option 3: Add an annotation that requires the client to opt into using
the action.

In this patch, I decided to go with a combination of options 1 and 3
which gave us the right about of warning and flexibility.

With option 2, we were still required to add new actions to the store
and the middleware would not have prevented misuse in those cases.
2021-08-12 03:56:04 +00:00
Grisha Kruglov
47a5196e6a [components] Make sure to preserve private state when recreating a RecoverableTab
regression from https://github.com/mozilla-mobile/android-components/pull/10711/files
2021-08-05 15:53:27 -07: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
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
Arturo Mejia
e4d539f111 [components] Closes https://github.com/mozilla-mobile/android-components/issues/10448 show toolbar permissions indicator when permissions change from their default. 2021-07-27 17:25: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
097eeb01e2 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Try to update mediaState only for TabSessionState
Renamed "BrowserState.updateTabState" to a more appropriate
"BrowserState.updateTabOrCustomTabState" signaling that it can be used to
update any tab or custom tab.

Created two new "BrowserState.updateTabState" and
"BrowserState.updateCustomTabState" extension methods to allow updating the
state of either tabs or custom tabs depending on the properties needing update.

By this we are forcing the clients to choose what type of SessionState they
want updated and in so limiting the situations in which the old API would try
to update any SessionState and could throw a ClassCastException if in the
"update" lambda parameter callers would try to update a property not existing
in one SessionState implementation but available in other.
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
f14b267388 [components] Issue https://github.com/mozilla-mobile/android-components/issues/10335: Update dependencies to support Jetpack Compose and add first prototype components.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Upgrade to Gradle 7.
* Update Android Gradle Plugin to 7.0.0 Beta 2.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Generate BuildConfig with VERSION_CODE and VERSION_NAME fields in library modules (for Glean).
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add first component using Jetpack Compose: compose-browser-toolbar.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Introduce Jetpack Compose bindings for lib-state.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Upstream Jetpack Compose toolbar prototype from Reference Browser.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add TargetTab helper for observing specific tabs.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add compose-engine component for adding Jetpack Compose bindings to a concept-engine implementation.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add new sample app (samples-compose-browser) for prototyping browser UI using Jetpack Compose.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Update to Beta 3 of the Android Gradle plugin.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Allow usage of http when substituting maven repositories in CI.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Rename TabTarget helper to just Target.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Make BrowserToolbar follow target tab too.
* Add awesomebar prototype using Jetpack Compose.
* Update to Gradle 7.0.2.
2021-07-20 16:22:26 +00:00