]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/asynctasks/SaveUrl.java
Fix downloads consuming massive CPU and locking the UI on slower CPUs. https://redmin...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / asynctasks / SaveUrl.java
index 03ab37464b21782137fad85e0f533c51b4a6c5bf..c93070951eeb352d380b90590fac9d53f230d4b0 100644 (file)
@@ -170,7 +170,8 @@ public class SaveUrl extends AsyncTask<String, Long, String> {
                     InputStream inputStream = new BufferedInputStream(httpUrlConnection.getInputStream());
 
                     // Initialize the conversion buffer byte array.
-                    byte[] conversionBufferByteArray = new byte[1024];
+                    // This is set to a megabyte so that frequent updating of the snackbar doesn't freeze the interface on download.  <https://redmine.stoutner.com/issues/709>
+                    byte[] conversionBufferByteArray = new byte[1048576];
 
                     // Initialize the downloaded kilobytes counter.
                     long downloadedKilobytesCounter = 0;