Our kotlin code is not catching the `MissingResourceException` in the `LeanplumMetricsService` which results in the app crashing when the locale isn't known by the device.
Catches the exception, and falls back to the ISO 639 language code. This isn't a great solution, because ISO 639 isn't especially stable.
In practice however this is almost certainly never going to be a problem because Leanplum isn't going to be supported in such exotic locales.
In this case, using the ISO 639 language code allows the error message to be more informative.
lint check
renamed the intentReceived telemetry to appOpenedAllSource
added comments
removed unused code
moved lifecycle process to AppAllSourceStartTelemetry
moved tracking event out of init function
lint fix
moved appAllStartTelemetry to components
added bit more info about the metrics
added the onReceivedIntent metric back
minor fix
change discriptions based on the comments frm MR
wrote test cases for AppAllSourceStartTelemetry.kt
lint fix
test case to mock application going background
post rebase:
post rebase:
fixed nit from comments
fixed nit from comments
fixed nit from comments
lint fix
lint fix
Changing the root view of BaseBrowserFragment from a CoordinatorLayout
to a SwipeGestureLayout has caused some regressions, particularly in
snackbar behavior. Lets prevent those regressions from occuring in
builds where the feature flag for gestures is off by only adding the
SwipeGestureLayout when the feature flag is on.
Using the ConcatAdapter, we're now able to insert multiple data sources
of information into one RecyclerView and preserve layout/scrolling in
addition to adding the 'Save to Collection' button.
We set the ContentBlockingSettings directly on the GeckoRuntime now to
improve the startup of the engine.
This change has requirements from Android Components and GeckoView, so
we would only see the full perf benefits in Nightly as the changes ride
the train, although we might start to see some of them as we're updating
the GeckoProvider for the `geckoBeta` variant as well.
Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
We need to pass a CoordinatorLayout instead of a SwipeGestureLayout to
FenixSnackbar.make() in BaseBrowserFragment to prevent UI tests from
breaking. We also need to remove a few view IDs from the tab preview.
Using `onNextLayout` has the side-effect of showing the thumbnail with
the tab.id from a recycled view.
The root cause of needing that call is to retrieve the measured
height/width from the view first before requesting. A simpler solution
to avoid the complexity is to retrieve these values from the dimen
resources.
Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>
- Added the undo action for deleting individual history items by creating a new field to the history state containing the id's of the history items that are pending for deletion; This field is used inside the update function from the view to show/hide the items.
- Added a new check inside the "deleteMulti" method from BookmarkFragment that calls the showRemoveFoldersDialog to prevent the user from being able to delete one or more bookmark folders without being asked for confirmation, as in #8648.
Co-authored-by: Mihai Eduard Badea <mihai.badea@softvision.ro>
* Extract controller into it's own class. Implement find dupes and filter based on username.
Create edit login controller. Add text watchers and check for duplicates.
Edit controller test
* Find duplicates and save to store
* Retrieve duplicates from AC and check list on username text changed
Move duplicates logic into the controller
* Add glean pings for delete and edit. Move logic for login manipulation into the datastore.
* Use correct threads in controller. Enable save button when applicable.
Save enabled in datastore.
Move login data to datastore
Rebase with password error states
Update metrics to be more specific for edit
* Create logins controller for AC calls
* Interactor and controller methods for edit login. Add edit view to separate out some layout manipulation.
Inflate view in edit fragment. Double layout showing up.
Edit view
Controller tests
Controller tests passing
Interactor tests
Lint and detekt cleanup
* Remove datastore and use storage controller for all logins calls to password storage.
Addressed comments
Lint
:
Rebase - 1
* For #11227 - Cleanup saved logins list when one is selected
Selecting a saved login will open a detail screen for it from where users can
change details or even delete that particular login.
After the change is made the user is brought back to the list of saved logins
where for a brief moment (< 1s) until we get a new response from
passwordsStorage.list() the user can see and even interact with the old list
of items, which may still contain the just deleted one.
To avoid users seeing obsolete logins or even interacting with them (selecting
a previosuly deleted item will result in a crash) we will clean the list of
logins just before the selected login is opened in the detailed view.
When returning for a brief moment the users may see the "loading" UX until
passwordsStorage.list() returns the up-to-date list of logins to display.
* For #11227 - Refactor SavedLoginsView to be closer to MVI
- Interactors should only get passed other Interactors or Controllers as
dependencies to which they should delegate user actions.
- Controllers should hold most of the business logic and get passed all final
dependencies they need to do their job.
* For 11657: add LP attribute for tracking protection
* For #11704: added tracking_protection_enabled attribute
* Added docs for the new attributes, linking to data-review to the mma.md
* Rename null to none when no ETP is enabled
Stricter synchronization by always using the same "loadedSearchEngines"
variable.
With "loadedSearchEngines" calling "refreshAsync()" we also get the fallback
engines to contain reddit and youtube (which are programatically added) and
also now we properly remember and display the engines added by user.
We have two search engine types:
- one based on MLS reported region,
- one based only on Locale.
There are multiple steps involved in returning the default search engine for
example and though at each step we could verify if a certain operation is
completed we are still exposed to concurrency issues.
Simplest and most effective way to make sure the MLS engines do not mix with
Locale based engines is to use the same type of engines for the entire duration
of the app. At the next cold start we'll verify again which engines to use.
Using the Locale based engines (fallbacks) is expected to only happen once, at
the first run of the application after being installed.
New API (installBuiltIn/ensureBuiltin) requires
- Gecko IDs and new permissions
- Extension will only be re-installed if it has a new version
This includes a gradle task to automatically generate a
new version in manifest.json for every build so we don't
forget to update the version and end up with changes that
are never applied.
Also I changed the adding tabs to collection confirmation string from
tabtray to take into account the number of tabs.
Example: 1 tab-"Tab saved!"; multiple tabs-"Tabs saved!"
This is functionally equivalent to the code before this patch but should
be slightly more performant in theory because ConstraintLayout is
expensive to inflate.
The elevation and layoutParams set dynamically appeared to have no effect
with the wrapping view but broke the view when used by itself so I had
to remove them. I also updated a few other unnecessary params.
Theoretically this may have some perf benefits but I didn't see anything
outside noise levels after I took the numbers (but I didn't try very
hard).
* for #11830 added new metric for collecting startup method
move all source startup telemetry into its own logic and added an UNKOWN state
* switched back to onNewIntent solution
* renamed the metric
When you remove a search engine from our list, an undo snackbar that outlives the fragment is shown. If you go back to the search fragment and press undo, now the shortcut list gets updated
The observer was moved and is now bound to the activity and its
context. If the activity is re-created we leak the observer and
therefore the activity itself.
With this we make sure to stop the observer and also don't use
the activity context to begin with.
We'll now clearly differentiate between cold / hot starts of HomeActivity.kt.
This is needed because Android will resend the original Intent which initially
started the Activity whenever it is restarted from the Recents Screen if the
activity is already destroyed at that time. So in the event that the activity
was before started with an Intent to open a webpage for example whenever the
activity is restarted from Recents it will receive the same Intent to open a
webpage even though that Intent has already been consumed.
Activity's onCreate() will only use the intent processors when the activity is
cold started so that we'll only initially act upon Intents configured for
different behaviors inside the app.
If the activity is destroyed while in background and opened from Recents it
will not act upon the original Intent which is now resent by Android.
Activity's onNewIntent() will be called to act upon a new Intent if the
activity is hot started since we are declared as singleTask and it now has the
responsibility to delegate various intent processors to consume that Intent.
Removed the clearFlags call from the HomeActivity that was causing this issue and removed the now redundant call to update the flag from the redirectToReAuth method
* For #11660:added prefetch for topsites
TopSites will be prefetched with observerOnce (wrapper around observerForever).
Also, the SessionControlView.update() is called right away instead of waiting from consumeFrom
in the HomeFragment.onCreateView() which will allow the UI to render all at once on its first
perform traversal
* Removed the submitList(null) since it retriggered a drawing on lower end device
- Added the undo action for deleting individual history items by creating a new field to the history state containing the id's of the history items that are pending for deletion; This field is used inside the update function from the view to show/hide the items.
- Added a new check inside the "deleteMulti" method from BookmarkFragment that calls the showRemoveFoldersDialog to prevent the user from being able to delete one or more bookmark folders without being asked for confirmation, as in #8648.
This helps because we will always need the observer to be initiated, not only when the `openToBrowser` method gets called. Example: Opening a tab from the tab tray had it's own method for opening the browser, causing this to not be called.
* Set edit text listeners
* Set clearable icons and change with error states
* Clear text buttons show and hide
* Move error checks to afterTextChanged. Refactor. Remove unused color.
for #7225, refactored and cleanup the branch.
for #7225, change strict mode policy only on main process.
for #7225, setting thread policy inside a seperate thread to keep it from getting overridden in activities.
for #7225 removed Handler().postAtFrontOfQueue as a solution due to unknown side effects. moved the enableStrictMode function to be static so we can reuse it.
for #7225 lint check
for #7225 created strict mode manager and moved enabledStrictMode function inside it.
for #7225 removed penalty death on network
for #7225 added allow disk access on thread for already existing violation
strict mode running in main process to see if it passes the gitlab check, will revert it if it doesnt
allowed diskread for super.onCreate for home activity
added comments for disk violation oncreate homeactivity
added fragment manager inside strictmode manager
allowed disk read for onboarding
allowed disk read for cachedTopSites
* For #11171 - Removes feature flag for the new tab tray
* For #11171 - Removes all tab references from homeFragment
* For #11171 - Fixes unit tests
* For #11171 - Gets UI tests to compile and HomeScreenTest to pass
* For #11171 - Fixes `deleteMultipleSelectionTest`
* For #11171 - Fixes `openHistoryItemInNewPrivateTabTest`
* For #11171 - Fixes `openHistoryInPrivateTabTest`
* For #11171 - Fixes `openHistoryInNewTabTest`
* For #11171 - Fixes `openNewPrivateTabTest`
* For #11171 - Fixes tabbedBrowsingTests
* For #11171 - Fixes SettingsPrivacyTest
* For #11171 - Fixes TopSitesTest
* For #11171 - Fixes lint errors
* Ignore
* For #11056 - Removes unused argument when navigating to the collection creation fragment
* For #11056 - Moved the collection creation navigation logic to the TabTrayDialogFragment
* For #11056 - Moves navigating to the share screen from home/browser to the TabTrayDialogFragment
* For #11056 - We moved tab selection logic from home/browser to the tab tray dialog
* For #11056 - Moved new tab tapped logic to the tab tray dialog fragment
* For #11056 - Removes all interactor logic for the TabTrayDialogFragment
* For #11056 - Migrates the presentation / navigation around the TabTrayDialog to the androidx navigation library
* For #10505 - Adjusts wordmark margins
* For #10505 - Removes topsite header, fixes collections header size and removes divider
* For #10505 - Restyle the top site items on the homescreen
Added an extension function that pops the backstack of the fragment so the user is redirected to the Logins and passwords screen.
This is done to force the user to re-authenticate if he wants to re-enter the saved logins flow.
Additionally, some UI elements are being hidden on each Fragment since they were remained visible on the Logins and passwords screen's UI.
- Changed the visibility check to check just for the permissions shown instead of all the permissions in WebsitePermissionsState
- Added bottom padding to the permissions root view so there is balanced padding on top and bottom