mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 14:13:26 +00:00
Do not expose BundleDownloader
from DevServerHelper
Summary: Adds `downloadBundleFromURL` as a delegating method to `DevServerHelper` rather than exposing the underlying `BundleDownloader`. The additional encapsulation will allow futher factoring of `BundleDownloader` to make logic for different delta bundler clients easier to implement and maintain. Reviewed By: pakoito Differential Revision: D6871225 fbshipit-source-id: 6adcab5e69869a234baf38f1f1e60abd34d6b555
This commit is contained in:
parent
d4517ddb9f
commit
108f9664bf
@ -19,6 +19,7 @@ import com.facebook.react.R;
|
||||
import com.facebook.react.bridge.UiThreadUtil;
|
||||
import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.common.network.OkHttpCallUtil;
|
||||
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
|
||||
import com.facebook.react.devsupport.interfaces.PackagerStatusCallback;
|
||||
import com.facebook.react.devsupport.interfaces.StackFrame;
|
||||
import com.facebook.react.modules.systeminfo.AndroidInfoHelpers;
|
||||
@ -391,8 +392,10 @@ public class DevServerHelper {
|
||||
AndroidInfoHelpers.getFriendlyDeviceName());
|
||||
}
|
||||
|
||||
public BundleDownloader getBundleDownloader() {
|
||||
return mBundleDownloader;
|
||||
public void downloadBundleFromURL(
|
||||
DevBundleDownloadListener callback,
|
||||
File outputFile, String bundleURL, BundleDownloader.BundleInfo bundleInfo) {
|
||||
mBundleDownloader.downloadBundleFromURL(callback, outputFile, bundleURL, bundleInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1039,7 +1039,7 @@ public class DevSupportManagerImpl implements
|
||||
|
||||
final BundleDownloader.BundleInfo bundleInfo = new BundleDownloader.BundleInfo();
|
||||
|
||||
mDevServerHelper.getBundleDownloader().downloadBundleFromURL(
|
||||
mDevServerHelper.downloadBundleFromURL(
|
||||
new DevBundleDownloadListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user