Bug 1425898 - Call refreshLocales on the Gecko thread rather than the UI thread. r=jchen
authorDylan Roeh <droeh@mozilla.com>
Thu, 21 Dec 2017 15:08:09 -0600
changeset 449058 6357003f9a477edce593c2c295603a8d7584946d
parent 449057 cc27374be3ad295545e8145eea497e9b5f4f7dd5
child 449059 fc42dcda29cf172f22ec30700923e1185610deb3
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs1425898
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1425898 - Call refreshLocales on the Gecko thread rather than the UI thread. r=jchen
mobile/android/base/java/org/mozilla/gecko/BrowserLocaleManager.java
widget/android/fennec/FennecJNIWrappers.h
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserLocaleManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserLocaleManager.java
@@ -460,18 +460,18 @@ public class BrowserLocaleManager implem
      * @return the single default locale baked into this application.
      *         Applicable when there is no multilocale.json present.
      */
     @SuppressWarnings("static-method")
     public String getFallbackLocaleTag() {
         return FALLBACK_LOCALE_TAG;
     }
 
-    @WrapForJNI
-    public static native void refreshLocales();
+    @WrapForJNI(dispatchTo = "Gecko")
+    private static native void refreshLocales();
 
 
     @WrapForJNI
     private static String getLocale() {
         try {
             LocaleManager localeManager = Locales.getLocaleManager();
             Context context = GeckoAppShell.getApplicationContext();
             if (!localeManager.isMirroringSystemLocale(context)) {
--- a/widget/android/fennec/FennecJNIWrappers.h
+++ b/widget/android/fennec/FennecJNIWrappers.h
@@ -114,17 +114,17 @@ public:
         static constexpr char signature[] =
                 "()V";
         static const bool isStatic = true;
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
         static const mozilla::jni::CallingThread callingThread =
                 mozilla::jni::CallingThread::ANY;
         static const mozilla::jni::DispatchTarget dispatchTarget =
-                mozilla::jni::DispatchTarget::CURRENT;
+                mozilla::jni::DispatchTarget::GECKO;
     };
 
     static const mozilla::jni::CallingThread callingThread =
             mozilla::jni::CallingThread::ANY;
 
     template<class Impl> class Natives;
 };