Rename "ReactInstanceManagerDevHelper" to "ReactInstanceDevHelper" so it doesn't look like Bridge-specific

Summary: Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D26199747

fbshipit-source-id: c6fe7d07e15940d08cc726c6631dd387910b40a0
This commit is contained in:
Lulu Wu
2021-02-03 14:39:40 -08:00
committed by Facebook GitHub Bot
parent 77ba2ad2f2
commit 5d8e75937d
6 changed files with 32 additions and 31 deletions
@@ -78,7 +78,7 @@ import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.devsupport.DevSupportManagerFactory;
import com.facebook.react.devsupport.ReactInstanceManagerDevHelper;
import com.facebook.react.devsupport.ReactInstanceDevHelper;
import com.facebook.react.devsupport.RedBoxHandler;
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
@@ -282,8 +282,8 @@ public class ReactInstanceManager {
}
}
private ReactInstanceManagerDevHelper createDevHelperInterface() {
return new ReactInstanceManagerDevHelper() {
private ReactInstanceDevHelper createDevHelperInterface() {
return new ReactInstanceDevHelper() {
@Override
public void onReloadWithJSDebugger(JavaJSExecutor.Factory jsExecutorFactory) {
ReactInstanceManager.this.onReloadWithJSDebugger(jsExecutorFactory);
@@ -29,7 +29,7 @@ import java.util.Locale;
/** Controller to display loading messages on top of the screen. All methods are thread safe. */
public class DevLoadingViewController {
private static boolean sEnabled = true;
private final ReactInstanceManagerDevHelper mReactInstanceManagerHelper;
private final ReactInstanceDevHelper mReactInstanceManagerHelper;
private @Nullable TextView mDevLoadingView;
private @Nullable PopupWindow mDevLoadingPopup;
@@ -37,7 +37,7 @@ public class DevLoadingViewController {
sEnabled = enabled;
}
public DevLoadingViewController(ReactInstanceManagerDevHelper reactInstanceManagerHelper) {
public DevLoadingViewController(ReactInstanceDevHelper reactInstanceManagerHelper) {
mReactInstanceManagerHelper = reactInstanceManagerHelper;
}
@@ -104,7 +104,7 @@ public abstract class DevSupportManagerBase
private final BroadcastReceiver mReloadAppBroadcastReceiver;
protected final DevServerHelper mDevServerHelper;
private final LinkedHashMap<String, DevOptionHandler> mCustomDevOptions = new LinkedHashMap<>();
private final ReactInstanceManagerDevHelper mReactInstanceManagerHelper;
private final ReactInstanceDevHelper mReactInstanceDevHelper;
private final @Nullable String mJSAppBundleName;
private final File mJSBundleTempFile;
private final File mJSSplitBundlesDir;
@@ -135,14 +135,14 @@ public abstract class DevSupportManagerBase
public DevSupportManagerBase(
Context applicationContext,
ReactInstanceManagerDevHelper reactInstanceManagerHelper,
ReactInstanceDevHelper reactInstanceDevHelper,
@Nullable String packagerPathForJSBundleName,
boolean enableOnCreate,
int minNumShakes) {
this(
applicationContext,
reactInstanceManagerHelper,
reactInstanceDevHelper,
packagerPathForJSBundleName,
enableOnCreate,
null,
@@ -153,14 +153,14 @@ public abstract class DevSupportManagerBase
public DevSupportManagerBase(
Context applicationContext,
ReactInstanceManagerDevHelper reactInstanceManagerHelper,
ReactInstanceDevHelper reactInstanceDevHelper,
@Nullable String packagerPathForJSBundleName,
boolean enableOnCreate,
@Nullable RedBoxHandler redBoxHandler,
@Nullable DevBundleDownloadListener devBundleDownloadListener,
int minNumShakes,
@Nullable Map<String, RequestHandler> customPackagerCommandHandlers) {
mReactInstanceManagerHelper = reactInstanceManagerHelper;
mReactInstanceDevHelper = reactInstanceDevHelper;
mApplicationContext = applicationContext;
mJSAppBundleName = packagerPathForJSBundleName;
mDevSettings = new DevInternalSettings(applicationContext, this);
@@ -223,7 +223,7 @@ public abstract class DevSupportManagerBase
setDevSupportEnabled(enableOnCreate);
mRedBoxHandler = redBoxHandler;
mDevLoadingViewController = new DevLoadingViewController(reactInstanceManagerHelper);
mDevLoadingViewController = new DevLoadingViewController(reactInstanceDevHelper);
mExceptionLoggers.add(new JSExceptionLogger());
@@ -369,11 +369,11 @@ public abstract class DevSupportManagerBase
}
public @Nullable View createRootView(String appKey) {
return mReactInstanceManagerHelper.createRootView(appKey);
return mReactInstanceDevHelper.createRootView(appKey);
}
public void destroyRootView(View rootView) {
mReactInstanceManagerHelper.destroyRootView(rootView);
mReactInstanceDevHelper.destroyRootView(rootView);
}
private void hideDevOptionsDialog() {
@@ -393,7 +393,7 @@ public abstract class DevSupportManagerBase
@Override
public void run() {
if (mRedBoxDialog == null) {
Activity context = mReactInstanceManagerHelper.getCurrentActivity();
Activity context = mReactInstanceDevHelper.getCurrentActivity();
if (context == null || context.isFinishing()) {
FLog.e(
ReactConstants.TAG,
@@ -500,7 +500,7 @@ public abstract class DevSupportManagerBase
new DevOptionHandler() {
@Override
public void onOptionSelected() {
Activity context = mReactInstanceManagerHelper.getCurrentActivity();
Activity context = mReactInstanceDevHelper.getCurrentActivity();
if (context == null || context.isFinishing()) {
FLog.e(
ReactConstants.TAG,
@@ -537,7 +537,7 @@ public abstract class DevSupportManagerBase
@Override
public void onOptionSelected() {
mDevSettings.setElementInspectorEnabled(!mDevSettings.isElementInspectorEnabled());
mReactInstanceManagerHelper.toggleElementInspector();
mReactInstanceDevHelper.toggleElementInspector();
}
});
@@ -589,7 +589,7 @@ public abstract class DevSupportManagerBase
public void onOptionSelected() {
if (!mDevSettings.isFpsDebugEnabled()) {
// Request overlay permission if needed when "Show Perf Monitor" option is selected
Context context = mReactInstanceManagerHelper.getCurrentActivity();
Context context = mReactInstanceDevHelper.getCurrentActivity();
if (context == null) {
FLog.e(ReactConstants.TAG, "Unable to get reference to react activity");
} else {
@@ -616,7 +616,7 @@ public abstract class DevSupportManagerBase
final DevOptionHandler[] optionHandlers = options.values().toArray(new DevOptionHandler[0]);
Activity context = mReactInstanceManagerHelper.getCurrentActivity();
Activity context = mReactInstanceDevHelper.getCurrentActivity();
if (context == null || context.isFinishing()) {
FLog.e(
ReactConstants.TAG,
@@ -651,7 +651,7 @@ public abstract class DevSupportManagerBase
/** Starts of stops the sampling profiler */
private void toggleJSSamplingProfiler() {
JavaScriptExecutorFactory javaScriptExecutorFactory =
mReactInstanceManagerHelper.getJavaScriptExecutorFactory();
mReactInstanceDevHelper.getJavaScriptExecutorFactory();
if (!mIsSamplingProfilerEnabled) {
try {
javaScriptExecutorFactory.startSamplingProfiler();
@@ -1105,7 +1105,7 @@ public abstract class DevSupportManagerBase
}
}
};
mReactInstanceManagerHelper.onReloadWithJSDebugger(factory);
mReactInstanceDevHelper.onReloadWithJSDebugger(factory);
}
private WebsocketJavaScriptExecutor.JSExecutorConnectCallback getExecutorConnectCallback(
@@ -1139,7 +1139,7 @@ public abstract class DevSupportManagerBase
new Runnable() {
@Override
public void run() {
mReactInstanceManagerHelper.onJSBundleLoadedFromServer();
mReactInstanceDevHelper.onJSBundleLoadedFromServer();
}
});
}
@@ -1291,7 +1291,7 @@ public abstract class DevSupportManagerBase
@Override
public void run() {
mDevSettings.setElementInspectorEnabled(!mDevSettings.isElementInspectorEnabled());
mReactInstanceManagerHelper.toggleElementInspector();
mReactInstanceDevHelper.toggleElementInspector();
}
});
}
@@ -28,14 +28,14 @@ public class DevSupportManagerFactory {
public static DevSupportManager create(
Context applicationContext,
ReactInstanceManagerDevHelper reactInstanceManagerHelper,
ReactInstanceDevHelper reactInstanceDevHelper,
@Nullable String packagerPathForJSBundleName,
boolean enableOnCreate,
int minNumShakes) {
return create(
applicationContext,
reactInstanceManagerHelper,
reactInstanceDevHelper,
packagerPathForJSBundleName,
enableOnCreate,
null,
@@ -46,7 +46,7 @@ public class DevSupportManagerFactory {
public static DevSupportManager create(
Context applicationContext,
ReactInstanceManagerDevHelper reactInstanceManagerHelper,
ReactInstanceDevHelper reactInstanceManagerHelper,
@Nullable String packagerPathForJSBundleName,
boolean enableOnCreate,
@Nullable RedBoxHandler redBoxHandler,
@@ -69,7 +69,7 @@ public class DevSupportManagerFactory {
Constructor constructor =
devSupportManagerClass.getConstructor(
Context.class,
ReactInstanceManagerDevHelper.class,
ReactInstanceDevHelper.class,
String.class,
boolean.class,
RedBoxHandler.class,
@@ -44,14 +44,14 @@ public final class DevSupportManagerImpl extends DevSupportManagerBase {
public DevSupportManagerImpl(
Context applicationContext,
ReactInstanceManagerDevHelper reactInstanceManagerHelper,
ReactInstanceDevHelper reactInstanceDevHelper,
@Nullable String packagerPathForJSBundleName,
boolean enableOnCreate,
int minNumShakes) {
super(
applicationContext,
reactInstanceManagerHelper,
reactInstanceDevHelper,
packagerPathForJSBundleName,
enableOnCreate,
null,
@@ -62,7 +62,7 @@ public final class DevSupportManagerImpl extends DevSupportManagerBase {
public DevSupportManagerImpl(
Context applicationContext,
ReactInstanceManagerDevHelper reactInstanceManagerHelper,
ReactInstanceDevHelper reactInstanceManagerHelper,
@Nullable String packagerPathForJSBundleName,
boolean enableOnCreate,
@Nullable RedBoxHandler redBoxHandler,
@@ -15,9 +15,10 @@ import com.facebook.react.bridge.JavaScriptExecutorFactory;
/**
* Interface used by {@link DevSupportManager} for accessing some fields and methods of {@link
* ReactInstanceManager} for the purpose of displaying and handling developer menu options.
* ReactInstanceManager} or {@link ReactHost} for the purpose of displaying and handling developer
* menu options.
*/
public interface ReactInstanceManagerDevHelper {
public interface ReactInstanceDevHelper {
/** Request react instance recreation with JS debugging enabled. */
void onReloadWithJSDebugger(JavaJSExecutor.Factory proxyExecutorFactory);