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

Commit 09b5b2fa authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch '863-q-free_space' into 'v1-q'

Updater: Require 3 x OTA size space before download

See merge request !129
parents cf0ede82 a6015024
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -309,12 +309,13 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
    private AlertDialog.Builder getSpaceDialog(UpdateInfo update) {
        Resources resources = mActivity.getResources();
        File updateFile = update.getFile();
        long requiredSpace = update.getFileSize() * 2;
        // Required space before download is 3 x OTA size.
        long requiredSpace = update.getFileSize() * 3;
        long availableFreeSpace = Utils.availableFreeSpace();

        // Check for space depending on the downloaded file size on resume
        if (updateFile != null && updateFile.exists() && updateFile.length() > 0 &&
                updateFile.length() < update.getFileSize()) {
        // Subtract space depending on the downloaded file size.
        // Required space after download completed will be 2 x OTA size.
        if (updateFile != null && updateFile.exists() && updateFile.length() > 0) {
            requiredSpace -= updateFile.length();
        }