Commit Graph

53 Commits (74c1cc82fb4975f63c20a718f09367149bcc3c70)

Author SHA1 Message Date
Roger Yang 74c1cc82fb Closes #19921: Update appcompat and fragment dependencies to 1.3.x 3 years ago
Mugurell d495d84208 For #11819 - Show the mic in widget only if setting is enabled
If "Show voice search" is disabled under Settings, the mic icon should not be
shown in the search widget.
3 years ago
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
mcarare f83ed13089 For #18227: Also update icon on search engine edit. 3 years ago
Sebastian Kaspari 0c41316c31 Revert "For #17044: Explicitly set a new default engine when default is deleted."
This reverts commit 633bf384e2.
3 years ago
mcarare 633bf384e2 For #17044: Explicitly set a new default engine when default is deleted. 3 years ago
Sebastian Kaspari 2b759e9d6f Integrate new search code from Android Components into Fenix. 4 years ago
MarcLeclair 7b1af41b40
15278 detekt rule runblocking (#15942)
* For #15278: added CoroutineManager to count runBlocking calls

* For #15278: Added actual detekt rule for runblocking and its config to the yaml

* For #15278: Added unit test for RunblockingCounter

* For #15278: renamed StrictModeStartupSuppressionCountTest.kt to PerformanceStartupTest.kt and added runBlockingCount test

* Lint fix

* For #15278: made runblocking a Long to prevent overflow

* For #15278: fixed MozRunblocking name, description and moved RunBlockingCounter to perf package

* For #15278:Renamed MozillaRunblockingCheck to MozillaRunBlockingCheck

* For #15278: Added setup for unit test, since it failed without restting counter

* For #15278: Fixed naming for RunBlocking lint check

* For #15278: removed changes made to test to use runBlockingIncrement

* For #15728: added test exclusion for runBlocking check

* For #15278: changed null check and added Synchronized to count setter

* For #15278: fix for nits

* For #15278: added StartupExcessiveResourceUseTest to CODEOWNERS

* For #15278: fixed for nits

* For #15278: Moved increment function to extension function and fixed indentation

* For #15278: Added tests for Atomic Integer extension and nit fix
4 years ago
Elise Richards 7e3c26914c
For #15080: Handle default search engine when editing or removing (#15768) 4 years ago
ekager 4d348dd26a Fixes existing lint errors 4 years ago
Hakkı Kaan Çalışkan f87ca730a9 For #11245: Integrate Synced Tabs AwesomeBar suggestions
fix pr
4 years ago
Jeff Boek f9b2d65993 For #5745 - Create preference to disable domain autocompletion 4 years ago
Codrut Topliceanu 72edaaf067
For #11465 - Fix default engine for widget voice search (#14015)
For #11465  - Fix default engine for widget voice search
4 years ago
Elise Richards b7325a3833
For #12571: Rename shortcuts to search engine on search screen (#12839)
* Rename shortcuts to search engine on search screen

* Remove deprecated pref key

* Re-add deprecated string
4 years ago
Tiger Oakes 57ac6fc36d Extract navigation subgraphs 4 years ago
ekager 9c4fba4565 Closes #12954 - Remove all ConstraintLayout casts in SearchEngineListPreference 4 years ago
Hakkı Kaan Çalışkan 3be6393ea5 For #12929: Change cast to LinearLayout 4 years ago
Hakkı Kaan Çalışkan b3b7566fcf For #12804: Set min height for search engine radio button 4 years ago
Tiger Oakes 1ab5fe3eb9
Add method to test fragments in roboletric (#12261) 4 years ago
Hakkı Kaan Çalışkan 331090d1e6 For #12007: Fix add search engine items using wrap content for height 4 years ago
Mihai Branescu 46c1c130da For #9425 - Handle undo for custom search engines
On undo, get the template that the user entered for that engine and then
re-add it to the `CustomSearchEngineStore`
4 years ago
ValentinTimisica 0b57f5e71b Fixes #10551: Removes the increased touch target for learn more link 4 years ago
Tiger Oakes 596c579bbb Replace nullable findPreference 4 years ago
Sawyer Blatz 82facbfa00 For #1216: Remove feature flag for voice search 4 years ago
ValentinTimisica 9f265fd62f Fixes #10064: Open help articles in normal tab instead of custom tab 4 years ago
Sawyer Blatz 535e020683 For #1216: Put voice search behind a nightly & debug flag 4 years ago
Sawyer Blatz 011a9e7d96 For #1216: Add voice search 4 years ago
Mihai Branescu bded28a017
For #9420 - relaxed custom engine rules (#9967)
Allow websites that return 404 to be added
Change long query param with one with higher changes of being found
4 years ago
ekager b8fba63be4 For #9890 - Do not display full screen snackbar with toolbar padding 4 years ago
Sawyer Blatz e3ed7ed268
Issue #9128 & #9222 & #9499: Refactors snackbar creation and fixes placement (#9628) 4 years ago
Mihai Eduard Badea 91690d7b48 Replaced name field with search string field 4 years ago
Mihai Branescu 73a7330b2b For #9395 - Trimmed name for custom search engines 4 years ago
Harshal Lele e318cd7d15 fix #8135 - remove getColorFromAttr 4 years ago
Tiger Oakes c0d7bc5bd5 Use navArgs helper in fragments 4 years ago
ValentinTimisica 154e11841a Fixes #7881: Send telemetry event when custom search engine is deleted 4 years ago
Emma Malysz 5e9b753acb For #7473, delay inflation of toolbar
Improve performance of HomeActivity.onCreate by delaying this inflation.
We use a ViewStub and inflate the first time the actionbar is accessed.
4 years ago
ValentinTimisica 7c5c9355ce For #5884: Adds user-specified search engines telemetry
Created events for adding and deleting a custom search engine and for searches
performed with a custom search engine.
4 years ago
mcarare a72620ae07 For #7522 Catch IllegalArgumentException when validating search string 4 years ago
mcarare 2bdde48986 For #7522 Ensure correct protocol is used in search string 4 years ago
Josh 593981fa4b Fix parameterized message in search engine (#7302) 5 years ago
Tiger Oakes b85673acac Clean up settings fragments 5 years ago
mcarare 907d96e39f For #6709, for #6849 Handle default engine deletion and undo operation
Uninstall engine immediately and allow reinstall in onCancel.
Set previous list with default engine in onCancel.
Keep default engine change in operation and remove now unnecessary view refresh.
5 years ago
mcarare bc6b7725e9 For #6968 Close response stream to allow use of caching 5 years ago
Mihai Adrian 45ae8cb35a For #6997 Avoid overwriting empty_search_string error (#6998)
Setting error twice also clips error message
5 years ago
Jeff Boek eb6e6b774f For #6848 - Sorts the search engine list without case sensitivity
Co-authored-by: Severin Rudie <Baron-Severin@users.noreply.github.com>
5 years ago
Jeff Boek 1cc496a683 For #6847 - Properly rebuilds the SearchEngineList on undo
Co-authored-by: Severin Rudie <Baron-Severin@users.noreply.github.com>
5 years ago
ekager f5cf0b7e2a For #6890 - Don't crash with no connection when adding custom search engine 5 years ago
Tiger Oakes 422faaf7c0 Add toolbar helpers (#6531) 5 years ago
mcarare 5543f3272d For #1019 Add option to enable search suggestions in private mode 5 years ago
Jeff Boek 607c3d4c87
Adds custom search engines (#6551)
* For #5577 - Adds button to add a new search engine

* For #5577 - Adds custom engine store

* For #5577 - Creates a custom SearchEngineProvider

* For #5577 - Gives the ability to delete search engines

* For #5577 - Adds the UI to add a custom search engine

* For #5577 - Adds form to create a custom search engine

* For #5577 - Adds the ability to add a custom search engine

*  For #5577 - Adds the ability to delete custom search engines

* For #5577 - Selects the first element on the add custom search engine screen

* For #5577 - Prevents adding a search engine that already exists

* For #5577 - Styles the add search engine preference

* For #5577 - Makes the name check case-insensitive

* For #5577 - Fix bug where home screen doesnt see new search engines

* For #5577 - Moves Search URL validation to its own type

* For #5577 - Fixes linting errors

* For #5577 - Adds the ability to edit a custom search engine

* For #5577 - Allows the user to edit a serach engine even when it is the last item in the list

* For #5577 - Adds an undo snackbar when deleting a search engine

* For #5577 - Moves all of the strings to be translated

* For #5577 - Fixes bug when deleting your default search engine

* For #5577 - Puts adding search engines behind a feature flag

* For #5577 - Navigate to custom search engine SUMO article when tapping learn more

* For #5577 - Fixes nits

* For #5577 - Uses concept-fetch to validate search string

* For #5577 - Adds string resources for the cannot reach error state
5 years ago