Be more persistent about completing the spk job

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2016-03-11 17:07:22 -08:00
parent 9aec80beda
commit 8c8cd41359

View File

@ -27,8 +27,8 @@ import org.thoughtcrime.securesms.dependencies.AxolotlStorageModule;
import org.thoughtcrime.securesms.dependencies.InjectableType; import org.thoughtcrime.securesms.dependencies.InjectableType;
import org.thoughtcrime.securesms.dependencies.RedPhoneCommunicationModule; import org.thoughtcrime.securesms.dependencies.RedPhoneCommunicationModule;
import org.thoughtcrime.securesms.dependencies.TextSecureCommunicationModule; import org.thoughtcrime.securesms.dependencies.TextSecureCommunicationModule;
import org.thoughtcrime.securesms.jobs.CreateSignedPreKeyJob;
import org.thoughtcrime.securesms.jobs.GcmRefreshJob; import org.thoughtcrime.securesms.jobs.GcmRefreshJob;
import org.thoughtcrime.securesms.jobs.RefreshAttributesJob;
import org.thoughtcrime.securesms.jobs.persistence.EncryptingJobSerializer; import org.thoughtcrime.securesms.jobs.persistence.EncryptingJobSerializer;
import org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirementProvider; import org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirementProvider;
import org.thoughtcrime.securesms.jobs.requirements.MediaNetworkRequirementProvider; import org.thoughtcrime.securesms.jobs.requirements.MediaNetworkRequirementProvider;
@ -70,6 +70,7 @@ public class ApplicationContext extends Application implements DependencyInjecto
initializeDependencyInjection(); initializeDependencyInjection();
initializeJobManager(); initializeJobManager();
initializeGcmCheck(); initializeGcmCheck();
initializeSignedPreKeyCheck();
} }
@Override @Override
@ -132,4 +133,10 @@ public class ApplicationContext extends Application implements DependencyInjecto
} }
} }
private void initializeSignedPreKeyCheck() {
if (!TextSecurePreferences.isSignedPreKeyRegistered(this)) {
jobManager.add(new CreateSignedPreKeyJob(this));
}
}
} }