Fix for IllegalStateException while CodePushUpdateManager.downloadPackage (#1206)

This commit is contained in:
Artem Egorov
2018-02-16 15:32:26 +03:00
committed by GitHub
parent d6cf63e98d
commit 80828674af

View File

@@ -163,11 +163,11 @@ public class CodePushUpdateManager {
try {
URL downloadUrl = new URL(downloadUrlString);
connection = (HttpURLConnection) (downloadUrl.openConnection());
bin = new BufferedInputStream(connection.getInputStream());
long totalBytes = connection.getContentLength();
long receivedBytes = 0;
bin = new BufferedInputStream(connection.getInputStream());
File downloadFolder = new File(getCodePushPath());
downloadFolder.mkdirs();
downloadFile = new File(downloadFolder, CodePushConstants.DOWNLOAD_FILE_NAME);