Merge pull request #382 from josephroque/timeout-android

Respect readTimeout and connectionTimeout for downloadFile on Android
This commit is contained in:
Hagen Hübel 2017-11-17 00:04:13 +01:00 committed by GitHub
commit b353e2bfe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -556,6 +556,8 @@ public class RNFSManager extends ReactContextBaseJavaModule {
final int jobId = options.getInt("jobId"); final int jobId = options.getInt("jobId");
ReadableMap headers = options.getMap("headers"); ReadableMap headers = options.getMap("headers");
int progressDivider = options.getInt("progressDivider"); int progressDivider = options.getInt("progressDivider");
int readTimeout = options.getInt("readTimeout");
int connectionTimeout = options.getInt("connectionTimeout");
DownloadParams params = new DownloadParams(); DownloadParams params = new DownloadParams();
@ -563,6 +565,8 @@ public class RNFSManager extends ReactContextBaseJavaModule {
params.dest = file; params.dest = file;
params.headers = headers; params.headers = headers;
params.progressDivider = progressDivider; params.progressDivider = progressDivider;
params.readTimeout = readTimeout;
params.connectionTimeout = connectionTimeout;
params.onTaskCompleted = new DownloadParams.OnTaskCompleted() { params.onTaskCompleted = new DownloadParams.OnTaskCompleted() {
public void onTaskCompleted(DownloadResult res) { public void onTaskCompleted(DownloadResult res) {