Upload large backup attachments using a foreground service.

This commit is contained in:
jeffrey-signal
2025-06-11 12:02:23 -04:00
committed by GitHub
parent f8d8558cdb
commit cd18db613a
18 changed files with 137 additions and 72 deletions

View File

@@ -9,6 +9,7 @@ import android.content.Context
import android.graphics.Bitmap
import android.os.Build
import org.signal.core.util.logging.Log
import org.signal.core.util.mebiBytes
import org.signal.protos.resumableuploads.ResumableUpload
import org.thoughtcrime.securesms.blurhash.BlurHashEncoder
import org.thoughtcrime.securesms.mms.PartAuthority
@@ -27,6 +28,11 @@ object AttachmentUploadUtil {
private val TAG = Log.tag(AttachmentUploadUtil::class.java)
/**
* Foreground notification shows while uploading attachments larger than this.
*/
val FOREGROUND_LIMIT_BYTES: Long = 10.mebiBytes.inWholeBytes
/**
* Builds a [SignalServiceAttachmentStream] from the provided data, which can then be provided to various upload methods.
*/