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

Commit 83d0d5ff authored by Philipp Heckel's avatar Philipp Heckel
Browse files

Bump version

parent b176bfe3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ android {
        minSdkVersion 21
        targetSdkVersion 30

        versionCode 15
        versionName "1.5.2"
        versionCode 16
        versionName "1.6.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

+4 −2
Original line number Diff line number Diff line
@@ -89,11 +89,11 @@ class DownloadWorker(private val context: Context, params: WorkerParameters) : W
                val out = resolver.openOutputStream(uri) ?: throw Exception("Cannot open output stream")
                out.use { fileOut ->
                    val fileIn = response.body!!.byteStream()
                    val buffer = ByteArray(8 * 1024)
                    val buffer = ByteArray(BUFFER_SIZE)
                    var bytes = fileIn.read(buffer)
                    var lastProgress = 0L
                    while (bytes >= 0) {
                        if (System.currentTimeMillis() - lastProgress > 500) {
                        if (System.currentTimeMillis() - lastProgress > NOTIFICATION_UPDATE_INTERVAL_MILLIS) {
                            if (isStopped) {
                                Log.d(TAG, "Attachment download was canceled")
                                val newAttachment = attachment.copy(progress = PROGRESS_NONE)
@@ -167,5 +167,7 @@ class DownloadWorker(private val context: Context, params: WorkerParameters) : W
    companion object {
        private const val TAG = "NtfyAttachDownload"
        private const val FILE_PROVIDER_AUTHORITY = BuildConfig.APPLICATION_ID + ".provider" // See AndroidManifest.xml
        private const val BUFFER_SIZE = 8 * 1024
        private const val NOTIFICATION_UPDATE_INTERVAL_MILLIS = 800
    }
}