mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Send error message after cancelling a link+sync.
This commit is contained in:
committed by
Cody Henthorne
parent
2bb94089f7
commit
9e89d688f1
@@ -270,6 +270,7 @@ object LinkDeviceRepository {
|
||||
|
||||
if (cancellationSignal()) {
|
||||
Log.i(TAG, "[createAndUploadArchive] Backup was cancelled.")
|
||||
sendTransferArchiveError(deviceId, deviceCreatedAt, TransferArchiveError.RELINK_REQUESTED)
|
||||
return LinkUploadArchiveResult.BackupCreationCancelled
|
||||
}
|
||||
|
||||
@@ -294,6 +295,7 @@ object LinkDeviceRepository {
|
||||
|
||||
if (cancellationSignal()) {
|
||||
Log.i(TAG, "[createAndUploadArchive] Backup was cancelled.")
|
||||
sendTransferArchiveError(deviceId, deviceCreatedAt, TransferArchiveError.RELINK_REQUESTED)
|
||||
return LinkUploadArchiveResult.BackupCreationCancelled
|
||||
}
|
||||
|
||||
@@ -307,6 +309,7 @@ object LinkDeviceRepository {
|
||||
|
||||
if (cancellationSignal()) {
|
||||
Log.i(TAG, "[createAndUploadArchive] Backup was cancelled.")
|
||||
sendTransferArchiveError(deviceId, deviceCreatedAt, TransferArchiveError.RELINK_REQUESTED)
|
||||
return LinkUploadArchiveResult.BackupCreationCancelled
|
||||
}
|
||||
|
||||
@@ -320,6 +323,7 @@ object LinkDeviceRepository {
|
||||
|
||||
if (cancellationSignal()) {
|
||||
Log.i(TAG, "[createAndUploadArchive] Backup was cancelled.")
|
||||
sendTransferArchiveError(deviceId, deviceCreatedAt, TransferArchiveError.RELINK_REQUESTED)
|
||||
return LinkUploadArchiveResult.BackupCreationCancelled
|
||||
}
|
||||
|
||||
@@ -383,7 +387,7 @@ object LinkDeviceRepository {
|
||||
}
|
||||
|
||||
/**
|
||||
* If [createAndUploadArchive] fails to upload an archive, alert the linked device of the failure and if the user will try again
|
||||
* If [createAndUploadArchive] is cancelled or fails to upload an archive, alert the linked device of the failure and if the user will try again
|
||||
*/
|
||||
fun sendTransferArchiveError(deviceId: Int, deviceCreatedAt: Long, error: TransferArchiveError) {
|
||||
val archiveErrorResult = SignalNetwork.linkDevice.setTransferArchiveError(
|
||||
|
||||
Reference in New Issue
Block a user