Commit Graph

82 Commits (990bfa7e6dd5894d61473a41da6129e6947974e2)

Author SHA1 Message Date
MarcLeclair 990bfa7e6d
16900 make navgraph inflation asynchronous (#18889)
* For #16900: implement async navgraph inflation

For #16900: removed nav graph from xml

For #16900: inflate navGraph programatically

For #16900: Made NavGraph inflation asynchronous

For #16900: Changed to block with runBlocking

For #16900: Refactored blocking call into a function

For 16900: NavGraph inflation is now async

We now attach the nav graph (or check if its attached) on every nav call ( an extension function for NavController).
This is done by checking the value of the job stored in PerfNavController.map which keeps track of the job with the NavController as a Key.
If the job hasn't been completed, it will block the main thread until the job is done. The job itself is responsible for attaching the navgraph
to the navcontroller (and the inflation of the latter too)

For 16900: rebased upstream master

For 16900: Rebase on master

For #16900: Fixed Async Navgraph navigation per review comments.

1)The Asynchronous method is now found in NavGraphProvider.kt. It creates a job on the IO dispatcher
2)The Job is tracked through a WeakHashMap from Controller --> NavGraph
3)The Coroutine scope doesn't use MainScope() anymore
4)The Coroutine is cancelled if the Activity is destroyed
5)The tests mockk the blockForNavGraphInflation method through the FenixReoboelectricTestApplication instead of calling the mock every setup()

For #16900: inflateNavGraphAsync now takes navController

For #16900: Pass lifecycleScope to NavGraphProvider

For #16900: removed unused mock

For #16900: Added linter rules for navigate calls

We need linting rules to make sure no one calls the NavController.navigate() methods

For #16900: Added TestRule to help abstract the mocks in the code

For 16900: Fix linting problems

For #16900: Cleaned duplicated code in tests

For #16900: cleaned up NavGraphTestRule for finished test

For #16900: had to revert an accidentally edited file

For #16900: rebased master

* For #16900: Review nits for async navgraph

This is composed of squash commits, the original messages can be found below:

-> DisableNavGraphProviderAssertionRule + kdoc.

Use test rule in RobolectricApplication.

Fix failing CrashReporterControllerTest

Fix blame by -> navigate in tests.

This commit was generated by the following commands only:
```
find app/src/test -type f -exec sed -i '' "/import org.mozilla.fenix.ext.navigateBlockingForAsyncNavGraph/d" {} \;
find app/src/test -type f -exec sed -i "" "s/navigateBlockingForAsyncNavGraph/navigate/g" {} \;
git checkout app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
```

Fix various blame

This is expected to be squashed into the first commit so, if so, it'd
fix the blame.

Move test rule to helpers pkg.

add missing license header

Add import change I missed

fix unused imports

Replace robolectricTestrunner with test rule.

Improve navGraphProvider docs

Remove unnecessary rule as defined by robolectric.

add clarifying comment to robolectric

remove unnecessary space

* For #16900: nit fixes for MozillaNavigateCheck and lint fixes

3 squash commits:
 *Changed violation message and fixed the lint rule for MozillaNavigateCheck
 *Added suppression to NavController.kt
 *Fixed detekt violations

* For 16900: Fixed failing tests

