From e65b16e5b7ace86e76332a91cc342a3e531b273b Mon Sep 17 00:00:00 2001 From: Joseph Roque Date: Thu, 9 Nov 2017 17:54:51 -0500 Subject: [PATCH] Respect readTimeout and connectionTimeout for downloadFile on Android Fixes #368 --- android/src/main/java/com/rnfs/RNFSManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/src/main/java/com/rnfs/RNFSManager.java b/android/src/main/java/com/rnfs/RNFSManager.java index b32b37a..8644310 100755 --- a/android/src/main/java/com/rnfs/RNFSManager.java +++ b/android/src/main/java/com/rnfs/RNFSManager.java @@ -556,6 +556,8 @@ public class RNFSManager extends ReactContextBaseJavaModule { final int jobId = options.getInt("jobId"); ReadableMap headers = options.getMap("headers"); int progressDivider = options.getInt("progressDivider"); + int readTimeout = options.getInt("readTimeout"); + int connectionTimeout = options.getInt("connectionTimeout"); DownloadParams params = new DownloadParams(); @@ -563,6 +565,8 @@ public class RNFSManager extends ReactContextBaseJavaModule { params.dest = file; params.headers = headers; params.progressDivider = progressDivider; + params.readTimeout = readTimeout; + params.connectionTimeout = connectionTimeout; params.onTaskCompleted = new DownloadParams.OnTaskCompleted() { public void onTaskCompleted(DownloadResult res) {