From 407e033b34b6afa0ea96ed72f16cd164d572e911 Mon Sep 17 00:00:00 2001 From: Ram N Date: Thu, 2 Aug 2018 15:50:03 -0700 Subject: [PATCH] Remove the flag about Lazy native modules Summary: The method removes all settings for mLazyReactModules since Lazy and non lazy modules can exist in a single application now Reviewed By: achen1 Differential Revision: D9012312 fbshipit-source-id: 0420149654f8146453250d83d4de4b4c2fd31e9f --- .../java/com/facebook/react/testing/ReactTestHelper.java | 6 ++---- .../com/facebook/react/NativeModuleRegistryBuilder.java | 6 +----- .../main/java/com/facebook/react/ReactInstanceManager.java | 6 +----- .../com/facebook/react/ReactInstanceManagerBuilder.java | 7 ------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestHelper.java b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestHelper.java index 1452899db..f3f1ffc29 100644 --- a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestHelper.java +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestHelper.java @@ -54,8 +54,7 @@ public class ReactTestHelper { if (mNativeModuleRegistryBuilder == null) { mNativeModuleRegistryBuilder = new NativeModuleRegistryBuilder( (ReactApplicationContext) mContext, - null, - false); + null); } Assertions.assertNotNull(nativeModule); mNativeModuleRegistryBuilder.addNativeModule(nativeModule); @@ -67,8 +66,7 @@ public class ReactTestHelper { if (mNativeModuleRegistryBuilder == null) { mNativeModuleRegistryBuilder = new NativeModuleRegistryBuilder( (ReactApplicationContext) mContext, - null, - false); + null); } JavaScriptExecutor executor = null; try { diff --git a/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java b/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java index bda163b5e..b8898dc10 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java +++ b/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java @@ -30,19 +30,15 @@ public class NativeModuleRegistryBuilder { private final ReactApplicationContext mReactApplicationContext; private final ReactInstanceManager mReactInstanceManager; - private final boolean mLazyNativeModulesEnabled; private final Map mModules = new HashMap<>(); private final Map namesToType = new HashMap<>(); public NativeModuleRegistryBuilder( ReactApplicationContext reactApplicationContext, - ReactInstanceManager reactInstanceManager, - boolean lazyNativeModulesEnabled) { + ReactInstanceManager reactInstanceManager) { mReactApplicationContext = reactApplicationContext; mReactInstanceManager = reactInstanceManager; - // TODO T32034141 Remove mLazyNativeModulesEnabled - mLazyNativeModulesEnabled = lazyNativeModulesEnabled; } public void processPackage(ReactPackage reactPackage) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 075ba03ea..5e5f0dd51 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -158,7 +158,6 @@ public class ReactInstanceManager { private volatile Boolean mHasStartedDestroying = false; private final MemoryPressureRouter mMemoryPressureRouter; private final @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler; - private final boolean mLazyNativeModulesEnabled; private final @Nullable JSIModulePackage mJSIModulePackage; private List mViewManagers; @@ -202,7 +201,6 @@ public class ReactInstanceManager { LifecycleState initialLifecycleState, NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler, @Nullable RedBoxHandler redBoxHandler, - boolean lazyNativeModulesEnabled, boolean lazyViewManagersEnabled, @Nullable DevBundleDownloadListener devBundleDownloadListener, int minNumShakes, @@ -236,7 +234,6 @@ public class ReactInstanceManager { mLifecycleState = initialLifecycleState; mMemoryPressureRouter = new MemoryPressureRouter(applicationContext); mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler; - mLazyNativeModulesEnabled = lazyNativeModulesEnabled; synchronized (mPackages) { PrinterHolder.getPrinter() .logMessage(ReactDebugOverlayTags.RN_CORE, "RNCore: Use Split Packages"); @@ -1126,8 +1123,7 @@ public class ReactInstanceManager { boolean checkAndUpdatePackageMembership) { NativeModuleRegistryBuilder nativeModuleRegistryBuilder = new NativeModuleRegistryBuilder( reactContext, - this, - mLazyNativeModulesEnabled); + this); ReactMarker.logMarker(PROCESS_PACKAGES_START); diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java index 42a4a7476..197546f71 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java @@ -45,7 +45,6 @@ public class ReactInstanceManagerBuilder { private @Nullable Activity mCurrentActivity; private @Nullable DefaultHardwareBackBtnHandler mDefaultHardwareBackBtnHandler; private @Nullable RedBoxHandler mRedBoxHandler; - private boolean mLazyNativeModulesEnabled; private boolean mLazyViewManagersEnabled; private @Nullable DevBundleDownloadListener mDevBundleDownloadListener; private @Nullable JavaScriptExecutorFactory mJavaScriptExecutorFactory; @@ -192,11 +191,6 @@ public class ReactInstanceManagerBuilder { return this; } - public ReactInstanceManagerBuilder setLazyNativeModulesEnabled(boolean lazyNativeModulesEnabled) { - mLazyNativeModulesEnabled = lazyNativeModulesEnabled; - return this; - } - public ReactInstanceManagerBuilder setLazyViewManagersEnabled(boolean lazyViewManagersEnabled) { mLazyViewManagersEnabled = lazyViewManagersEnabled; return this; @@ -270,7 +264,6 @@ public class ReactInstanceManagerBuilder { Assertions.assertNotNull(mInitialLifecycleState, "Initial lifecycle state was not set"), mNativeModuleCallExceptionHandler, mRedBoxHandler, - mLazyNativeModulesEnabled, mLazyViewManagersEnabled, mDevBundleDownloadListener, mMinNumShakes,