From 4f886a29a1234c967deae2354bbc5092e0e6595e Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Tue, 14 Nov 2017 06:39:22 -0800 Subject: [PATCH] Remove android_react_native_perf.use_separate_ui_bg_thread experiment. Reviewed By: AaaChiuuu Differential Revision: D6313250 fbshipit-source-id: 583a729a157a2053827631a43e38917753e78477 --- .../facebook/react/ReactInstanceManager.java | 16 +--------- .../react/ReactInstanceManagerBuilder.java | 8 ----- .../com/facebook/react/ReactRootView.java | 2 +- .../react/bridge/CatalystInstanceImpl.java | 4 --- .../facebook/react/bridge/ReactContext.java | 30 ------------------- .../bridge/queue/ReactQueueConfiguration.java | 3 -- .../queue/ReactQueueConfigurationImpl.java | 28 ++--------------- .../queue/ReactQueueConfigurationSpec.java | 29 ------------------ .../react/uimanager/UIManagerModule.java | 6 ++-- .../react/views/modal/ReactModalHostView.java | 2 +- .../jni/react/jni/CatalystInstanceImpl.cpp | 15 ++-------- .../main/jni/react/jni/CatalystInstanceImpl.h | 2 -- .../jni/react/jni/ModuleRegistryBuilder.cpp | 19 ++---------- .../jni/react/jni/ModuleRegistryBuilder.h | 3 +- 14 files changed, 16 insertions(+), 151 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 6bb07f30f1d958..a891b327d20028 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -156,7 +156,6 @@ public interface ReactInstanceEventListener { private final @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler; private final boolean mLazyNativeModulesEnabled; private final boolean mDelayViewManagerClassLoadsEnabled; - private final boolean mUseSeparateUIBackgroundThread; private final int mMinNumShakes; private class ReactContextInitParams { @@ -204,7 +203,6 @@ public static ReactInstanceManagerBuilder builder() { boolean lazyViewManagersEnabled, boolean delayViewManagerClassLoadsEnabled, @Nullable DevBundleDownloadListener devBundleDownloadListener, - boolean useSeparateUIBackgroundThread, int minNumShakes, int minTimeLeftInFrameForNonBatchedOperationMs) { Log.d(ReactConstants.TAG, "ReactInstanceManager.ctor()"); @@ -236,7 +234,6 @@ public static ReactInstanceManagerBuilder builder() { mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler; mLazyNativeModulesEnabled = lazyNativeModulesEnabled; mDelayViewManagerClassLoadsEnabled = delayViewManagerClassLoadsEnabled; - mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread; mMinNumShakes = minNumShakes; synchronized (mPackages) { PrinterHolder.getPrinter() @@ -995,15 +992,6 @@ public void run() { Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); } }); - if (mUseSeparateUIBackgroundThread) { - reactContext.runOnUiBackgroundQueueThread( - new Runnable() { - @Override - public void run() { - Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); - } - }); - } } private void attachRootViewToInstance( @@ -1080,9 +1068,7 @@ private ReactApplicationContext createReactContext( ? mNativeModuleCallExceptionHandler : mDevSupportManager; CatalystInstanceImpl.Builder catalystInstanceBuilder = new CatalystInstanceImpl.Builder() - .setReactQueueConfigurationSpec(mUseSeparateUIBackgroundThread ? - ReactQueueConfigurationSpec.createWithSeparateUIBackgroundThread() : - ReactQueueConfigurationSpec.createDefault()) + .setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault()) .setJSExecutor(jsExecutor) .setRegistry(nativeModuleRegistry) .setJSBundleLoader(jsBundleLoader) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java index 2fbaaa2b80c339..f7fc31e2c62d77 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java @@ -46,7 +46,6 @@ public class ReactInstanceManagerBuilder { private boolean mDelayViewManagerClassLoadsEnabled; private @Nullable DevBundleDownloadListener mDevBundleDownloadListener; private @Nullable JavaScriptExecutorFactory mJavaScriptExecutorFactory; - private boolean mUseSeparateUIBackgroundThread; private int mMinNumShakes = 1; private int mMinTimeLeftInFrameForNonBatchedOperationMs = -1; @@ -214,12 +213,6 @@ public ReactInstanceManagerBuilder setDevBundleDownloadListener( return this; } - public ReactInstanceManagerBuilder setUseSeparateUIBackgroundThread( - boolean useSeparateUIBackgroundThread) { - mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread; - return this; - } - public ReactInstanceManagerBuilder setMinNumShakes(int minNumShakes) { mMinNumShakes = minNumShakes; return this; @@ -286,7 +279,6 @@ public ReactInstanceManager build() { mLazyViewManagersEnabled, mDelayViewManagerClassLoadsEnabled, mDevBundleDownloadListener, - mUseSeparateUIBackgroundThread, mMinNumShakes, mMinTimeLeftInFrameForNonBatchedOperationMs); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index 87c5f5902468e0..05cfc8d776ed80 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -330,7 +330,7 @@ private void updateRootLayoutSpecs(final int widthMeasureSpec, final int heightM } final ReactContext reactApplicationContext = mReactInstanceManager.getCurrentReactContext(); if (reactApplicationContext != null) { - reactApplicationContext.runUIBackgroundRunnable( + reactApplicationContext.runOnNativeModulesQueueThread( new GuardedRunnable(reactApplicationContext) { @Override public void runGuarded() { diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index f9b883c3532a2f..7afc565c2f9418 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -83,7 +83,6 @@ public String toString() { private final NativeModuleRegistry mNativeModuleRegistry; private final NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler; private final MessageQueueThread mNativeModulesQueueThread; - private final @Nullable MessageQueueThread mUIBackgroundQueueThread; private boolean mInitialized = false; private volatile boolean mAcceptCalls = false; @@ -114,7 +113,6 @@ private CatalystInstanceImpl( mJSBundleLoader = jsBundleLoader; mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler; mNativeModulesQueueThread = mReactQueueConfiguration.getNativeModulesQueueThread(); - mUIBackgroundQueueThread = mReactQueueConfiguration.getUIBackgroundQueueThread(); mTraceListener = new JSProfilerTraceListener(this); Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge before initializeBridge"); @@ -123,7 +121,6 @@ private CatalystInstanceImpl( jsExecutor, mReactQueueConfiguration.getJSQueueThread(), mNativeModulesQueueThread, - mUIBackgroundQueueThread, mNativeModuleRegistry.getJavaModules(this), mNativeModuleRegistry.getCxxModules()); Log.d(ReactConstants.TAG, "Initializing React Xplat Bridge after initializeBridge"); @@ -191,7 +188,6 @@ private native void initializeBridge( JavaScriptExecutor jsExecutor, MessageQueueThread jsQueue, MessageQueueThread moduleQueue, - MessageQueueThread uiBackgroundQueue, Collection javaModules, Collection cxxModules); diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java index 4148889d3bf2aa..85959c84547055 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java @@ -44,7 +44,6 @@ public class ReactContext extends ContextWrapper { private @Nullable CatalystInstance mCatalystInstance; private @Nullable LayoutInflater mInflater; private @Nullable MessageQueueThread mUiMessageQueueThread; - private @Nullable MessageQueueThread mUiBackgroundMessageQueueThread; private @Nullable MessageQueueThread mNativeModulesMessageQueueThread; private @Nullable MessageQueueThread mJSMessageQueueThread; private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler; @@ -69,7 +68,6 @@ public void initializeWithInstance(CatalystInstance catalystInstance) { ReactQueueConfiguration queueConfig = catalystInstance.getReactQueueConfiguration(); mUiMessageQueueThread = queueConfig.getUIQueueThread(); - mUiBackgroundMessageQueueThread = queueConfig.getUIBackgroundQueueThread(); mNativeModulesMessageQueueThread = queueConfig.getNativeModulesQueueThread(); mJSMessageQueueThread = queueConfig.getJSQueueThread(); } @@ -269,14 +267,6 @@ public void runOnUiQueueThread(Runnable runnable) { Assertions.assertNotNull(mUiMessageQueueThread).runOnQueue(runnable); } - public void assertOnUiBackgroundQueueThread() { - Assertions.assertNotNull(mUiBackgroundMessageQueueThread).assertIsOnThread(); - } - - public void runOnUiBackgroundQueueThread(Runnable runnable) { - Assertions.assertNotNull(mUiBackgroundMessageQueueThread).runOnQueue(runnable); - } - public void assertOnNativeModulesQueueThread() { Assertions.assertNotNull(mNativeModulesMessageQueueThread).assertIsOnThread(); } @@ -305,26 +295,6 @@ public void runOnJSQueueThread(Runnable runnable) { Assertions.assertNotNull(mJSMessageQueueThread).runOnQueue(runnable); } - public boolean hasUIBackgroundRunnableThread() { - return mUiBackgroundMessageQueueThread != null; - } - - public void assertOnUIBackgroundOrNativeModulesThread() { - if (mUiBackgroundMessageQueueThread == null) { - assertOnNativeModulesQueueThread(); - } else { - assertOnUiBackgroundQueueThread(); - } - } - - public void runUIBackgroundRunnable(Runnable runnable) { - if (mUiBackgroundMessageQueueThread == null) { - runOnNativeModulesQueueThread(runnable); - } else { - runOnUiBackgroundQueueThread(runnable); - } - } - /** * Passes the given exception to the current * {@link com.facebook.react.bridge.NativeModuleCallExceptionHandler} if one exists, rethrowing diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfiguration.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfiguration.java index 68a42a82f1fabc..b5b44a9a2c51a0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfiguration.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfiguration.java @@ -9,7 +9,6 @@ package com.facebook.react.bridge.queue; -import javax.annotation.Nullable; /** * Specifies which {@link MessageQueueThread}s must be used to run the various contexts of @@ -22,8 +21,6 @@ */ public interface ReactQueueConfiguration { MessageQueueThread getUIQueueThread(); - @Nullable - MessageQueueThread getUIBackgroundQueueThread(); MessageQueueThread getNativeModulesQueueThread(); MessageQueueThread getJSQueueThread(); void destroy(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationImpl.java index 05b37c5977f29c..60d7e0eb164302 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationImpl.java @@ -9,8 +9,6 @@ package com.facebook.react.bridge.queue; -import javax.annotation.Nullable; - import java.util.Map; import android.os.Looper; @@ -20,17 +18,14 @@ public class ReactQueueConfigurationImpl implements ReactQueueConfiguration { private final MessageQueueThreadImpl mUIQueueThread; - private final @Nullable MessageQueueThreadImpl mUIBackgroundQueueThread; private final MessageQueueThreadImpl mNativeModulesQueueThread; private final MessageQueueThreadImpl mJSQueueThread; private ReactQueueConfigurationImpl( - MessageQueueThreadImpl uiQueueThread, - @Nullable MessageQueueThreadImpl uiBackgroundQueueThread, - MessageQueueThreadImpl nativeModulesQueueThread, - MessageQueueThreadImpl jsQueueThread) { + MessageQueueThreadImpl uiQueueThread, + MessageQueueThreadImpl nativeModulesQueueThread, + MessageQueueThreadImpl jsQueueThread) { mUIQueueThread = uiQueueThread; - mUIBackgroundQueueThread = uiBackgroundQueueThread; mNativeModulesQueueThread = nativeModulesQueueThread; mJSQueueThread = jsQueueThread; } @@ -40,11 +35,6 @@ public MessageQueueThread getUIQueueThread() { return mUIQueueThread; } - @Override - public @Nullable MessageQueueThread getUIBackgroundQueueThread() { - return mUIBackgroundQueueThread; - } - @Override public MessageQueueThread getNativeModulesQueueThread() { return mNativeModulesQueueThread; @@ -60,10 +50,6 @@ public MessageQueueThread getJSQueueThread() { * is destroyed so that we shut down the proper queue threads. */ public void destroy() { - if (mUIBackgroundQueueThread != null && - mUIBackgroundQueueThread.getLooper() != Looper.getMainLooper()) { - mUIBackgroundQueueThread.quitSynchronous(); - } if (mNativeModulesQueueThread.getLooper() != Looper.getMainLooper()) { mNativeModulesQueueThread.quitSynchronous(); } @@ -94,16 +80,8 @@ public static ReactQueueConfigurationImpl create( MessageQueueThreadImpl.create(spec.getNativeModulesQueueThreadSpec(), exceptionHandler); } - MessageQueueThreadImpl uiBackgroundThread = - specsToThreads.get(spec.getUIBackgroundQueueThreadSpec()); - if (uiBackgroundThread == null && spec.getUIBackgroundQueueThreadSpec() != null) { - uiBackgroundThread = - MessageQueueThreadImpl.create(spec.getUIBackgroundQueueThreadSpec(), exceptionHandler); - } - return new ReactQueueConfigurationImpl( uiThread, - uiBackgroundThread, nativeModulesThread, jsThread); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationSpec.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationSpec.java index 6b23bfd716431d..a112f217c608de 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationSpec.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationSpec.java @@ -25,23 +25,16 @@ public class ReactQueueConfigurationSpec { private static final long LEGACY_STACK_SIZE_BYTES = 2000000; - private final @Nullable MessageQueueThreadSpec mUIBackgroundQueueThreadSpec; private final MessageQueueThreadSpec mNativeModulesQueueThreadSpec; private final MessageQueueThreadSpec mJSQueueThreadSpec; private ReactQueueConfigurationSpec( - @Nullable MessageQueueThreadSpec uiBackgroundQueueThreadSpec, MessageQueueThreadSpec nativeModulesQueueThreadSpec, MessageQueueThreadSpec jsQueueThreadSpec) { - mUIBackgroundQueueThreadSpec = uiBackgroundQueueThreadSpec; mNativeModulesQueueThreadSpec = nativeModulesQueueThreadSpec; mJSQueueThreadSpec = jsQueueThreadSpec; } - public @Nullable MessageQueueThreadSpec getUIBackgroundQueueThreadSpec() { - return mUIBackgroundQueueThreadSpec; - } - public MessageQueueThreadSpec getNativeModulesQueueThreadSpec() { return mNativeModulesQueueThreadSpec; } @@ -64,32 +57,11 @@ public static ReactQueueConfigurationSpec createDefault() { .build(); } - public static ReactQueueConfigurationSpec createWithSeparateUIBackgroundThread() { - MessageQueueThreadSpec spec = Build.VERSION.SDK_INT < 21 ? - MessageQueueThreadSpec.newBackgroundThreadSpec("native_modules", LEGACY_STACK_SIZE_BYTES) : - MessageQueueThreadSpec.newBackgroundThreadSpec("native_modules"); - return builder() - .setJSQueueThreadSpec(MessageQueueThreadSpec.newBackgroundThreadSpec("js")) - .setNativeModulesQueueThreadSpec(spec) - .setUIBackgroundQueueThreadSpec( - MessageQueueThreadSpec.newUIBackgroundTreadSpec("ui_background")) - .build(); - } - public static class Builder { - private @Nullable MessageQueueThreadSpec mUIBackgroundQueueSpec; private @Nullable MessageQueueThreadSpec mNativeModulesQueueSpec; private @Nullable MessageQueueThreadSpec mJSQueueSpec; - public Builder setUIBackgroundQueueThreadSpec(MessageQueueThreadSpec spec) { - Assertions.assertCondition( - mUIBackgroundQueueSpec == null, - "Setting UI background queue multiple times!"); - mUIBackgroundQueueSpec = spec; - return this; - } - public Builder setNativeModulesQueueThreadSpec(MessageQueueThreadSpec spec) { Assertions.assertCondition( mNativeModulesQueueSpec == null, @@ -106,7 +78,6 @@ public Builder setJSQueueThreadSpec(MessageQueueThreadSpec spec) { public ReactQueueConfigurationSpec build() { return new ReactQueueConfigurationSpec( - mUIBackgroundQueueSpec, Assertions.assertNotNull(mNativeModulesQueueSpec), Assertions.assertNotNull(mJSQueueSpec)); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index 1591127cf97479..7becf4ad48f221 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -305,7 +305,7 @@ public int addRootVi new SizeMonitoringFrameLayout.OnSizeChangedListener() { @Override public void onSizeChanged(final int width, final int height, int oldW, int oldH) { - reactApplicationContext.runUIBackgroundRunnable( + reactApplicationContext.runOnNativeModulesQueueThread( new GuardedRunnable(reactApplicationContext) { @Override public void runGuarded() { @@ -325,7 +325,7 @@ public void removeRootView(int rootViewTag) { } public void updateNodeSize(int nodeViewTag, int newWidth, int newHeight) { - getReactApplicationContext().assertOnUIBackgroundOrNativeModulesThread(); + getReactApplicationContext().assertOnNativeModulesQueueThread(); mUIImplementation.updateNodeSize(nodeViewTag, newWidth, newHeight); } @@ -344,7 +344,7 @@ public void setViewLocalData(final int tag, final Object data) { reactApplicationContext.assertOnUiQueueThread(); - reactApplicationContext.runUIBackgroundRunnable( + reactApplicationContext.runOnNativeModulesQueueThread( new GuardedRunnable(reactApplicationContext) { @Override public void runGuarded() { diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java index 705e455020418d..674c6ef80675b6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java @@ -306,7 +306,7 @@ protected void onSizeChanged(final int w, final int h, int oldw, int oldh) { if (getChildCount() > 0) { final int viewTag = getChildAt(0).getId(); ReactContext reactContext = (ReactContext) getContext(); - reactContext.runUIBackgroundRunnable( + reactContext.runOnNativeModulesQueueThread( new GuardedRunnable(reactContext) { @Override public void runGuarded() { diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index abac4d1b19e081..7b136f0d0cdf14 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -89,9 +89,6 @@ CatalystInstanceImpl::~CatalystInstanceImpl() { if (moduleMessageQueue_ != NULL) { moduleMessageQueue_->quitSynchronous(); } - if (uiBackgroundMessageQueue_ != NULL) { - uiBackgroundMessageQueue_->quitSynchronous(); - } } void CatalystInstanceImpl::registerNatives() { @@ -119,15 +116,11 @@ void CatalystInstanceImpl::initializeBridge( JavaScriptExecutorHolder* jseh, jni::alias_ref jsQueue, jni::alias_ref nativeModulesQueue, - jni::alias_ref uiBackgroundQueue, jni::alias_ref::javaobject> javaModules, jni::alias_ref::javaobject> cxxModules) { // TODO mhorowitz: how to assert here? // Assertions.assertCondition(mBridge == null, "initializeBridge should be called once"); moduleMessageQueue_ = std::make_shared(nativeModulesQueue); - if (uiBackgroundQueue.get() != nullptr) { - uiBackgroundMessageQueue_ = std::make_shared(uiBackgroundQueue); - } // This used to be: // @@ -150,13 +143,12 @@ void CatalystInstanceImpl::initializeBridge( std::weak_ptr(instance_), javaModules, cxxModules, - moduleMessageQueue_, - uiBackgroundMessageQueue_)); + moduleMessageQueue_)); instance_->initializeBridge( folly::make_unique( callback, - uiBackgroundMessageQueue_ != NULL ? uiBackgroundMessageQueue_ : moduleMessageQueue_), + moduleMessageQueue_), jseh->getExecutorFactory(), folly::make_unique(jsQueue), moduleRegistry_); @@ -169,8 +161,7 @@ void CatalystInstanceImpl::extendNativeModules( std::weak_ptr(instance_), javaModules, cxxModules, - moduleMessageQueue_, - uiBackgroundMessageQueue_)); + moduleMessageQueue_)); } void CatalystInstanceImpl::jniSetSourceURL(const std::string& sourceURL) { diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h index 8a94c8cc9f3807..5f7b1be15157e6 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h @@ -46,7 +46,6 @@ class CatalystInstanceImpl : public jni::HybridClass { JavaScriptExecutorHolder* jseh, jni::alias_ref jsQueue, jni::alias_ref moduleQueue, - jni::alias_ref uiBackgroundQueue, jni::alias_ref::javaobject> javaModules, jni::alias_ref::javaobject> cxxModules); @@ -79,7 +78,6 @@ class CatalystInstanceImpl : public jni::HybridClass { std::shared_ptr instance_; std::shared_ptr moduleRegistry_; std::shared_ptr moduleMessageQueue_; - std::shared_ptr uiBackgroundMessageQueue_; }; }} diff --git a/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp b/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp index 9706a43dc1c18d..eb204dd3ee91b3 100644 --- a/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp +++ b/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp @@ -33,25 +33,12 @@ std::vector> buildNativeModuleList( std::weak_ptr winstance, jni::alias_ref::javaobject> javaModules, jni::alias_ref::javaobject> cxxModules, - std::shared_ptr moduleMessageQueue, - std::shared_ptr uiBackgroundMessageQueue) { + std::shared_ptr moduleMessageQueue) { std::vector> modules; if (javaModules) { for (const auto& jm : *javaModules) { - std::string name = jm->getName(); - if (uiBackgroundMessageQueue != NULL && - // This is techinically a hack. Perhaps we should bind the specific queue to the module - // in the module holder or wrapper. - // TODO expose as module configuration option - (name == "UIManager" || - name == "NativeAnimatedModule" || - name == "FBFacebookReactNavigator")) { - modules.emplace_back(folly::make_unique( - winstance, jm, uiBackgroundMessageQueue)); - } else { - modules.emplace_back(folly::make_unique( - winstance, jm, moduleMessageQueue)); - } + modules.emplace_back(folly::make_unique( + winstance, jm, moduleMessageQueue)); } } if (cxxModules) { diff --git a/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h b/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h index 6e31adc898d3bd..3a8cc09258e00f 100644 --- a/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h +++ b/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h @@ -27,7 +27,6 @@ std::vector> buildNativeModuleList( std::weak_ptr winstance, jni::alias_ref::javaobject> javaModules, jni::alias_ref::javaobject> cxxModules, - std::shared_ptr moduleMessageQueue, - std::shared_ptr uiBackgroundMessageQueue); + std::shared_ptr moduleMessageQueue); } }