Skip to content

Commit

Permalink
add flag to test running BG UI operation on a separate thread from th…
Browse files Browse the repository at this point in the history
…e native modules thread

Reviewed By: achen1

Differential Revision: D4912045

fbshipit-source-id: b0b1aea24f8d463b95369636b7df2422a23aab22
  • Loading branch information
aaronechiu authored and facebook-github-bot committed Apr 20, 2017
1 parent 97a8663 commit 3a3e5af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public interface ReactInstanceEventListener {
private final boolean mLazyNativeModulesEnabled;
private final boolean mLazyViewManagersEnabled;
private final boolean mSetupReactContextInBackgroundEnabled;
private final boolean mUseSeparateUIBackgroundThread;

private final ReactInstanceDevCommandsHandler mDevInterface =
new ReactInstanceDevCommandsHandler() {
Expand Down Expand Up @@ -223,7 +224,8 @@ public static ReactInstanceManagerBuilder builder() {
@Nullable RedBoxHandler redBoxHandler,
boolean lazyNativeModulesEnabled,
boolean lazyViewManagersEnabled,
boolean setupReactContextInBackgroundEnabled) {
boolean setupReactContextInBackgroundEnabled,
boolean useSeparateUIBackgroundThread) {

initializeSoLoaderIfNecessary(applicationContext);

Expand Down Expand Up @@ -253,6 +255,7 @@ public static ReactInstanceManagerBuilder builder() {
mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
mLazyViewManagersEnabled = lazyViewManagersEnabled;
mSetupReactContextInBackgroundEnabled = setupReactContextInBackgroundEnabled;
mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread;

// Instantiate ReactChoreographer in UI thread.
ReactChoreographer.initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class ReactInstanceManagerBuilder {
protected boolean mLazyNativeModulesEnabled;
protected boolean mLazyViewManagersEnabled;
protected boolean mSetupReactContextInBackground;
protected boolean mUseSeparateUIBackgroundThread;

/* package protected */ ReactInstanceManagerBuilder() {
}
Expand Down Expand Up @@ -193,6 +194,12 @@ public ReactInstanceManagerBuilder setSetupReactContextInBackgroundEnabled(
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:
Expand Down Expand Up @@ -238,6 +245,7 @@ public ReactInstanceManager build() {
mRedBoxHandler,
mLazyNativeModulesEnabled,
mLazyViewManagersEnabled,
mSetupReactContextInBackground);
mSetupReactContextInBackground,
mUseSeparateUIBackgroundThread);
}
}

0 comments on commit 3a3e5af

Please sign in to comment.