Commit Graph

303 Commits (7e870605d81cd10bda5d553dcd1aca427d9dd5fd)

Author SHA1 Message Date
Grisha Kruglov ec98db4e54 External source support
Adds handling of information about external referrer (package, category)
when dealing with external intents.
3 years ago
Michael Comella 1963d502c7 Closes #20461: remove app_received_intent probe. 3 years ago
Sebastian Kaspari 971b419d77 Run ktlintFormat to adapt to latest formatting rules. 3 years ago
Arturo Mejia 7e5644036b Put the Start On home setting behind a feature flag. 3 years ago
Roger Yang c4347a9492 Closes #19847: Add telemetry for the default browser notification 3 years ago
Marc Leclair 298ec5cce1 For #19804: Restore logic to original behavior 3 years ago
Marc Leclair 871cde764e For #19804: checkDefaultBrowser moved to helper function 3 years ago
Marc Leclair b8bbdb45bc For #19804: Changed `var isDefaultBrowser` to a function
The change to the function makes it so when the Settings.kt class is initialized, the isDefaultBrowser, which calls the
BrowserCache, won't get called right away. `isDefaultBrowser()` is known to take quite a while on start up on the G5+ (approx
30-40ms).
3 years ago
Michael Comella be64ee4159 For #20127: remove app_opened_all_startup integration. 3 years ago
Roger Yang 0133f42a15 Closes #19846: Show Default Browser Notification if browser is not default 3 years ago
Roger Yang 74c1cc82fb Closes #19921: Update appcompat and fragment dependencies to 1.3.x 3 years ago
Arturo Mejia c2439914fa For #19881 add telemetry for start on Home. 3 years ago
Christian Sadilek 0c1e712ca8 Issue #17800: Cleanup and fix request desktop site from home 3 years ago
Sebastian Kaspari 4753a1d494 Complete browser-state migration and remove browser-session dependency.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
3 years ago
Arturo Mejia f0bb70e354 For #19789 Start on Home after some amount of time 3 years ago
Jonathan Almeida bf3f81d271 Issue #19112: Remove old Synced Tabs code 3 years ago
Jonathan Almeida dc11c334b6 Issue #19112: Remove old tab tray code 3 years ago
Jonathan Almeida 758700cbb0 Issue #19647: Navigate to browser from home via Synced Tabs page 3 years ago
Mihai Adrian Carare 11efbaacc4
For #18507 - Prevent screenshots on credit card screens. (#19560) 3 years ago
mcarare 4dd4e35982 For #19258: Replace default Android back button with a custom icon. 3 years ago
Sebastian Kaspari 7d690219ea Issue #19040: Remove Leanplum (Nightly) 3 years ago
Sebastian Kaspari cf4847dc17 Remove browser-search references. 3 years ago
mcarare f94f8531f6 For #18496: Set activity theme in onCreate before call to super. 3 years ago
Michael Comella cbc5df3c63 For #18836: address onCreate method length detekt issue. 3 years ago
Michael Comella d6999234b0 For #18836: add & integrate StartupTypeTelemetry. 3 years ago
Michael Comella a64540bd06 For #18836: add StartupPathProvider + tests. 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
Michael Comella 000bef020a For #18836: replace StartupActivityStateProvider with StartupStateProvider.
The StartupActivityStateProvider uses an imperative implementation,
driven by callbacks, to set the state of the application. This is hard
to follow as you need to understand which callbacks will be called in
which order. For example, to make sense of an implementation like this,
COLD, WARM, AND HOT would likely need to be implemented in separate
ActivityLifecycleCallbacks.

I feel the StartupStateProvider is an improvement because it leverages
the StartupActivityLog to query a linear state for a more understandable
implementation. Furthermore, it seems accessible to write COLD, WARM,
and HOT in the same class because they can all be approached the same
way.
3 years ago
MarcLeclair 9d728ec168
For #17759: Added min SDK 23 to avoid crashes on android 5.0 and 5.1 (#18832)
* For #17759: Added min SDK 23 to avoid crashes on android 5.0 and 5.1

* For #17759: fixed Android code from INT to actual version name
3 years ago
Mihai Adrian Carare ccfb275b03
For #17800 - Request desktop site from home screen. (#18653) 3 years ago
Michael Comella ade38246be For #18426: record cold start duration telemetry. 3 years ago
Vitaly V. Pinchuk 43c54b7006
For #18395: Dismiss contextual menu when entering/exiting Reader Mode 3 years ago
Arturo Mejia 54db8f3fde Revert "For #17805 - Fix adjustResize deprecation (#18252)"
This reverts commit 38f906a6
3 years ago
Michael Comella 62e2fb1aa6 For #18426: add measurement probes for long-running lifecycle methods.
In addition to the existing probes for onCreate, this should cover all
lifecycle methods that take a long time in our profiles.
3 years ago
Michael Comella 9024eca01e For #18426: add telemetry for app.onCreate subsections.
Hopefully this will help us understand behavior of the
`application_on_create` probe, specifically that it seems to take longer
in telemetry than in does locally compared to `home_activity_on_create`
(comparing the medians to local runs)..
3 years ago
Roger Yang d2ffaa85f9
Closes #17531: Use shared preference to store top sites count for telemetry (#18557) 3 years ago
Codrut Topliceanu 38f906a685
For #17805 - Fix adjustResize deprecation (#18252)
* For #17805 - Fix adjustResize deprecation