Co-authored-by: Michael Comella <michael.l.comella@gmail.com>
3 years ago
Roger Yang c7cb0fd5a0
Closes #18706 - Remove unneeded add-on telemetry calls (#18707) 3 years ago
Roger Yang 34a7bc0baa
For #17644: Record when user taps on a add-on's setting (#18504) 3 years ago
rxu c9ed8a5b92 Add MOZILLA_ONLINE_ADDON_EXCLUSIONS for Mozilla Online builds 3 years ago
Elise Richards 43b0b27819
Update metrics when an addon is installed or enabled (#17669) 3 years ago
Hakkı Kaan Çalışkan e41cc5a414 For #17303: Move ext fun runIfFragmentIsAttached to utils
move to ext
3 years ago
Christian Sadilek 3722033a5c For #16032: Support installing recommended add-ons from AMO 4 years ago
ekager a8db85fc22 For #16132 - Revise multiselect mode UI 4 years ago
Arturo Mejia bb7d821804 Fix AddonsManagementFragment detekt error 4 years ago
Grisha Kruglov 655a5cbf54 Closes #15816 - Attempt to handle 'allowInPrivate..' pref with detached context 4 years ago
Arturo Mejia 0ae0b89d65 Fix add-on translation braking changes 4 years ago
mcarare 896c1b7875 For #15268: Use safe navigation to addon details fragments. 4 years ago
Arturo Mejia 19f0c543fe Fix add-ons permissions breaking change 4 years ago
sraturi c73baae4e9 for #13478, letting go of the fragment resource inside onDestroyView of AddonsManagementFragment to avoid memory leak 4 years ago
Mugurell 499ff83b18 For #8578 - Don't attempt to use different addons icons backgrounds
After the change from AC #8054 specifying different addons icons backgrounds
is not possible anymore.
All favicons used all throughout the app will have the same background.
4 years ago
Simon Chae 2e61425f2b For #13256: Set add-on settings tab mode based on BrowsingModeManager 4 years ago
ekager 5d664b979d For #6313 - Removes unused browser animations, improve delayed paint interactions 4 years ago
Tiger Oakes e265bd7266 Use uplifted addon date code 4 years ago
Tiger Oakes c08d375c18
Move settings in components (#12675) 4 years ago
Hakkı Kaan Çalışkan aa7655f4d6 For #12509: Set height of remove add on button to 36dp 4 years ago
jhugman 3373f8b987
For #12600 - remove AddonInstalled event when the permission dialog is shown (#12601) r=csadilek,sblatz 4 years ago
mcarare 800702149b For #12503: Open addon permissions link in app. 4 years ago
Tiger Oakes 69020a1f26
For #12457 - Add MockK matcher for nav directions (#12262) 4 years ago
jhugman 9df13ae121
For #11655: add leanplum event for installing an addon (#12136) r=elise
* For #11655: add leanplum event for installing an addon

* Add link to data-review request in PR

* Addressed CI comments
4 years ago
Tiger Oakes 1ab5fe3eb9
Add method to test fragments in roboletric (#12261) 4 years ago
Mihai Adrian Carare daecbd348b
For #11996: Open all links from add-on details in Fenix. (#12080)
* For #11996: Open add-on homepage link in Fenix.

* For #11996: Open add-on details links in Fenix.
4 years ago
Tiger Oakes f6efb386d6 Add tests for addon details 4 years ago
Christian Sadilek d16c70d8be Wire up UI to make add-on installation cancelable 4 years ago
Tiger Oakes a7e74e308b
Migrate some SessionManager usage to BrowserStore (#10789) 4 years ago
Simon Chae 7cc4816618
For #10398: Add AddonInstallationDialogFragment support (#10608) 4 years ago
Simon Chae ca7695854a
For #10552: Set initial add-on details fragment visibility to false (#10565) 4 years ago
Simon Chae d58e7d3138 For #10473: Fetch the addon from addon manager instead of the store 4 years ago
ValentinTimisica f63cb4e09f For #10244: Creates drawable for add-ons private browsing label.
The drawable is sent to AddonsManagerAdapter.Style constructor and is displayed
near the add-on name if it is allowed to run in private browsing
4 years ago
Simon Chae 609936d632
For #10196: Remove clickable locks for enable and private-browsing UI (#10445) 4 years ago
Mihai Adrian 43d30793f5
For #9794: Announce installing state for screen readers (#10111) 4 years ago
Simon Chae 3dcd52ef7a For #10195, #10196: Allow private browsing mode switch to sync with enable state 4 years ago
Arturo Mejia e55a4fd274 No issue: Partially update the add-on manager list 4 years ago
ekager a9692d9bce For #10204 - Address viewLifecycleOwner IllegalStateException crashes 4 years ago
Simon Chae f1559ed2da
For #10162: Set switch back to prev state when failed to enable/disable addon (#10164) 4 years ago
Simon Chae b3248ec769 For #6123: Expose WebExtensions in private browsing control 4 years ago
ekager c4e83367f6 For #6832 - Fix various fragment not attached to a context crashes 4 years ago
Mihai Eduard Badea 725ba1e856 For #9951 - Removed the extra empty spaces that were causing the spacing issue 4 years ago
mcarare 25e12e2f77 For #9984: Update addon before settings visibility check 4 years ago
Arturo Mejia 37a277febb For issue #9930 Do not assume all add-ons have a settings page 4 years ago
Arturo Mejia 7c279b6e1f No issue: Fix add-on translate() breaking change 4 years ago
Arturo Mejia eace991859 For issue #8520: Improve add-ons UI 4 years ago
ekager b8fba63be4 For #9890 - Do not display full screen snackbar with toolbar padding 4 years ago
Simon Chae de311aef85
Update not yet unavailable add-on string (#9677) 4 years ago
Christian Sadilek 7f1ef17d8b No issue: Re-use existing usecases for addons 4 years ago
Arturo Mejia 025656d8fd For issue #9647 Crash when tapping settings after quickly
enabling/disabling add-on
4 years ago