Commit Graph

36 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
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
Arturo Mejia 0ae0b89d65 Fix add-on translation braking changes 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 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
Tiger Oakes a7e74e308b
Migrate some SessionManager usage to BrowserStore (#10789) 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
Simon Chae 609936d632
For #10196: Remove clickable locks for enable and private-browsing UI (#10445) 4 years ago
Simon Chae 3dcd52ef7a For #10195, #10196: Allow private browsing mode switch to sync with enable state 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
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
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
Arturo Mejia 804eb0f5ba For issue #8520: Polish Add-on manager UIs 4 years ago
Arturo Mejia e977486809 Remove @UseExperimental for usages of the flow api 4 years ago
Christian Sadilek 0d974fe262 For #8808 #9139: Add-on should be able to configure how to open options page 4 years ago
ekager 63ddff533d For #8641 - Update addon text selector to use attr colors 4 years ago
Simon Chae 41a84e85a3
For #8699: Add view.settings to setAllInteractiveViewsClickable (#8820) 4 years ago
Simon Chae f99bad949e
For #8699: Add setAllInteractiveViewsClickable for add-on pending removal (#8776) 4 years ago
Arturo Mejia 8b7fd3a1df
For issue #8570: Disabling uBlock and quickly opening the Settings
section cause a crash
4 years ago
Arturo Mejia 95528c3191 For issues #8310 Disable the remove button while disabling an add-on
and vice versa.
4 years ago
Christian Sadilek 8a33897f3a For #8201: Enable/Disable uBlock button status isn't updated 4 years ago
Christian Sadilek 142104dc86 For #8202: Remove settings if add-on disabled
- Also fixes the crash described in #8202.
4 years ago
Christian Sadilek 6019adafac For #6124 #8158: Prevent infinite loop on fast taps on enable switch 4 years ago
Tiger Oakes c0d7bc5bd5 Use navArgs helper in fragments 4 years ago
Arturo Mejia be7bd527f6
For issue #8097: Run add-ons callbacks only when the fragment is attached. 4 years ago
Gabriel Luong 64a4a7f422
Provide add-on support (#8064)
Closes #5630, #6069, #6092, #6091, #6124, and #6147.

Co-authored-by: Simon Chae <chaesmn@gmail.com>
Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>
4 years ago