From 997568b3254e3a5bd27e01b87448ef29a5cfd4b1 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Sat, 19 Sep 2020 12:45:09 +1000 Subject: [PATCH] Fix crash --- .../migration/WorkManagerFactoryMappings.java | 10 +++++++--- .../securesms/jobs/JobManagerFactories.java | 13 +++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/org/thoughtcrime/securesms/jobmanager/migration/WorkManagerFactoryMappings.java b/src/org/thoughtcrime/securesms/jobmanager/migration/WorkManagerFactoryMappings.java index fa40b4a9ea..1449ace743 100644 --- a/src/org/thoughtcrime/securesms/jobmanager/migration/WorkManagerFactoryMappings.java +++ b/src/org/thoughtcrime/securesms/jobmanager/migration/WorkManagerFactoryMappings.java @@ -47,6 +47,8 @@ import org.thoughtcrime.securesms.jobs.UpdateApkJob; import org.thoughtcrime.securesms.loki.api.BackgroundPollJob; import org.thoughtcrime.securesms.loki.protocol.ClosedGroupUpdateMessageSendJob; import org.thoughtcrime.securesms.loki.protocol.NullMessageSendJob; +import org.thoughtcrime.securesms.loki.protocol.SessionRequestMessageSendJob; +import org.thoughtcrime.securesms.loki.protocol.shelved.MultiDeviceOpenGroupUpdateJob; import java.util.HashMap; import java.util.Map; @@ -57,7 +59,9 @@ public class WorkManagerFactoryMappings { put(AttachmentDownloadJob.class.getName(), AttachmentDownloadJob.KEY); put(AttachmentUploadJob.class.getName(), AttachmentUploadJob.KEY); put(AvatarDownloadJob.class.getName(), AvatarDownloadJob.KEY); + put(BackgroundPollJob.class.getName(), BackgroundPollJob.KEY); put(CleanPreKeysJob.class.getName(), CleanPreKeysJob.KEY); + put(ClosedGroupUpdateMessageSendJob.class.getName(), ClosedGroupUpdateMessageSendJob.KEY); put(CreateSignedPreKeyJob.class.getName(), CreateSignedPreKeyJob.KEY); put(LocalBackupJob.class.getName(), LocalBackupJob.KEY); put(MmsDownloadJob.class.getName(), MmsDownloadJob.KEY); @@ -68,8 +72,10 @@ public class WorkManagerFactoryMappings { put(MultiDeviceContactUpdateJob.class.getName(), MultiDeviceContactUpdateJob.KEY); put(MultiDeviceGroupUpdateJob.class.getName(), MultiDeviceGroupUpdateJob.KEY); put(MultiDeviceProfileKeyUpdateJob.class.getName(), MultiDeviceProfileKeyUpdateJob.KEY); + put(MultiDeviceOpenGroupUpdateJob.class.getName(), MultiDeviceOpenGroupUpdateJob.KEY); put(MultiDeviceReadUpdateJob.class.getName(), MultiDeviceReadUpdateJob.KEY); put(MultiDeviceVerifiedUpdateJob.class.getName(), MultiDeviceVerifiedUpdateJob.KEY); + put(NullMessageSendJob.class.getName(), NullMessageSendJob.KEY); put(PushContentReceiveJob.class.getName(), PushContentReceiveJob.KEY); put(PushDecryptJob.class.getName(), PushDecryptJob.KEY); put(PushGroupSendJob.class.getName(), PushGroupSendJob.KEY); @@ -77,8 +83,6 @@ public class WorkManagerFactoryMappings { put(PushMediaSendJob.class.getName(), PushMediaSendJob.KEY); put(PushNotificationReceiveJob.class.getName(), PushNotificationReceiveJob.KEY); put(PushTextSendJob.class.getName(), PushTextSendJob.KEY); - put(NullMessageSendJob.class.getName(), NullMessageSendJob.KEY); - put(ClosedGroupUpdateMessageSendJob.class.getName(), ClosedGroupUpdateMessageSendJob.KEY); put(RefreshAttributesJob.class.getName(), RefreshAttributesJob.KEY); put(RefreshPreKeysJob.class.getName(), RefreshPreKeysJob.KEY); put(RefreshUnidentifiedDeliveryAbilityJob.class.getName(), RefreshUnidentifiedDeliveryAbilityJob.KEY); @@ -86,12 +90,12 @@ public class WorkManagerFactoryMappings { put(RetrieveProfileAvatarJob.class.getName(), RetrieveProfileAvatarJob.KEY); put(RetrieveProfileJob.class.getName(), RetrieveProfileJob.KEY); put(RotateCertificateJob.class.getName(), RotateCertificateJob.KEY); - put(BackgroundPollJob.class.getName(), BackgroundPollJob.KEY); put(RotateProfileKeyJob.class.getName(), RotateProfileKeyJob.KEY); put(RotateSignedPreKeyJob.class.getName(), RotateSignedPreKeyJob.KEY); put(SendDeliveryReceiptJob.class.getName(), SendDeliveryReceiptJob.KEY); put(SendReadReceiptJob.class.getName(), SendReadReceiptJob.KEY); put(ServiceOutageDetectionJob.class.getName(), ServiceOutageDetectionJob.KEY); + put(SessionRequestMessageSendJob.class.getName(), SessionRequestMessageSendJob.KEY); put(SmsReceiveJob.class.getName(), SmsReceiveJob.KEY); put(SmsSendJob.class.getName(), SmsSendJob.KEY); put(SmsSentJob.class.getName(), SmsSentJob.KEY); diff --git a/src/org/thoughtcrime/securesms/jobs/JobManagerFactories.java b/src/org/thoughtcrime/securesms/jobs/JobManagerFactories.java index a6d661643e..6f3c34e310 100644 --- a/src/org/thoughtcrime/securesms/jobs/JobManagerFactories.java +++ b/src/org/thoughtcrime/securesms/jobs/JobManagerFactories.java @@ -1,6 +1,7 @@ package org.thoughtcrime.securesms.jobs; import android.app.Application; + import androidx.annotation.NonNull; import org.thoughtcrime.securesms.jobmanager.Constraint; @@ -15,9 +16,9 @@ import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraint; import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraintObserver; import org.thoughtcrime.securesms.loki.api.BackgroundPollJob; import org.thoughtcrime.securesms.loki.protocol.ClosedGroupUpdateMessageSendJob; -import org.thoughtcrime.securesms.loki.protocol.shelved.MultiDeviceOpenGroupUpdateJob; import org.thoughtcrime.securesms.loki.protocol.NullMessageSendJob; import org.thoughtcrime.securesms.loki.protocol.SessionRequestMessageSendJob; +import org.thoughtcrime.securesms.loki.protocol.shelved.MultiDeviceOpenGroupUpdateJob; import java.util.Arrays; import java.util.HashMap; @@ -31,7 +32,9 @@ public final class JobManagerFactories { put(AttachmentDownloadJob.KEY, new AttachmentDownloadJob.Factory()); put(AttachmentUploadJob.KEY, new AttachmentUploadJob.Factory()); put(AvatarDownloadJob.KEY, new AvatarDownloadJob.Factory()); + put(BackgroundPollJob.KEY, new BackgroundPollJob.Factory()); put(CleanPreKeysJob.KEY, new CleanPreKeysJob.Factory()); + put(ClosedGroupUpdateMessageSendJob.KEY, new ClosedGroupUpdateMessageSendJob.Factory()); put(CreateSignedPreKeyJob.KEY, new CreateSignedPreKeyJob.Factory()); put(LocalBackupJob.KEY, new LocalBackupJob.Factory()); put(MmsDownloadJob.KEY, new MmsDownloadJob.Factory()); @@ -41,11 +44,13 @@ public final class JobManagerFactories { put(MultiDeviceConfigurationUpdateJob.KEY, new MultiDeviceConfigurationUpdateJob.Factory()); put(MultiDeviceContactUpdateJob.KEY, new MultiDeviceContactUpdateJob.Factory()); put(MultiDeviceGroupUpdateJob.KEY, new MultiDeviceGroupUpdateJob.Factory()); + put(MultiDeviceOpenGroupUpdateJob.KEY, new MultiDeviceOpenGroupUpdateJob.Factory()); put(MultiDeviceProfileKeyUpdateJob.KEY, new MultiDeviceProfileKeyUpdateJob.Factory()); put(MultiDeviceReadUpdateJob.KEY, new MultiDeviceReadUpdateJob.Factory()); put(MultiDeviceStickerPackOperationJob.KEY, new MultiDeviceStickerPackOperationJob.Factory()); put(MultiDeviceStickerPackSyncJob.KEY, new MultiDeviceStickerPackSyncJob.Factory()); put(MultiDeviceVerifiedUpdateJob.KEY, new MultiDeviceVerifiedUpdateJob.Factory()); + put(NullMessageSendJob.KEY, new NullMessageSendJob.Factory()); put(PushContentReceiveJob.KEY, new PushContentReceiveJob.Factory()); put(PushDecryptJob.KEY, new PushDecryptJob.Factory()); put(PushGroupSendJob.KEY, new PushGroupSendJob.Factory()); @@ -53,8 +58,6 @@ public final class JobManagerFactories { put(PushMediaSendJob.KEY, new PushMediaSendJob.Factory()); put(PushNotificationReceiveJob.KEY, new PushNotificationReceiveJob.Factory()); put(PushTextSendJob.KEY, new PushTextSendJob.Factory()); - put(NullMessageSendJob.KEY, new NullMessageSendJob.Factory()); - put(ClosedGroupUpdateMessageSendJob.KEY, new ClosedGroupUpdateMessageSendJob.Factory()); put(RefreshAttributesJob.KEY, new RefreshAttributesJob.Factory()); put(RefreshPreKeysJob.KEY, new RefreshPreKeysJob.Factory()); put(RefreshUnidentifiedDeliveryAbilityJob.KEY, new RefreshUnidentifiedDeliveryAbilityJob.Factory()); @@ -62,12 +65,12 @@ public final class JobManagerFactories { put(RetrieveProfileAvatarJob.KEY, new RetrieveProfileAvatarJob.Factory(application)); put(RetrieveProfileJob.KEY, new RetrieveProfileJob.Factory(application)); put(RotateCertificateJob.KEY, new RotateCertificateJob.Factory()); - put(BackgroundPollJob.KEY, new BackgroundPollJob.Factory()); put(RotateProfileKeyJob.KEY, new RotateProfileKeyJob.Factory()); put(RotateSignedPreKeyJob.KEY, new RotateSignedPreKeyJob.Factory()); put(SendDeliveryReceiptJob.KEY, new SendDeliveryReceiptJob.Factory()); put(SendReadReceiptJob.KEY, new SendReadReceiptJob.Factory()); put(ServiceOutageDetectionJob.KEY, new ServiceOutageDetectionJob.Factory()); + put(SessionRequestMessageSendJob.KEY, new SessionRequestMessageSendJob.Factory()); put(SmsReceiveJob.KEY, new SmsReceiveJob.Factory()); put(SmsSendJob.KEY, new SmsSendJob.Factory()); put(SmsSentJob.KEY, new SmsSentJob.Factory()); @@ -76,8 +79,6 @@ public final class JobManagerFactories { put(TrimThreadJob.KEY, new TrimThreadJob.Factory()); put(TypingSendJob.KEY, new TypingSendJob.Factory()); put(UpdateApkJob.KEY, new UpdateApkJob.Factory()); - put(SessionRequestMessageSendJob.KEY, new SessionRequestMessageSendJob.Factory()); - put(MultiDeviceOpenGroupUpdateJob.KEY, new MultiDeviceOpenGroupUpdateJob.Factory()); }}; }