Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4f05227 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Use bigger buffers when installing app

... progress bar is still smooth and install time is 4 times lower.

Change-Id: I80d13b349865acb8b223b0f94eeb451564491f08
Fixes: 65607474
Test: Installed apps and measured speed
parent 84ad76ea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ public class InstallInstalling extends Activity {
                    long sizeBytes = file.length();
                    try (OutputStream out = session
                            .openWrite("PackageInstaller", 0, sizeBytes)) {
                        byte[] buffer = new byte[4096];
                        byte[] buffer = new byte[1024 * 1024];
                        while (true) {
                            int numRead = in.read(buffer);

+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ public class InstallStaging extends Activity {
                }

                try (OutputStream out = new FileOutputStream(mStagedFile)) {
                    byte[] buffer = new byte[4096];
                    byte[] buffer = new byte[1024 * 1024];
                    int bytesRead;
                    while ((bytesRead = in.read(buffer)) >= 0) {
                        // Be nice and respond to a cancellation