To handle the deprecation of `adjustResize` I've moved it from `styles.xml` and `AndroidManifest.xml` to `Activity.kt` as a fallback for devices with Android < 11. For Android 11 and up `setDecorFitsSystemWindows(false)` and `OnApplyWindowInsetsListener` will be used to handle app insets. Normal use activities should call `enableSystemInsetsHandling` in `onCreate` as to properly display system bars and for proper keyboard handling.
3 years ago
Michael Comella 993428cd0f For #17969: add duration probes for App.onCreate and HomeActivity.onCreate. 3 years ago
Michael Comella b3ef8a11e8 For #17816: add profiler marker for onPreDraw via HomeActivity.onStart.
This may be useful for MAIN start up to determine when the user begins
seeing content.
3 years ago
Michael Comella 4de49c7585 For #17816: add profiler marker for 2x Activity.onCreate.
The IntentReceiverActivity one is particularly useful to quickly determine
when we can begin executing code in the WARM VIEW case (i.e. "Set selection
begin here").

The HomeActivity one is useful for COLD start up analysis in similar
ways and to see the Activity transitions in WARM VIEW.
3 years ago
ekager f5b068a453 For #17785 - Use screenshots setting when adding secure flag 3 years ago
Jonathan Almeida 824f3fd821 Issue #1340: Forward Activity results to the fragment 3 years ago
MarcLeclair 24bce64e0b
16373 Count the # of inflations done on startup (#16778)
* For #16373: Added performance Inflater to counter # of inflations

This class is quite straight forward. The only thing that I have to point out is the onCreateView method. It usually
calls its super if you don't override it. The problem with that is that the super.onCreateView actually uses
android.view. as a prefix for the XML element it tries to inflate. So if we have an element that isn't part
of that package, it'll crash. As I said in the code, a good example is ImageButton. Calling android.view.ImageButton
will make the app crash. The method is implemented the same way that PhoneLayoutInflater does (Another example
is the AsyncLayoutInflater)

* For #16373: Added test for PerformanceInflater

This test got quite awkward / complicated fast.  I wanted to test the  to make sure we don't break *any* of our layouts
and to do so, I decided to just retrieve all our XML in our /res/layout folder. However, this gets quite a bit outside of a unit test scope.
The point was to get every layouts and get their LayoutID through the resources using the testContext we have. It gets even weirder, since some
of the XML tags have special implementation in android. One of them is the <fragment> tag. That tag actually is inflated by the OS using the Factory2
that the Activity.java implements. In order to get around the fragment issue, we just return a basic FrameLayout since the system LayoutInflater doesn't deal
won't ever get a <fragment> tag to inflate. Another issue was the <merge> tag. In order to inflate those, you need 1) a root view and 2) attach your view to it.
In order to be able to test those layouts file, I had to create an empty FrameLayout and use it as the root view for testing. Again, I know this is beyond the spirit of a unit test but if we use this inflater, I think it should make sure that no layouts are broken by it.

* For #16373: Overrode getSystemService to return PerformanceInflater

This allows PerformanceInflater to be called in every inflation to keep track of the number of inflations we do.

* For #16373: Added UI test for # of inflations

* For #16373: Lint fix

* For #167373: Changed the LayoutInflater cloneInContext to take this instead of inflater

The inflater parameter is set on the first call from the OS from  the Window object. However, the activity itself sets multiple factories on the inflater
during its creation (usually through AppCompatDelegateImpl.java). This means that, once we initially set the inflater with a null check, we pass an inflater
that has no factory initially. However, since we keep a reference to it, when cloneInContext was called, it cloned the inflater with the original inflater
which didn't have any factories set up. This meant that the app would crash on either browserFragment creation or any thing that required appCompat (such as
ImageView and ImageButton). Now, passing itself with a cloneInContext means we keep all the factories initially set by the activity or the fragment.

* For #16373: Fixed code issues for PR. No behavior change

* For #16373: fixed some code nits
3 years ago
Gabriel Luong 846d618c06
For #16941 - [Telemetry] Bookmark Counts (#16942) 3 years ago
Christian Sadilek 3722033a5c For #16032: Support installing recommended add-ons from AMO 4 years ago
Sebastian Kaspari 2b759e9d6f Integrate new search code from Android Components into Fenix. 4 years ago
ekager f520586dcd
For #12062 - Remove feature flag for return to browser (#16622) 4 years ago
Christian Sadilek fbbc25b54e Closes #16053: Fix crash when closing private tabs via notification 4 years ago
Christian Sadilek 0fbc8410a4 Closes #16430: ExternalAppBrowserActivity should not handle incoming intents 4 years ago
ekager aae43b84eb
For #12062 - Feature Flag return to browser (#16099) 4 years ago