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

Commit 9ffff391 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Merge branch '6712-s-deleting-existing-apk' into 'main'

SplitInstall: Delete already downloaded apk

See merge request !277
parents 547fbf84 d7606aa3
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -76,6 +76,13 @@ class DownloadManager @Inject constructor(
        }

        val downloadFile = File("$directoryFile/$fileName")
        if (downloadFile.exists()) {
            try {
                downloadFile.delete()
            } catch (exception: Exception) {
                Timber.e("Could not delete already existing split apk: $downloadFile", exception)
            }
        }

        return downloadFile(url, downloadFile, downloadCompleted)
    }