Commit Graph

34 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
Elise Richards 6dadecacc2
For #15703 and #17133: allow ETP redirect trackers setting to be customized (#17137)
* Remove ETP redirect trackers feature flag. Add category to ETP panel view.

* Add redirect tracker category to ETP custom settings
3 years ago
ekager a1a839f237 For #13221 - Update global ETP to include PBM 4 years ago
ekager 9ed85510ae For #7094 - Adds save login exceptions 4 years ago
Tiger Oakes 8e8e5aea36
Extract radio group logic into helper (#11493) 4 years ago
Tiger Oakes 45ef88f6b9 Replace requireNotNull(findPreference()) 4 years ago
Sawyer Blatz 932a2f3703 For #11063: Update telemetry for etp settings 4 years ago
Tiger Oakes 50441e28f1 Tests and cleanup for tracking protection 4 years ago
Simon Chae a851b76ea3
Update Android Components version to 41.0.20200506130132 (#10443) 4 years ago
Mihai Adrian 9612c3f16d
For #8540: Fix ETP options not being correctly applied (#8688) 4 years ago
Mihai Adrian beb323924b
For #8594: Show correct info in Etp settings info (#8687) 4 years ago
Mihai Adrian 4be693255d
For #8565: Fix updating dropdown preferences in ETP settings! (#8573)
* For #8565: Create custom SharedPreferenceUpdater for String Preferences

* For #8565: Use custom updater to correctly update DropDownPreference

* For #8565: Set default values for dropDown preferences

* For 8565: add tests for findEntriesValue

* For 8565: clarified findEntryValue

Co-authored-by: Severin Rudie <Baron-Severin@users.noreply.github.com>
4 years ago
Mihai Adrian 3486f30b6a
For #8529: Fix custom ETP preferences visibility update 4 years ago
mcarare bba563b5f9 For #6479: Add granular ETP settings 4 years ago
Tiger Oakes 422faaf7c0 Add toolbar helpers (#6531) 5 years ago
matthewcmckenna afac413c98 Add ETP accessibility labels 5 years ago
Emily Kager d9615108ee For #6354 - Removes ETP Experiment, Removes Feature Flags, Sets Strict Default 5 years ago
ekager 44bb592b43 For #5312 - Send ETP Strict/Standard event 5 years ago
Tiger Oakes 8c30200ced Only use Context.settings() function (not getter) (#5335)
Remove unused String extensions
5 years ago
Emily Kager 9d9ff959b5 For #5312 - Add Telemetry for Tracking Protection 5 years ago
Emily Kager 418b1ba890 For #1749 - Use Strict ETP by default, use Feature Flag for Settings 5 years ago
Emily Kager 4485b7f647 Add Tracking Protection Info Panel 5 years ago
Mihai Adrian a31eb1f371 Code Health #4883: Refactored accessing settings by using Context extensions (#4973) 5 years ago
Tiger Oakes aab357845b No issue: Clean up preferences code (#4699) 5 years ago
Tiger Oakes 33f3b14c29 Adds setters and property delegates in `Settings` (#4809)
* Change Settings to use setters

* Add delegate for shared preferences
5 years ago
Emily Kager 9b5baa2358 For #3360 - Adds empty state for TP Exceptions 5 years ago
Jeff Boek b3650cacff For #2399 - Wires up tracking protection onboarding card 5 years ago
Tiger Oakes cfca683a14 Use UpdateTrackingProtectionUseCase
mozilla-mobile/android-components#2746
5 years ago
Emily Kager 5904a916d8 No issue: Update Androidx dependencies 5-8-2019 (#2350)
* No issue: Update Androidx dependencies 5-8-2019

* Update TrackingProtectionPreference
5 years ago
Emily Kager 84a7430e57 For #1745 - Allow trackers from Allow List (#2310) 5 years ago
Emily Kager e9edd6c8b5 For #1084 - Remove Exceptions from TP setting for Beta 5 years ago
Emily Kager 01a181975d For #1084 - Add tracking protection toggle to quick settings dialog 5 years ago
Emily Kager 43e0588d68 For #1084 - Update TP Policy for the current engineSession 5 years ago
Emily Kager 068744eb96 For #1084 - Add Setting to enable/disable TP 5 years ago