diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java index 2932fecc5dad56..785b78f8050984 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java @@ -43,6 +43,7 @@ import com.facebook.react.common.ShakeDetector; import com.facebook.react.common.futures.SimpleSettableFuture; import com.facebook.react.devsupport.DevServerHelper.PackagerCommandListener; +import com.facebook.react.devsupport.interfaces.BundleLoadCallback; import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener; import com.facebook.react.devsupport.interfaces.DevOptionHandler; import com.facebook.react.devsupport.interfaces.DevSplitBundleCallback; @@ -1151,11 +1152,7 @@ public void run() { }); } - protected interface BundleLoadCallback { - void onSuccess(); - } - - protected void reloadJSFromServer(final String bundleURL, final BundleLoadCallback callback) { + public void reloadJSFromServer(final String bundleURL, final BundleLoadCallback callback) { ReactMarker.logMarker(ReactMarkerConstants.DOWNLOAD_START); mDevLoadingViewController.showForUrl(bundleURL); diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java index be29234308c7a8..b3738654b61540 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java @@ -12,6 +12,7 @@ import com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.devsupport.interfaces.BundleLoadCallback; import com.facebook.react.devsupport.interfaces.DevOptionHandler; import com.facebook.react.devsupport.interfaces.DevSplitBundleCallback; import com.facebook.react.devsupport.interfaces.DevSupportManager; @@ -131,6 +132,9 @@ public void handleReloadJS() {} @Override public void reloadJSFromServer(String bundleURL) {} + @Override + public void reloadJSFromServer(final String bundleURL, final BundleLoadCallback callback) {} + @Override public void loadSplitBundleFromServer(String bundlePath, DevSplitBundleCallback callback) {} diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java new file mode 100644 index 00000000000000..40495dfdbf9341 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.devsupport.interfaces; + +public interface BundleLoadCallback { + void onSuccess(); +} diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java index 265f2da731eaf1..6fc8020a41030f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java @@ -69,6 +69,8 @@ public interface DevSupportManager extends NativeModuleCallExceptionHandler { void reloadJSFromServer(final String bundleURL); + void reloadJSFromServer(final String bundleURL, final BundleLoadCallback callback); + void loadSplitBundleFromServer(String bundlePath, DevSplitBundleCallback callback); void isPackagerRunning(PackagerStatusCallback callback);