diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index f9881747a..cbeebdb54 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -152,6 +152,7 @@ public class ReactInstanceManager { private final boolean mLazyNativeModulesEnabled; private final boolean mLazyViewManagersEnabled; private final boolean mSetupReactContextInBackgroundEnabled; + private final boolean mUseSeparateUIBackgroundThread; private final ReactInstanceDevCommandsHandler mDevInterface = new ReactInstanceDevCommandsHandler() { @@ -223,7 +224,8 @@ public class ReactInstanceManager { @Nullable RedBoxHandler redBoxHandler, boolean lazyNativeModulesEnabled, boolean lazyViewManagersEnabled, - boolean setupReactContextInBackgroundEnabled) { + boolean setupReactContextInBackgroundEnabled, + boolean useSeparateUIBackgroundThread) { initializeSoLoaderIfNecessary(applicationContext); @@ -253,6 +255,7 @@ public class ReactInstanceManager { mLazyNativeModulesEnabled = lazyNativeModulesEnabled; mLazyViewManagersEnabled = lazyViewManagersEnabled; mSetupReactContextInBackgroundEnabled = setupReactContextInBackgroundEnabled; + mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread; // Instantiate ReactChoreographer in UI thread. ReactChoreographer.initialize(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java index 65afdc4dc..91eb86f23 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java @@ -43,6 +43,7 @@ public class ReactInstanceManagerBuilder { protected boolean mLazyNativeModulesEnabled; protected boolean mLazyViewManagersEnabled; protected boolean mSetupReactContextInBackground; + protected boolean mUseSeparateUIBackgroundThread; /* package protected */ ReactInstanceManagerBuilder() { } @@ -193,6 +194,12 @@ public class ReactInstanceManagerBuilder { return this; } + public ReactInstanceManagerBuilder setUseSeparateUIBackgroundThread( + boolean useSeparateUIBackgroundThread) { + mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread; + return this; + } + /** * Instantiates a new {@link ReactInstanceManager}. * Before calling {@code build}, the following must be called: @@ -238,6 +245,7 @@ public class ReactInstanceManagerBuilder { mRedBoxHandler, mLazyNativeModulesEnabled, mLazyViewManagersEnabled, - mSetupReactContextInBackground); + mSetupReactContextInBackground, + mUseSeparateUIBackgroundThread); } }