Also remove exception handling at call site in Android components - no need to catch exceptions for method that no longer throws.
Differential Revision: https://phabricator.services.mozilla.com/D206488
This patch fixes showing the Couldn't Load Languages translation error.
Part 1 of this series ensures the translations engine re-queries the language.
This patch:
* Fixes a `var` v. `val` recommendation
* Reorganized error handling
* Session errors have priority over browser errors
* Ensures null errors are also sent to clear state
* Proactively requests languages again when the dialog reopens and ensures error state
Differential Revision: https://phabricator.services.mozilla.com/D205473
To ensure that we can build offline, we need to prevent gradle from
going through remote maven repos directly.
That means also overriding the default plugin repository
(plugins.gradle.org) in the `pluginManagement` section.
Differential Revision: https://phabricator.services.mozilla.com/D201497
This patch adds the additional state information of `supportedLanguages` and `translationError` to `TranslationsState`. The `supportedLanguages` are the languages the translation engine supports for translating for use in UI dropdowns. `translationError` is any error that occurred relating to translating.
`supportedLanguages` is currently set via an action that indicates the intention to translate on the new `EngineMiddleware` addition of `TranslationsMiddleware`. This patch also adds a new `TranslationOperation` of `FETCH_TO_AND_FROM_LANGUAGES` to indicate the process of getting `supportedLanguages`.
`translationError` is added to the `TranslationsState` to store errors as they arise. `TranslateExceptionAction` is also refactored from using the generic `Throwable` to the new `TranslationError` to accommodate `supportedLanguages` and better general error handling.O_AND_FROM_LANGUAGES` to indicate the process of getting `supportedLanguages`.
This bug adds `TranslationsRuntime.getNeverTranslateSiteList` and
`TranslationsRuntime.setNeverTranslateSpecifiedSite`
for use when managing the global never translate sites list.
Please continue to use `EngineSession.getNeverTranslateSiteSetting`
and `EngineSession.setNeverTranslateSiteSetting` when modifying this
same preference on the currently displayed site.
Fixed the current tests to pass.
The current tests are asserting implementation, so a new test was added
to test the behaviour by wrapping `NestedGeckoView` in a parent `View`
and counts the `onInterceptTouchEvent` calls it receives. When we are
in a gesture (starting with `ACTION_DOWN`) we deny the touch events to
the parent views until we receive a result from APZ.
Co-authored-by: Titouan Thibaud <tthibaud@mozilla.com>
With the current design, we have a `NestedGeckoView` inside this
`GeckoEngineView`. In our supported embedders, we wrap this with the
AndroidX `SwipeRefreshLayout` to enable features like Pull-To-Refresh:
```
SwipeRefreshLayout
└── GeckoEngineView
└── NestedGeckoView
```
`SwipeRefreshLayout` only looks at the direct child to see if it has
nested scrolling enabled. As we embed `NestedGeckoView` inside
`GeckoEngineView`, we change the hierarchy so that `NestedGeckoView`
is no longer the direct child of `SwipeRefreshLayout`.
To fix this we enable nested scrolling on the GeckoEngineView to
emulate this information. This is required information for
`View.requestDisallowInterceptTouchEvent` to work correctly in
the `NestedGeckoView`.
Co-authored-by: Titouan Thibaud <tthibaud@mozilla.com>
And invoke requestDisallowInterceptTouchEvent just before sending a new
ACTION_DOWN and invoke it againg just after receiving the result from
Gecko so that we can properly hold off triggering pull-to-refresh.
Re-initializing inputResultDetail on ACTION_UP or ACTION_CANCEL is
problematic since Gecko sends the result asynchronously thus it's
possible that Gecko sends the result after re-initialization on
ACTION_CANCEL.
Co-authored-by: Titouan Thibaud <tthibaud@mozilla.com>
This bug adds a few options for translations preferences on the engine,
including:
* (Runtime Setting) Option to get/set translations offer popup
* (Runtime Request) Option to get/set translation language preference
* (Session Request) Option to get/set a site's translation preference